[PC-BSD Commits] r7551 - pcbsd/current/src-qt4/pbi-manager

svn at pcbsd.org svn at pcbsd.org
Mon Sep 13 15:20:03 PDT 2010


Author: kris
Date: 2010-09-13 15:20:03 -0700 (Mon, 13 Sep 2010)
New Revision: 7551

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

Fix to pbi-manager, now that we are not installing to alt prefixes, make sure to massage the .desktop / .xml files at build time



Modified: pcbsd/current/src-qt4/pbi-manager/pbi-manager
===================================================================
--- pcbsd/current/src-qt4/pbi-manager/pbi-manager	2010-09-13 22:05:43 UTC (rev 7550)
+++ pcbsd/current/src-qt4/pbi-manager/pbi-manager	2010-09-13 22:20:03 UTC (rev 7551)
@@ -1482,7 +1482,6 @@
 	onlywrap="${4}"
 
 	# Save the wrapper location so we know what files to modify at install time
-	MOD_FILES_PREFIX="${PBI_FAKEBIN_DIR}/${fbin} ${MOD_FILES_PREFIX}"
 	MOD_WRAPPERS="${PBI_FAKEBIN_DIR}/${fbin} ${MOD_WRAPPERS}"
 
 	# Make our link to the system localbase if its not a wrapper only
@@ -1493,7 +1492,7 @@
 
 	# Start making the wrapper script
 	echo "#!/bin/sh" > ${dir}/${fbin}
-	echo "PROGDIR=\"%%PBI_APPDIR%%\" ; export PROGDIR" >>${dir}/${fbin}
+	echo "PROGDIR=\"${PBI_PROGDIRPATH}\" ; export PROGDIR" >>${dir}/${fbin}
 	echo "PROGBIN=\"${bin}\" ; export PROGBIN" >>${dir}/${fbin}
 
 	# Start the main code block
@@ -1569,8 +1568,11 @@
   	for i in `ls *.desktop 2>/dev/null`
   	do
 		# Copy over the .desktop file, modifying any variables within
-		MOD_FILES_PREFIX="${PBI_APPDESK_DIR}/PBI-${i} ${MOD_FILES_PREFIX}"
-		cp "${i}" "${dir}/PBI-${i}"
+	        cat "${i}" \
+           	| sed "s|%%PBI_EXEDIR%%|$PBI_PROGDIRPATH/$PBI_FAKEBIN_DIR|g" \
+		| sed "s|%%PBI_APPDIR%%|$PBI_PROGDIRPATH|g" \
+		> "${dir}/PBI-${i}"
+		#cp "${i}" "${dir}/PBI-${i}"
 
 		ifi="\$PBI_PROGDIRPATH/${PBI_APPDESK_DIR}/PBI-${i}"
 
@@ -1597,8 +1599,11 @@
   	cd "${PBI_CONFDIR}/${MOD_XDGMENU_DIR}"
   	for i in `ls *.desktop 2>/dev/null`
   	do
-		MOD_FILES_PREFIX="${PBI_APPMENU_DIR}/PBI-${i} ${MOD_FILES_PREFIX}"
-		cp "${i}" "${dir}/PBI-${i}"
+		# Copy the desktop file, changing any included vars
+	        cat "${i}" \
+           	| sed "s|%%PBI_EXEDIR%%|$PBI_PROGDIRPATH/$PBI_FAKEBIN_DIR|g" \
+		| sed "s|%%PBI_APPDIR%%|$PBI_PROGDIRPATH|g" \
+		> "${dir}/PBI-${i}"
 
 		ifi="\$PBI_PROGDIRPATH/${PBI_APPMENU_DIR}/PBI-${i}"
 
@@ -1606,8 +1611,11 @@
 		ifd=""
 		dirfile="`basename -s .desktop ${i}`"
 		if [ -e "${dirfile}.directory" ] ; then
-			MOD_FILES_PREFIX="${PBI_APPMENU_DIR}/PBI-${dirfile}.directory ${MOD_FILES_PREFIX}"
-			cp "${dirfile}.directory" "${dir}/PBI-${dirfile}.directory"
+	        	cat "${dirfile}.directory" \
+           		| sed "s|%%PBI_EXEDIR%%|$PBI_PROGDIRPATH/$PBI_FAKEBIN_DIR|g" \
+			| sed "s|%%PBI_APPDIR%%|$PBI_PROGDIRPATH|g" \
+			> "${dir}/PBI-${dirfile}.directory"
+			#cp "${dirfile}.directory" "${dir}/PBI-${dirfile}.directory"
 			ifd="\$PBI_PROGDIRPATH/${PBI_APPMENU_DIR}/PBI-${dirfile}.directory "	
 		fi
 
@@ -1679,16 +1687,6 @@
 		echo 'fi' >> "$insc"
 	fi
 
-	# Modify files on installation with correct dirs
-	echo "MOD_FILES_PREFIX=\"$MOD_FILES_PREFIX\"" >> "$insc"
-	echo 'cd $PBI_PROGDIRPATH' >> "$insc"
-	echo "for i in \$MOD_FILES_PREFIX" >> "$insc"
-	echo "do" >> "$insc"
-	echo "  sed -i.bak \"s|%%PBI_EXEDIR%%|\$PBI_PROGDIRPATH/\$PBI_FAKEBIN_DIR|g\" \$i" >> "$insc"
-	echo "  sed -i.bak \"s|%%PBI_APPDIR%%|\$PBI_PROGDIRPATH|g\" \$i" >> "$insc"
-	echo "  rm \$i.bak" >> "$insc"
-	echo "done" >> "$insc"
-
  	# Set permissions to executable on wrappers	
 	echo "MOD_WRAPPERS=\"$MOD_WRAPPERS\"" >> "$insc"
 	echo 'cd $PBI_PROGDIRPATH' >> "$insc"



More information about the Commits mailing list