[PC-BSD Commits] r4194 - pbibuild/pbibuilder/scripts

svn at pcbsd.org svn at pcbsd.org
Tue Jul 7 11:21:00 PDT 2009


Author: kris
Date: 2009-07-07 11:20:59 -0700 (Tue, 07 Jul 2009)
New Revision: 4194

Modified:
   pbibuild/pbibuilder/scripts/2.makeport.sh
   pbibuild/pbibuilder/scripts/3.1.makeinmate.sh
   pbibuild/pbibuilder/scripts/3.makepbi.sh
Log:

Update to the pbi-builder software. This update fixes a large issue when running
cron builds. Previously we calculated the md5 of each port Makefile to determine when
its time to do an update. However, when a port was updated, often for cosmetic reasons,
it would trigger a rebuild of the PBI, even though nothing was changed. This wasted a lot of time on builds (openoffice) when it wasn't necessary.

Now, fixed how we check for updates, we save the port version / port revision number, and only
trigger a new build whenever that changes. This will save lots of cycles, expecially with
the number of modules growing. 



Modified: pbibuild/pbibuilder/scripts/2.makeport.sh
===================================================================
--- pbibuild/pbibuilder/scripts/2.makeport.sh	2009-07-07 14:06:14 UTC (rev 4193)
+++ pbibuild/pbibuilder/scripts/2.makeport.sh	2009-07-07 18:20:59 UTC (rev 4194)
@@ -55,12 +55,14 @@
 if [ -e "${module}/pbi.conf" ]
 then
 
-ARCHIGNORE="" ; export ARCHIGNORE
-PORTBROKE="" ; export PORTBROKE
+  ARCHIGNORE="" ; export ARCHIGNORE
+  PORTBROKE="" ; export PORTBROKE
+  PBIVERSION="" ; export PBIVERSION
 
-. ${module}/pbi.conf
+  # Source the module
+  . ${module}/pbi.conf
 
-OUTDIR="${PROGDIR}/outgoing/${module}" ; export OUTDIR
+  OUTDIR="${PROGDIR}/outgoing/${module}" ; export OUTDIR
 
   # Check that the output directory for this module exists
   if [ ! -e "${OUTDIR}" ]
@@ -70,10 +72,32 @@
 
   touch ${OUTDIR}/.built
   touch ${OUTDIR}/.oldbk
-  VER="`md5 ${PROGDIR}/buildworld/${PBIPORT}/Makefile | cut -d \" \" -f 4`"
+
+  # Get the port version number
+  PORTVER="`chroot ${PROGDIR}/buildworld /usr/bin/make -C ${PBIPORT} -V DISTVERSION 2>/dev/null`"
+
+  # Check if we have a portrevision to use in version number
+  PORTREV=""
+  PORTREV="`chroot ${PROGDIR}/buildworld /usr/bin/make -C ${PBIPORT} -V PORTREVISION 2>/dev/null`"
+  if [ ! -z "${PORTREV}" -a "${PORTREV}" != "0" ]
+  then
+   PORTVER="${PORTVER}_${PORTREV}" ; export PORTVER
+  fi
+  if [ ! -z "${PBIVERSION}" ]
+  then
+     PORTVER="${PBIVERSION}"
+  fi
+  VER="${PORTVER}"
+
   OVER="`cat ${OUTDIR}/.built`"
   OLDBUILDKEY="`cat ${OUTDIR}/.oldbk`"
 
+  if [ "${VER}" != "${OVER}" ]
+  then
+    echo "Old Version: ${OVER}"
+    echo "New Version: ${VER}"
+  fi
+
   if [ "${VER}" != "${OVER}" -o "${BUILDKEY}" != "${OLDBUILDKEY}" -o "${REBUILDALL}" = "1" ]
   then
      echo "Module ${module} needs a rebuild"

Modified: pbibuild/pbibuilder/scripts/3.1.makeinmate.sh
===================================================================
--- pbibuild/pbibuilder/scripts/3.1.makeinmate.sh	2009-07-07 14:06:14 UTC (rev 4193)
+++ pbibuild/pbibuilder/scripts/3.1.makeinmate.sh	2009-07-07 18:20:59 UTC (rev 4194)
@@ -195,9 +195,7 @@
   mv ${PDESTDIR}/root/*.wit ${OUTDIR}/ 2>>${BLOG}
 
   # The build is finished, go ahead and make the .built and .oldbk files 
-  echo "`md5 ${PDESTDIR}/${PBIPORT}/Makefile | cut -d \" \" -f 4`" >${OUTDIR}/.built
-  echo "Getting md5 for ${PDESTDIR}/${PBIPORT}/Makefile"
-  echo "`md5 ${PDESTDIR}/${PBIPORT}/Makefile | cut -d \" \" -f 4`"
+  echo "${PORTVER}" >${OUTDIR}/.built
   echo "${BUILDKEY}" >${OUTDIR}/.oldbk
 
   if [ -e "${PROGDIR}/scripts/4.mailresults.sh" ]

Modified: pbibuild/pbibuilder/scripts/3.makepbi.sh
===================================================================
--- pbibuild/pbibuilder/scripts/3.makepbi.sh	2009-07-07 14:06:14 UTC (rev 4193)
+++ pbibuild/pbibuilder/scripts/3.makepbi.sh	2009-07-07 18:20:59 UTC (rev 4194)
@@ -315,9 +315,7 @@
   cp ${PDESTDIR}/${PBIDIR}/.mdate ${OUTDIR}/mdate 2>>${BLOG}
 
   # The build is finished, go ahead and make the .built and .oldbk files 
-  echo "`md5 ${PDESTDIR}/${PBIPORT}/Makefile | cut -d \" \" -f 4`" >${OUTDIR}/.built
-  echo "Getting md5 for ${PDESTDIR}/${PBIPORT}/Makefile"
-  echo "`md5 ${PDESTDIR}/${PBIPORT}/Makefile | cut -d \" \" -f 4`"
+  echo "${PORTVER}" >${OUTDIR}/.built
   echo "${BUILDKEY}" >${OUTDIR}/.oldbk
 
   if [ -e "${PROGDIR}/scripts/4.mailresults.sh" ]



More information about the Commits mailing list