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

svn at pcbsd.org svn at pcbsd.org
Fri Oct 7 05:30:32 PDT 2011


Author: kris
Date: 2011-10-07 05:30:32 -0700 (Fri, 07 Oct 2011)
New Revision: 13198

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

Add support to pbi-manager so if you are running PC-BSD it can fetch
fbsd-release.tbz as the PBI build chroot



Modified: pcbsd/current/src-sh/pbi-manager/pbi-manager
===================================================================
--- pcbsd/current/src-sh/pbi-manager/pbi-manager	2011-10-07 12:29:12 UTC (rev 13197)
+++ pcbsd/current/src-sh/pbi-manager/pbi-manager	2011-10-07 12:30:32 UTC (rev 13198)
@@ -6072,8 +6072,37 @@
 	mkdir -p ${PBI_CHROOTDIR}${PBI_CREATE_OUTDIR} >/dev/null 2>/dev/null
 }
 
-# No chroot environment tar file exists yet, lets build one
+# No chroot environment tar file exists yet, lets build or extract
 mk_chroot_file() {
+
+	# Check if on PC-BSD and we can instead fetch fbsd-release.tbz
+	if [ -e "$PCBSD_ETCCONF" ]; then
+
+	  cd "$PBI_APPDIR"
+
+	  # Set the mirror URL
+  	  MIRRORURL="`cat ${PCBSD_ETCCONF} | grep 'PCBSD_MIRROR: ' | sed 's|PCBSD_MIRROR:||g'`"
+
+  	  # Get the system version we are checking for updates to
+  	  SYSVER="`pbreg get /PC-BSD/Version`" ; export SYSVER
+
+  	  # Set the system arch type
+  	  ARCH=`uname -m`
+
+  	  # To fetch the jail environment
+ 	  echo "Fetching FreeBSD chroot environment... This may take a while..."
+  	  fetch -o rel.tbz ${MIRRORURL}/${SYSVER}/${ARCH}/netinstall/fbsd-release.tbz
+    	  fetch -o rel.md5 ${MIRRORURL}/${SYSVER}/${ARCH}/netinstall/fbsd-release.tbz.md5
+
+    	  if [ `md5 -q rel.tbz` != `cat rel.md5` ] ; then
+    	    exit_err "Error in download data, checksum mismatch.. Please try again later."
+	  fi
+
+	  mv rel.tbz ${PBI_CHROOTFILE}
+	  rm rel.md5
+	  return
+ 	fi
+
 	# Make sure SVN is installed
 	which svn >/dev/null 2>/dev/null
 	if [ "$?" != "0" ] ; then



More information about the Commits mailing list