Discussion:
files getting overwritten
Zac Elston
2008-05-07 20:17:36 UTC
Permalink
Greetings.

I'm attempting to demonstrate how RPMs will save the developer's butt
by not allowing a file to be overwritten and during my demo, PackageB
overwrites PackageA's file

[***@webd-m01 ~]# rpm -q --whatprovides /usr/local/testfile
psi-test-1-dev
psi-retest-2-dev

what did I do wrong?

--specfile snippets

Summary: file overwrite test
Name: psi-test
Version: 1
Release: dev
install -D testfile $RPM_BUILD_ROOT/usr/local/psi/testfile
%files
%defattr(644,apache,apache)
%config(noreplace) /usr/local/psi/testfile

Summary: file overwrite test
Name: psi-retest
Version: 2
Release: dev
install -D testfile $RPM_BUILD_ROOT/usr/local/psi/testfile
%files
%defattr(644,apache,apache)
/usr/local/psi/testfile



-zac
Rex Dieter
2008-05-07 21:18:11 UTC
Permalink
Post by Zac Elston
Greetings.
I'm attempting to demonstrate how RPMs will save the developer's butt
by not allowing a file to be overwritten and during my demo, PackageB
overwrites PackageA's file
psi-test-1-dev
psi-retest-2-dev
what did I do wrong?
Nothing, as long as the file is the *same* (content, checksum, permissions,
timestamp, etc), then it's perfectly legal to be owned by multiple pkgs.

-- Rex
Dan Mahoney, System Admin
2008-05-07 21:30:25 UTC
Permalink
Post by Rex Dieter
Post by Zac Elston
Greetings.
I'm attempting to demonstrate how RPMs will save the developer's butt
by not allowing a file to be overwritten and during my demo, PackageB
overwrites PackageA's file
psi-test-1-dev
psi-retest-2-dev
what did I do wrong?
Nothing, as long as the file is the *same* (content, checksum, permissions,
timestamp, etc), then it's perfectly legal to be owned by multiple pkgs.
If that's the case, and all those things are the same, how can he even
tell it's been overwritten?

-Dan
Post by Rex Dieter
-- Rex
_______________________________________________
Rpm-list mailing list
https://www.redhat.com/mailman/listinfo/rpm-list
--

<Wrin> quick, somebody tell me the moon phase please?
<Dan_Wood> Wrin: Plummeting.

-Undernet #reboot, 9/11/01 (day of the WTC bombing)

--------Dan Mahoney--------
Techie, Sysadmin, WebGeek
Gushi on efnet/undernet IRC
ICQ: 13735144 AIM: LarpGM
Site: http://www.gushi.org
---------------------------
Richard Shade
2008-05-07 21:50:52 UTC
Permalink
Post by Zac Elston
Greetings.
I'm attempting to demonstrate how RPMs will save the developer's butt by
not allowing a file to be overwritten and during my demo, PackageB
overwrites PackageA's file
psi-test-1-dev
psi-retest-2-dev
what did I do wrong?
I am considering from this context that PackageA=psi-test-1-dev, and
PackageB=psi-retest-2-dev. If so I think you also need %config(noreplace)
/usr/local/psi/testfile in PackageB instead of just leaving it under files.
Post by Zac Elston
--specfile snippets
Summary: file overwrite test
Name: psi-test
Version: 1
Release: dev
install -D testfile $RPM_BUILD_ROOT/usr/local/psi/testfile
%files
%defattr(644,apache,apache)
%config(noreplace) /usr/local/psi/testfile
Summary: file overwrite test
Name: psi-retest
Version: 2
Release: dev
install -D testfile $RPM_BUILD_ROOT/usr/local/psi/testfile
%files
%defattr(644,apache,apache)
/usr/local/psi/testfile
-zac
_______________________________________________
Rpm-list mailing list
https://www.redhat.com/mailman/listinfo/rpm-list
--
Thanks,

