[PC-BSD Commits] r7089 - pcbsd-projects/pbi-manager

svn at pcbsd.org svn at pcbsd.org
Thu Jul 1 07:25:43 PDT 2010


Author: kris
Date: 2010-07-01 07:25:43 -0700 (Thu, 01 Jul 2010)
New Revision: 7089

Modified:
   pcbsd-projects/pbi-manager/pbi-manager
Log:

Update to pbi-manager, switch up how we do pbi wrapper scripts. Now the script sits where the orignal
binary does, and the real binary gets moved to (dirname).rbin/. This will allow us to use a ports included
desktop files, dbus services and other files without having to modify each one to point to the wrapper script
at install time. 



Modified: pcbsd-projects/pbi-manager/pbi-manager
===================================================================
--- pcbsd-projects/pbi-manager/pbi-manager	2010-07-01 13:26:13 UTC (rev 7088)
+++ pcbsd-projects/pbi-manager/pbi-manager	2010-07-01 14:25:43 UTC (rev 7089)
@@ -1439,20 +1439,29 @@
         if [ ! -d "${dir}" ] ; then mkdir -p "${dir}" ; fi
 
 	bin="${1}"
-	fbin="`basename ${bin}`"
+	binname="`basename ${bin}`"
 	tar="${2}"
 	ch="${3}"
+
+	# Set the real binary dir for the original binaries
+	rbindir="`dirname $bin`.rbin"
+	if [ ! -d "${PBI_STAGEDIR}/${rbindir}" ] ; then mkdir -p "${PBI_STAGEDIR}/${rbindir}" ; fi
+
+	# Move the orignal binary to the rbindir
+	mv "${PBI_STAGEDIR}/${bin}" "${PBI_STAGEDIR}/${rbindir}/"
 	
-	MOD_FILES_PREFIX="${PBI_FAKEBIN_DIR}/${fbin} ${MOD_FILES_PREFIX}"
-	MOD_WRAPPERS="${PBI_FAKEBIN_DIR}/${fbin} ${MOD_WRAPPERS}"
+	# Save the wrapper location so we know what files to modify at install time
+	MOD_FILES_PREFIX="${bin} ${MOD_FILES_PREFIX}"
+	MOD_WRAPPERS="${bin} ${MOD_WRAPPERS}"
 
 	# Make our link scripts
-	echo "ln -fs \$PBI_PROGDIRPATH/${PBI_FAKEBIN_DIR}/${fbin} \$SYS_LOCALBASE/${tar}" \
+	echo "ln -fs \$PBI_PROGDIRPATH/${bin} \$SYS_LOCALBASE/${tar}" \
 		>> "${dir}/${PBI_INS_PATHSCRIPT}"
 
-	echo "#!/bin/sh" > ${dir}/${fbin}
-	echo "PROGDIR=\"%%PBI_APPDIR%%\" ; export PROGDIR" >>${dir}/${fbin}
-	echo "PROGBIN=\"${bin}\" ; export PROGBIN" >>${dir}/${fbin}
+	# Start making the wrapper script
+	echo "#!/bin/sh" > ${PBI_STAGEDIR}/${bin}
+	echo "PROGDIR=\"%%PBI_APPDIR%%\" ; export PROGDIR" >>${PBI_STAGEDIR}/${bin}
+	echo "PROGBIN=\"${rbindir}/${binname}\" ; export PROGBIN" >>${PBI_STAGEDIR}/${bin}
 
 	# Start the main code block
 	echo 'PATH="${PROGDIR}/bin:${PROGDIR}/sbin:${PROGDIR}/libexec:$PATH"; export PATH
@@ -1475,11 +1484,13 @@
 fi
 
 # Check for KDE4 services / libs to parse
-KDEDIRS="${KDEDIRS}:${PROGDIR}/kde4"
-export KDEDIRS
-which kbuildsycoca4 >/dev/null 2>/dev/null
-if [ "$?" = "0" ] ; then
-	kbuildsycoca4
+if [ -d "${PROGDIR}/kde4" ] ; then
+	KDEDIRS="${KDEDIRS}:${PROGDIR}/kde4"
+	export KDEDIRS
+	which kbuildsycoca4 >/dev/null 2>/dev/null
+	if [ "$?" = "0" ] ; then
+		kbuildsycoca4
+	fi
 fi
 
 #Setup our LD_LIBRARY_PATH variable with all found lib dirs
@@ -1487,7 +1498,7 @@
 LD_32_LIBRARY_PATH="${LDCONFIGDIRS}:${PROGDIR}/lib/:${PROGDIR}/kde4/lib:${PROGDIR}/lib/qt4"
 export LD_LIBRARY_PATH LD_32_LIBRARY_PATH
 
-'>>${dir}/${fbin}
+'>>${PBI_STAGEDIR}/${bin}
 
 	# See if we need the crash-handler
 	if [ "$ch" = "YES" ] ; then
@@ -1498,10 +1509,10 @@
 | tee $STDLOG) 3>&1 1>&2 2>&3 | tee $STELOG) 3>&1 1>&2 2>&3)
 
 rm $STDLOG >/dev/null 2>/dev/null
-rm $STELOG >/dev/null 2>/dev/null' >>${dir}/${fbin}
+rm $STELOG >/dev/null 2>/dev/null' >>${PBI_STAGEDIR}/${bin}
 
 	else
-		echo '${PROGDIR}/${PROGBIN}  "$@"' >>${dir}/${fbin}
+		echo '${PROGDIR}/${PROGBIN}  "$@"' >>${PBI_STAGEDIR}/${bin}
 	fi		
 }
 



More information about the Commits mailing list