Bug 61693 - Conditional Extraneous Directories with --prefix
Conditional Extraneous Directories with --prefix
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-03-22 18:23 EST by Eric Koegler
Modified: 2007-04-18 12:41 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-06-07 16:52:30 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Eric Koegler 2002-03-22 18:23:46 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; Mozilla/4.0 
(compatible; MSIE 5.5; Windows NT; INTC); H010818)

Description of problem:
I've made a relocatable rpm which seems to work fine.  The spec file has
"Prefix: /opt/intel".
I get strange reproducible behavior when I specify "--prefix" at install
time.

1.  Without prefix, it installs to /opt/intel.  See A below.
2.  With a prefix which does not include /opt/intel, it works fine.  See B.
3.  With a prefix of /opt/intel, it works fine.  See C.
4.  With a prefix of /opt/intel/foo/bar, extra directories are installed at
install time, but not uninstalled at uninstall time.  See question marks in
D, E.

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


How reproducible:
Always

Steps to Reproduce:
Create relocatable package.  Install with --prefix XXX, where XXX = the 
original prefix with an extra directory added to it.

Actual Results:  ===A===
root</x/test/work>find /opt/
/opt/
root</x/test/work>rpm -i intel-ildb6-6.0-187.i386.rpm 
root</x/test/work>find /opt/
/opt/
/opt/intel
/opt/intel/compiler60
/opt/intel/compiler60/docs
/opt/intel/compiler60/docs/ldbsupport
root</x/test/work>rpm -e $(rpm -qa|grep intel)
root</x/test/work>find /opt/
/opt/

===B===
root</x/test/work>rpm -i --prefix /opt/CUSTOM intel-ildb6-6.0-187.i386.rpm 
root</x/test/work>find /opt/
/opt/
/opt/CUSTOM
/opt/CUSTOM/compiler60
/opt/CUSTOM/compiler60/docs
/opt/CUSTOM/compiler60/docs/ldbsupport
root</x/test/work>rpm -e $(rpm -qa|grep intel)
root</x/test/work>find /opt/
/opt/

===C===
root</x/test/work>rpm -i --prefix /opt/intel intel-ildb6-6.0-187.i386.rpm 
root</x/test/work>find /opt/
/opt/
/opt/intel
/opt/intel/compiler60
/opt/intel/compiler60/docs
/opt/intel/compiler60/docs/ldbsupport
root</x/test/work>rpm -e $(rpm -qa|grep intel)
root</x/test/work>find /opt/
/opt/

===D===
root</x/test/work>rpm -i --prefix /opt/intel/abc
intel-ildb6-6.0-187.i386.rpm 
root</x/test/work>find /opt/
/opt/
/opt/intel
/opt/intel/abc
/opt/intel/abc/abc		?????????
/opt/intel/abc/compiler60
/opt/intel/abc/compiler60/docs
/opt/intel/abc/compiler60/docs/ldbsupport
root</x/test/work>rpm -e $(rpm -qa|grep intel)
root</x/test/work>find /opt/
/opt/
/opt/intel
/opt/intel/abc			?????????
root</x/test/work>rm /opt/* -rf

===E===
root</x/test/work>rpm -i --prefix /opt/intel/abc/xxx
intel-ildb6-6.0-187.i386.rpm 
root</x/test/work>find /opt/
/opt/
/opt/intel
/opt/intel/abc
/opt/intel/abc/xxx
/opt/intel/abc/xxx/abc		?????????
/opt/intel/abc/xxx/abc/xxx	?????????
/opt/intel/abc/xxx/compiler60
/opt/intel/abc/xxx/compiler60/docs
/opt/intel/abc/xxx/compiler60/docs/ldbsupport
root</x/test/work>rpm -e $(rpm -qa|grep intel)
root</x/test/work>find /opt/
/opt/
/opt/intel
/opt/intel/abc
/opt/intel/abc/xxx		?????????
/opt/intel/abc/xxx/abc		?????????


Expected Results:  No extraneous directories created.
All newly created directories and files removed at uninstall time.

Additional info:
Comment 1 Jeff Johnson 2002-12-28 08:57:55 EST
My initial guess is that given nested paths like
    --relocate /opt/intl=/opt/intel/foo/bar

I've checked this using the time package with
    Prefix: /usr/bin
    Prefix: /usr/share
Installing with --relocate /usr/bin=/usr/bin/abc/def
works fine.

However, what's happening is that the new directories
mentioned ar not ownd by any package (i.e. not in rpm -ql
output) and so are untouched when erased.

This is xpected rpm behavior.
Comment 2 Eric Koegler 2002-12-30 12:56:49 EST
I said that under certain conditions,
1.  RPM creates extraneous directories at install-time, and
2.  RPM doesn't remove these directories at erase-time.

You addressed 2, in saying that RPM doesn't erase these directories because 
they're not owned by any RPM packages--and said this is expected behavior.

You did not address the primary concern (1.).  Is it expected behavior that RPM 
creates extraneous directories under certain conditions?
Comment 3 Jeff Johnson 2002-12-30 13:52:01 EST
Yes, rpm is just like tar, will silently create
needed directories in path even if the directories are not
explictly in the package payload.

The only additional wrinkle here is that the extra
directories are being introduced by --relocate path
rewrite.
Comment 4 Paul Nasrat 2005-06-07 16:52:30 EDT
This all seems explained here, closing.

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