Bug 61693 - Conditional Extraneous Directories with --prefix
Summary: Conditional Extraneous Directories with --prefix
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm
Version: 7.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-03-22 23:23 UTC by Eric Koegler
Modified: 2007-04-18 16:41 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-06-07 20:52:30 UTC
Embargoed:


Attachments (Terms of Use)

Description Eric Koegler 2002-03-22 23:23:46 UTC
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 13:57:55 UTC
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 17:56:49 UTC
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 18:52:01 UTC
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 20:52:30 UTC
This all seems explained here, closing.


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