[PC-BSD Commits] r21887 - in pcbsd/current/src-sh/pbi-manager: . man8

svn at pcbsd.org svn at pcbsd.org
Sat Mar 16 20:43:51 PDT 2013


Author: kris
Date: 2013-03-17 03:43:51 +0000 (Sun, 17 Mar 2013)
New Revision: 21887

Modified:
   pcbsd/current/src-sh/pbi-manager/man8/pbi_autobuild.8
   pcbsd/current/src-sh/pbi-manager/pbi-manager
Log:

Add a new -32fallback flag to pbi_autobuild

This works different from -32, which does all i386 PBIs.

This flag will only build the 32bit PBI, if a port cannot be built
on amd64, but the i386 version does build. I.E. wine, and various emulators



Modified: pcbsd/current/src-sh/pbi-manager/man8/pbi_autobuild.8
===================================================================
--- pcbsd/current/src-sh/pbi-manager/man8/pbi_autobuild.8	2013-03-17 02:30:43 UTC (rev 21886)
+++ pcbsd/current/src-sh/pbi-manager/man8/pbi_autobuild.8	2013-03-17 03:43:51 UTC (rev 21887)
@@ -12,6 +12,7 @@
 .Op Fl o Ar outdir
 .Op Fl p Ar <num>
 .Op Fl 32
+.Op Fl 32fallback
 .Op Fl -genpatch
 .Op Fl -keep Ar num
 .Op Fl -pkgcache
@@ -47,7 +48,10 @@
 have CPUs and disk IO to spare, increasing will greatly reduce time to do an i
 autobuild run.
 .It Fl 32
-Use to specify to build i386 PBIs on an amd64 host system
+Use to specify to build only i386 PBIs on an amd64 host system
+.It Fl 32fallback
+Use to specify to build i386 PBIs on an amd64 host system only if amd64 version can 
+not be built from the port
 .It Fl -genpatch
 When building a new PBI, check for archived copies, and generate smaller patch
 updates to the new version. (*.pbp files)

Modified: pcbsd/current/src-sh/pbi-manager/pbi-manager
===================================================================
--- pcbsd/current/src-sh/pbi-manager/pbi-manager	2013-03-17 02:30:43 UTC (rev 21886)
+++ pcbsd/current/src-sh/pbi-manager/pbi-manager	2013-03-17 03:43:51 UTC (rev 21887)
@@ -62,6 +62,7 @@
   -o outdir    -- Where to place the finished PBI file(s) <required>
   -p <num>     -- Number of PBI builds to run concurrently (Defaults to 1)
   -32          -- Build i386 PBIs on amd64 host
+  -32fallback  -- On amd64 host, build 32bit PBIs if only i386 can be built
   --genpatch   -- Generate patch files (*.pbp) from archived PBIs to current
   --keep <num> -- Keep <num> old versions in archive folder for each built PBI
   --prune      -- Remove files from 'outdir' that no longer have a module
@@ -1005,6 +1006,11 @@
 			PBI_AB32="YES"
 			ARCH=i386
                         ;;
+        -32fallback)    if [ "$REALARCH" != "amd64" ] ; then 
+				exit_err "-32fallback can only be used on amd64 host"
+			fi	
+			PBI_ABFB32="YES"
+                        ;;
 
         --genpatch)     PBI_AB_GENPATCH="YES" 
                         ;;
@@ -5575,14 +5581,15 @@
 check_port_compat_arch()
 {
 	local sPort=$1
+        have32="false";
  	local cValues="`make -C $sPort -V ONLY_FOR_ARCHS PORTSDIR=${PORTSDIR}`"
 	if [ -z "$cValues" ] ; then return 0 ; fi
 
 	for cArch in $cValues
 	do
 		if [ "$cArch" = "$ARCH" ] ; then return 0; fi
+                if [ "$cArch" = "i386" ] ; then have32="true" ; fi
 	done
-	
 	return 1
 }
 
@@ -5739,8 +5746,14 @@
 	# Check if this port can be built on this architecture
 	check_port_compat_arch "${PORTSDIR}/${PBI_MAKEPORT}"
 	if [ "$?" = "1" ] ; then
-		#echo "${PBI_MAKEPORT} - Skipping for invalid system arch"
+           if [ "$PBI_ABFB32" != "YES" ] ; then
+		echo "${PBI_MAKEPORT} - Skipping for invalid system arch"
 		continue
+           fi
+           if [ "$have32" != "true" ] ; then
+		echo "${PBI_MAKEPORT} - Skipping for invalid system arch"
+		continue
+           fi
 	fi
 	
 	# Check for missing port target
@@ -5805,8 +5818,10 @@
   done
 
   # Sort the list
-  sort -n -r ${PBI_TMPDIR}/.abtmp > ${PBI_TMPDIR}/.ablist
-  rm ${PBI_TMPDIR}/.abtmp
+  if [ -e "${PBI_TMPDIR}/.abtmp" ] ; then
+    sort -n -r ${PBI_TMPDIR}/.abtmp > ${PBI_TMPDIR}/.ablist
+    rm ${PBI_TMPDIR}/.abtmp
+  fi
 }
 
 start_next_ab_target()
@@ -5906,6 +5921,14 @@
 	# Are we doing 32bit builds?
  	if [ "$PBI_AB32" = "YES" ] ; then _flags="${_flags} -32"; fi
 
+        # Check if this port can be built on this architecture
+        check_port_compat_arch "${PORTSDIR}/${_mp}"
+        if [ $? -ne 0 ] ; then
+           if [ "$PBI_ABFB32" = "YES" -a "$have32" = "true" ] ; then
+ 	      _flags="${_flags} -32"
+           fi
+        fi
+
 	get_pbi_progversion
 
 	#echo "Starting build of ${_mp} - ${_pv}"
@@ -6822,6 +6845,12 @@
 	# Now copy over the pbi_* scripts
 	mkdir ${PBI_CHROOTDIR}/usr/local/sbin 2>/dev/null
 	cp ${PROGBASE}/sbin/pbi_* ${PBI_CHROOTDIR}/usr/local/sbin
+
+	# Copy the functions.sh
+	mkdir -p ${PBI_CHROOTDIR}/usr/local/share/pcbsd/scripts/
+	cp ${PROGBASE}/share/pcbsd/scripts/functions.sh ${PBI_CHROOTDIR}/usr/local/share/pcbsd/scripts/
+
+	# Copy over the pbi_makeport app
 	cp ${PBI_CHROOTDIR}/usr/local/sbin/pbi_makeport ${PBI_CHROOTDIR}/usr/local/sbin/pbi_makeport_chroot
 	chmod 755 ${PBI_CHROOTDIR}/usr/local/sbin/pbi_*
 



More information about the Commits mailing list