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

svn at pcbsd.org svn at pcbsd.org
Mon Nov 14 12:53:41 PST 2011


Author: kris
Date: 2011-11-14 12:53:41 -0800 (Mon, 14 Nov 2011)
New Revision: 13902

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

Few fixes to pbi-manager:

* Don't save the resulting .pbp file, if it ends up being larger than the source PBI
* Allow us to include a /etc/pbi-make.conf file in builds, to set some universal options




Modified: pcbsd/current/src-sh/pbi-manager/pbi-manager
===================================================================
--- pcbsd/current/src-sh/pbi-manager/pbi-manager	2011-11-14 20:41:48 UTC (rev 13901)
+++ pcbsd/current/src-sh/pbi-manager/pbi-manager	2011-11-14 20:53:41 UTC (rev 13902)
@@ -1282,6 +1282,7 @@
 	PBI_MIMEADD="NO"
 	PBI_PATHADD="NO"
 	PBI_DESKDEL="NO"
+	PBI_MAKECONF="/etc/pbi-make.conf"
 	PBI_MENUDEL="NO"
 	PBI_MIMEDEL="NO"
 	PBI_PATHDEL="NO"
@@ -5650,8 +5651,6 @@
         cat ${_pbiPatchHeaderFile} $mark1 ${PBI_PATCH_ICON} $mark2 ${_pbiPatchArchiveFile} > ${outfile}
         sha256 -q ${outfile} > ${outfile}.sha256
 
-        echo "Created PBP: ${outfile}"
-
 	# Cleanup the archive stuff
         rm $mark1
         rm $mark2
@@ -5660,6 +5659,19 @@
 	
 	# Cleanup the directories
 	rm_pbipatchfiles
+
+	# Do some smell testing, make sure the patch file isn't larger than the PBI itself
+	# This happens with some java programs occasionally
+	if [ `du -k ${outfile} | awk '{print $1}'` -gt `du -k ${_pbiNew} | awk '{print $1}'` ]; then
+		rm ${outfile}
+		rm ${outfile}.sha256
+		exit_err "The patch is larger than the new PBI, aborting!"
+	else
+		# We have a patch!
+           	echo "Created PBP: ${outfile}"
+	fi
+
+
 }
 
 # Function which compares two directories, and returns a list of chmod commands to get them in line
@@ -6072,6 +6084,11 @@
 	# Copy resolv.conf
 	cp /etc/resolv.conf ${PBI_CHROOTDIR}/etc/resolv.conf
 
+	# If we have a custom PBI_MAKECONF include it
+	if [ -e "${PBI_MAKECONF}" ] ; then
+		cp ${PBI_MAKECONF} ${PBI_CHROOTDIR}/etc/make.conf
+	fi
+
 	#echo "Copying ${PORTSDIR} -> ${PBI_CHROOTDIR}/usr/ports"
 	#tar cvf - -C "${PORTSDIR}" --exclude ./distfiles . 2>/dev/null | tar xvf - -C "${PBI_CHROOTDIR}/usr/ports" 2>/dev/null
 	if [ ! -d "${PORTSDIR}/distfiles" ] ; then



More information about the Commits mailing list