[PC-BSD Commits] r16250 - pcbsd/current/src-sh/pbi-manager

svn at pcbsd.org svn at pcbsd.org
Thu Apr 5 08:34:09 PDT 2012


Author: kris
Date: 2012-04-05 15:34:09 +0000 (Thu, 05 Apr 2012)
New Revision: 16250

Modified:
   pcbsd/current/src-sh/pbi-manager/pbi-manager
Log:

Make sure we cleanup path links in ~bin/ when uninstalling as a user



Modified: pcbsd/current/src-sh/pbi-manager/pbi-manager
===================================================================
--- pcbsd/current/src-sh/pbi-manager/pbi-manager	2012-04-05 13:56:50 UTC (rev 16249)
+++ pcbsd/current/src-sh/pbi-manager/pbi-manager	2012-04-05 15:34:09 UTC (rev 16250)
@@ -4129,7 +4129,16 @@
 run_remove_script() {
 	uisc="${PBI_PROGDIRPATH}/${PBI_FAKEBIN_DIR}/.pbi-uninstall.sh"
 	if [ ! -e "$uisc" ] ; then return 0 ; fi
-	
+
+	# If not running as root, be sure to cleanup path links
+	if [ "`id -u`" != "0" ]; then
+	 	cat ${PBI_PROGDIRPATH}/${PBI_FAKEBIN_DIR}/${PBI_UNINS_PATHSCRIPT} | grep 'rm "$SYS_LOCALBASE/bin' | sed 's|$SYS_LOCALBASE|${HOME}|g' >${PBI_TMPDIR}/.binlnks
+         	while read lnk
+          	do
+               	 	/bin/sh -c "${lnk}"
+          	done <${PBI_TMPDIR}/.binlnks
+          	rm ${PBI_TMPDIR}/.binlnks
+        fi
         export_script_vars
 	if [ "$PBI_VERBOSE" = "YES" ] ; then
        		sh "${uisc}"



More information about the Commits mailing list