On Aug 14, 2011, at 1:15 PM, Belal Salem wrote: > Thank for the perfect details! > since I'm running RHEL-5 (as my system base and based on rpm-4.4) but updated > from RHEL-6 (glibc and its deps and python), > and according to your explanation, I guess I would better recompile rpm with > the --disable-dirname-and-symlink-deps > specially that adding the folders to _SOME_ will not be suitable for my case > since I have requests for different folder whenever I'm trying to install > packages from RHEL-5 or RHEL-6. >
Actually its likely easier to use a run-time rather than a compile-time setting. The parentdir/linto dependencies are implicit in the sense that there's no Requires: that is explicitly needed. The dependencies are synthesized from pre-existing information in a package. To configure parentdir/linkto dependencies at run-time: 1) Make sure that RPM_OPTIONAL_DIRNAME_AND_SYMLINK_DEPS is enabled. That is likely already the case if you haven't disabled. Check config.h after running ./configure (and you can always edit config.h after running configure if all else fails). >> >> The code to Rip It Out! Have it your own way! is (from lib/depends.c): >> #if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_ARK) || >> defined(RPM_VENDOR_OPENMAMBA) || >> defined(RPM_OPTIONAL_DIRNAME_AND_SYMLINK_DEPS) /* >> optional-dirname-and-symlink-deps */ >> int dirname_deps; >> int symlink_deps; >> #endif >> … >> #if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_ARK) || >> defined(RPM_VENDOR_OPENMAMBA) || >> defined(RPM_OPTIONAL_DIRNAME_AND_SYMLINK_DEPS) /* >> optional-dirname-and-symlink-deps */ >> dirname_deps = >> rpmExpandNumeric("%{?_check_dirname_deps}%{?!_check_dirname_deps:1}"); >> if (dirname_deps) { >> #endif >> … >> #if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_ARK) || >> defined(RPM_VENDOR_OPENMAMBA) || >> defined(RPM_OPTIONAL_DIRNAME_AND_SYMLINK_DEPS) /* >> optional-dirname-and-symlink-deps */ >> } >> >> symlink_deps = >> rpmExpandNumeric("%{?_check_symlink_deps}%{?!_check_symlink_deps:1}"); >> if (symlink_deps) { >> #endif >> … >> } >> 2) Edit /etc/rpm/macros (create if not existent) to add %_check_dirname_deps 0 %_check_symlink_deps 0 to disable. 3) Turn on symlink dependencies: its less annoying than parentdir deps and is almost always a package failure when encountered (aka a dangling symlink that points to a non-existent end-point). 4) When you have a mostly stable/unchanging set of packages installed, then turn on parentdirectiory dependencies. Then do mkdir -p /etc/rpm/sysinfo rpm -Va --nofiles | grep '^/' | sort -u > /etc/rpm/sysinfo/Dirnames (there is a --orphandirs option to rpm -Va that does the above, I'm just too lazy to check how to use it: its a popt alias that does essentially the above). 5) Run rpm -Va --nofiles periodically, and when you see a "orphan directory", i.e. a directory that isn't explicitly in any package file manifest, then just add that directory to /etc/rpm/sysinfo/Dirnames. The annoyance is mostly that RHEL5/RHEL6 never bothered to do the QA to ensure that rpm --erase would also remove created directories. BTW, if you are going to use rpm-5.3.11` on RHEL5/RHEL6, then you need to convert your rpmdb so that header instance numbers are always in network order (needed for optimal btree access). hth 73 de Jeff______________________________________________________________________ RPM Package Manager http://rpm5.org User Communication List rpm-users@rpm5.org