Richard Shade
RightScale
http://www.rightscale.com/
devzero2000
2008-05-08 08:53:21 UTC
Permalink
In reality the file isn't overwritten, there isn't "conflict": the md5sum is
the same, the perm also ecc. And this, in rpm, is OK.
In fact if you remove a package only, the file testfile is not removed as
well: the other package own it.

OTHO, if you change in a spec file only the perm for example
(or the file content ) there is a true conflict and it is possible to
install only one rpm: rpm refuse to install the other.

In conclusion, the behavior of the RPM is corrected avoiding the real
conflicts

Best Regards
Post by Richard Shade
Post by Zac Elston
Greetings.
I'm attempting to demonstrate how RPMs will save the developer's butt by
not allowing a file to be overwritten and during my demo, PackageB
overwrites PackageA's file
psi-test-1-dev
psi-retest-2-dev
what did I do wrong?
I am considering from this context that PackageA=psi-test-1-dev, and
PackageB=psi-retest-2-dev. If so I think you also need %config(noreplace)
/usr/local/psi/testfile in PackageB instead of just leaving it under files.
Post by Zac Elston
--specfile snippets
Summary: file overwrite test
Name: psi-test
Version: 1
Release: dev
install -D testfile $RPM_BUILD_ROOT/usr/local/psi/testfile
%files
%defattr(644,apache,apache)
%config(noreplace) /usr/local/psi/testfile
Summary: file overwrite test
Name: psi-retest
Version: 2
Release: dev
install -D testfile $RPM_BUILD_ROOT/usr/local/psi/testfile
%files
%defattr(644,apache,apache)
/usr/local/psi/testfile
-zac
_______________________________________________
Rpm-list mailing list
https://www.redhat.com/mailman/listinfo/rpm-list
--
Thanks,
Richard Shade
RightScale
http://www.rightscale.com/
_______________________________________________
Rpm-list mailing list
https://www.redhat.com/mailman/listinfo/rpm-list
Zac Elston
2008-05-09 14:58:28 UTC
Permalink
Post by Rex Dieter
Post by Zac Elston
I'm attempting to demonstrate how RPMs will save the developer's butt
by not allowing a file to be overwritten and during my demo, PackageB
overwrites PackageA's file
psi-test-1-dev
psi-retest-2-dev
what did I do wrong?
Nothing, as long as the file is the *same* (content, checksum,
permissions,
timestamp, etc), then it's perfectly legal to be owned by multiple
pkgs.
$ cat psi-test/testfile
ithis is from psi-test
$ cat psi-retest/testfile
this is from retest

$ cat psi-retest/testfile |md5sum
995d311d3427b79c74090566eeadb78d -
$ cat psi-test/testfile |md5sum
80e19d61c34a1879546740c1aa44625b -

your serve.

-zac
Zac Elston
2008-05-09 15:14:55 UTC
Permalink
Subject: files getting overwritten
Greetings.
I'm attempting to demonstrate how RPMs will save the developer's
butt by not allowing a file to be overwritten and during my demo,
PackageB overwrites PackageA's file
psi-test-1-dev
psi-retest-2-dev
what did I do wrong?
I discovered it must be a function of RHEL's up2date. rpm works as
expected while up2date allows the overwrite


[***@webd-m01 etc]# rpm -ivh http://kickstart/packages/dev/psi-
test-1.1-dev.i386.rpm
Retrieving http://kickstart/packages/dev/psi-test-1.1-dev.i386.rpm
Preparing...
########################################### [100%]
1:psi-test
########################################### [100%]
[***@webd-m01 etc]# rpm -ivh http://kickstart/packages/dev/psi-
retest-2.2-dev.i386.rpm
Retrieving http://kickstart/packages/dev/psi-retest-2.2-dev.i386.rpm
Preparing...
########################################### [100%]
file /usr/local/psi/testfile from install of psi-retest-2.2-
dev conflicts with file from package psi-test-1.1-dev

-zaq

Loading...