All pastes #160057 Raw Edit

Unnamed

public text v1 · immutable
·published 2006-09-03 20:34 UTC
rendered paste body
Index: apkg-native
===================================================================
RCS file: /pack/anoncvs/autopackage/main/share/apkg-native,v
retrieving revision 1.4
diff -u -r1.4 apkg-native
--- apkg-native	2006/06/12 01:04:39	1.4
+++ apkg-native	2006/09/03 20:33:46
@@ -97,6 +97,9 @@
 # If a frontend is connected, this function will show the uninstalling
 # part of the user interface.
 #
+# If <FILE> is a symlink that is not owned by a package, then the symlink
+# will be followed. This is so that libraries can be uninstalled (e.g., libfoo.so.0)
+#
 # Example:
 # removeOwningPackage "$PREFIX/bin/foobar"
 # removeOwningPackage "$PREFIX/lib/libwidgets.so.0"
@@ -110,14 +113,22 @@
     fi
 
     trace "called with $1"
-
+    
     if ! _fileToNativeName "$1"; then
-        warn _fileToNativeName failed
+        if [ -h "$1" ]; then
+            # if this is a symlink (e.g., libwidgets.so.0 created by ldconfig),
+            # follow it so people can use removeOwningPackage on libraries
+            removeOwningPackage "`readlink $1`"
+            return 0
+        else
+            warn _fileToNativeName failed
+            return 0
+        fi
         # if the file is not claimed by any pkg manager, then
         # _fileToNativeName will return 1. This is a problem
         # on systems where support for the package manager is
         # not yet implemented (e.g., pkgtool on slackware).
-        return 0
+        
     fi
     
     if [[ "$result_package_manager" == "rpm" ]]; then