freebsd / portupgrade

FreeBSD ports and packages management app
http://www.FreeBSD.org/
BSD 3-Clause "New" or "Revised" License
42 stars 26 forks source link

Add feature to portsclean: Ignore files specified in IGNORE_LIBS in pkgtools.conf when running with -L (--libclean) #52

Open bigsexyland opened 11 years ago

bigsexyland commented 11 years ago

This feature is interesting because portupgrade calls "portsclean -QL" to remove orphaned libraries. If you have made local copies of (or links to) these libraries, they will get blown away. In my case, sendmail was compiled to reference libsasl2.so.2. I then upgraded cyrus-sasl, which changed the library's name to libsasl2.so.3. Sendmail would crash on invocation when it couldn't find .2, so first I symlinked, then hardlinked, then copied .3 to .2. Each time though my copy got blown away by "portsclean -QL" (via portupgrade).

A number of others had similar issues based on Google searches, with no good solution found. Although portsclean copies the library to compat/ and runs libtool, sendmail still crashed. Rebuilding sendmail failed for some reason too. The simplest fix for me was to patch portsclean to allow it to ignore specified files when run with -L (--libclean).

I think this is a worthwhile feature in general, as other users might have similar issues with "orphaned" libraries still being required. I am not a Ruby developer, so feel free to clean up any ugly code etc.

bdrewery commented 11 years ago

By default portupgrade does save shared libraries and only deletes them if -u is specified, or if the libraries are shadowed and already exist in ldconfig -r outside of the compat directory.