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:
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.
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?
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.
This all seems explained here, closing.