Bug 32517 - rpm-4.0.2-7x --prefix arg gets corrupted
rpm-4.0.2-7x --prefix arg gets corrupted
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-03-20 23:58 EST by Mike Pope
Modified: 2007-04-18 12:32 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-03-27 21:42:18 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Mike Pope 2001-03-20 23:58:08 EST
Whenever I try to use --prefix, the last significant directory-separating
slash gets dropped from the prefix directory.

[root@riesling /tmp]# mkdir /tmp/foo
[root@riesling /tmp]# rpm -Uv --prefix /tmp/foo <some-relocatable-package> 
c2man-2.41-14
error: can't unlink /tmpfoo-RPMDELETE: Is a directory
error: can't rename /tmpfoo to /tmpfoo-RPMDELETE: Is a directory
error: unpacking of archive failed on file /tmpfoo: cpio: unlink failed -
Is a directory

I can reproduce this across any combination of relocatable package and/or
choice of prefix directory.  The problem surfaced today, when I upgraded to
rpm-4.0.2-7x.
Comment 1 Jeff Johnson 2001-03-23 11:19:05 EST
Try adding a trailing / character, as --prefix (or it's new incarnation
--reloccate <oldpath>=<newpath>) permits partial specification of paths IIRC
Comment 2 Mike Pope 2001-03-25 18:26:07 EST
No luck, with either --prefix or --relocate, with or without trailing slash.

  [root@riesling /tmp]# rpm -Uv --test --prefix /usr/local/ zip-2.3-8.i386.rpm   
  Preparing packages for installation...
  package zip-2.3-8 is already installed
  file /usrlocal from install of zip-2.3-8 conflicts with file from package  
filesystem-2.0.7-1
  ...

(zip-2.3-8 from RH7.0, but the choice of package does not appear to matter)
Comment 3 Jeff Johnson 2001-03-26 08:44:01 EST
But the behavior is different if you add a trailing '/'.  You can eliminate the
conflicts message by adding --nodeps. Does that install your package with
relocated
path /usr/local?
Comment 4 Mike Pope 2001-03-27 21:42:15 EST
No, the difference was only between an install and an upgrade.  Here is a
cleaner example.

# rpm -e arpwatch
# rpm --install --prefix /tmp/foo/ arpwatch-2.1a4-29.i386.rpm 
error: can't rename /tmpfoo to /tmpfoo-RPMDELETE: Is a directory
error: unpacking of archive failed on file /tmpfoo: cpio: unlink failed - Is a
directory
# rpm --install --prefix /tmp/foo arpwatch-2.1a4-29.i386.rpm 
error: can't rename /tmpfoo to /tmpfoo-RPMDELETE: Is a directory
error: unpacking of archive failed on file /tmpfoo: cpio: unlink failed - Is a
directory
# rpm --install --relocate /usr/=/tmp/foo/ arpwatch-2.1a4-29.i386.rpm 
error: can't rename /tmpfoo to /tmpfoo-RPMDELETE: Is a directory
error: unpacking of archive failed on file /tmpfoo: cpio: unlink failed - Is a
directory
# rpm -q arpwatch
package arpwatch is not installed

The other three combinations of --relocate with trailing and non-trailing
slashes are all the same.  I am quite unconvinced the *trailing* slash (or lack
thereof) are the problem (nor should it be).
Comment 5 Jeff Johnson 2001-04-17 14:16:52 EDT
This problem is fixed in the rpm-4_0 branch in CVS, will be in rpm-4.0.3-0.5.

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