Bug 99304 - rpm -U --relocate <old>=<new> does delete files
rpm -U --relocate <old>=<new> does delete files
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
9
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Paul Nasrat
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-07-17 07:45 EDT by Need Real Name
Modified: 2007-04-18 12:55 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-11-29 14:44:36 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Test case that reproduces the problem. (1.92 KB, application/octet-stream)
2003-10-10 22:32 EDT, Jason Brittain
no flags Details

  None (edit)
Description Need Real Name 2003-07-17 07:45:05 EDT
Description of problem:
When upgrading a package with a newer version using the relocate option, RPM 
seems to delete the files installed as part of that package, and the RPM 
database says the system has the newer version.

Version-Release number of selected component (if applicable):
rpm-4.2-0.69

How reproducible:
Always

Steps to Reproduce:
1.rpm -i --relocate <defaultpath>=<newpath> <package.rpm>
2.rpm -U --relocate <defaultpath>=<newpath> <updated package.rpm>
3.rpm -q <package> returns the new version strip
4.rpm -V <package> reports all files of the package as missing    

Actual results:
all files which should be upgraded are gone

Expected results:
upgraded files

Additional info:
Comment 1 Jeff Johnson 2003-07-18 16:41:00 EDT
Can you supply an explicit test case? Otherwise, I cannot
fix anything.
Comment 2 Jason Brittain 2003-10-10 22:32:02 EDT
Created attachment 95114 [details]
Test case that reproduces the problem.
Comment 3 Jason Brittain 2003-10-10 22:34:57 EDT
Here's how to reproduce this bug on Red Hat 9:

Download my test case tar.gz file:
https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=95114&action=view

Unpack the test case source in /tmp:
# cd /tmp
# tar zxvf bz-99304-testcase.tar.gz
# cd bz-99304-testcase

Build the relocateable-1.0-1.noarch.rpm package:
# ./build1.sh

Build the relocateable-1.0-2.noarch.rpm package:
# ./build2.sh

Install the relocateable-1.0-1.noarch.rpm package:
# rpm -ivh --prefix /tmp/bz-99304-testcase/test
RPMS/noarch/relocateable-1.0-1.noarch.rpm 
Preparing...                ########################################### [100%]
   1:relocateable           ########################################### [100%]

List all files installed as part of the "relocateable" package:
# rpm -ql relocateable
/tmp/bz-99304-testcase/test
/tmp/bz-99304-testcase/test/readme.txt

Query RPM to find out what package owns the test/readme.txt file:
# rpm -qf test/readme.txt 
relocateable-1.0-1
# ls -la test/readme.txt 
-rw-r--r--    1 root     root           74 Oct 10 19:01 test/readme.txt
# cat test/readme.txt 
Hi!
This file is the only file contained in the relocateable RPM package.

Looks good..

Now upgrade to the relocateable-1.0-2.noarch.rpm package, in the same
prefix in the file system:
# rpm -Uvh --prefix /tmp/bz-99304-testcase/test
RPMS/noarch/relocateable-1.0-2.noarch.rpm 
Preparing...                ########################################### [100%]
   1:relocateable           ########################################### [100%]

Now look at the packages files:
# cat test/readme.txt 
cat: test/readme.txt: No such file or directory
# ls -la test
ls: test: No such file or directory

But, RPM says it should be there.
# rpm -ql relocateable
/tmp/bz-99304-testcase/test
/tmp/bz-99304-testcase/test/readme.txt

Try upgrading it again (second upgrade attempt), just after that with --force:
# rpm -Uvh --force --prefix /tmp/bz-99304-testcase/test
RPMS/noarch/relocateable-1.0-2.noarch.rpm
Preparing...                ########################################### [100%]
   1:relocateable           ########################################### [100%]

Now look at the packages files:
# cat test/readme.txt
Hi!
This file is the only file contained in the relocateable RPM package.
# ls -la test/readme.txt 
-rw-r--r--    1 root     root           74 Oct 10 19:01 test/readme.txt

It shows back up again on the second attempt to upgrade to the same RPM.
All subsequent requests to upgrade to the same RPM work fine too, it's
just the first time you try to upgrade to a new rev ("Release") of the
package.

At least on my RH9 machine, if you don't relocate the package, upgrading
it seems to work fine.  But, I want to be able to relocate it.  :)

I was unable to reproduce this same behavior on Red Hat 7.3.

Thanks!

Comment 4 Jason Brittain 2004-02-11 12:01:03 EST
Hi there.  This bug doesn't seem to be getting any attention.  Is
someone working on it?  It says it's assigned to (Jeff Johnson), but
that the status is still NEEDINFO.  Is that status wrong?  If not,
what info is still missing?  I'd really like this bug fixed.
Comment 5 Paul Nasrat 2005-11-29 14:44:36 EST
Tested your case (thanks for the detailed test case) on rpm-4.4.2-9.i386
(tomorrows rawhide) and worked:

rpm -Uvh --prefix /tmp/bz-99304-testcase/test/ RPMS/relocateable-1.0-2.noarch.rpm
Preparing...                ########################################### [100%]
   1:relocateable           ########################################### [100%]

[pauln@enki bz-99304-testcase]$ cat test/readme.txt
Hi!
This file is the only file contained in the relocateable RPM package.

$ rpm -ql relocateable
/tmp/bz-99304-testcase/test
/tmp/bz-99304-testcase/test/readme.txt
$ rpm -q relocateable
relocateable-1.0-2.noarch
Comment 6 Jason Brittain 2005-12-08 01:18:23 EST
I must say that I'm not at all surprised that it works, when you test it
more than two years later.  :)

Thanks.

Note You need to log in before you can comment on or make changes to this bug.