[Pkg-xfce-commits] r2786 - scripts/pbuilder

corsac at alioth.debian.org corsac at alioth.debian.org
Fri Feb 27 01:22:29 UTC 2009


Author: corsac
Date: 2009-02-27 01:22:29 +0000 (Fri, 27 Feb 2009)
New Revision: 2786

Modified:
   scripts/pbuilder/pdebuild-sources.sh
Log:
- enable building multiple packages
- detect already built package with .changes


Modified: scripts/pbuilder/pdebuild-sources.sh
===================================================================
--- scripts/pbuilder/pdebuild-sources.sh	2009-02-27 01:18:18 UTC (rev 2785)
+++ scripts/pbuilder/pdebuild-sources.sh	2009-02-27 01:22:29 UTC (rev 2786)
@@ -25,7 +25,8 @@
 SCRIPTSDIR=$BASEDIR/scripts
 
 BUILDING=$1
-PACKAGE=$2
+shift
+PACKAGES=$*
 
 case $BUILDING in
 	"desktop")
@@ -56,11 +57,10 @@
         [ "$DEBUG" ] || sudo $PBUILDER create --debug \
                 --configfile $CONFFILE > $PBUILDERDIR/log/pbuilder-create.log \
                      2> $PBUILDERDIR/log/pbuilder-create-errors.log
-
         exit 0
         ;;
 	"update")
-		echo "Updating base.tgz"
+		echo "Updating base-$arch.tgz"
 		[ "$DEBUG" ] || sudo $PBUILDER update --debug \
 			--configfile $CONFFILE > $PBUILDERDIR/log/pbuilder-update.log \
 		        	2> $PBUILDERDIR/log/pbuilder-update-errors.log
@@ -80,22 +80,23 @@
 build() {
 	pkg="$1"
 
-	if [ -f $SCRIPTSDIR/pbuilder/xfce/build/$pkg ]; then
-		echo "$pkg already built, skipping"
+	echo "Building $pkg..."
+	if [ -d "$BUILDDIR/$pkg" ];
+	then
+		cd $BUILDDIR/$pkg
+		version=$(dpkg-parsechangelog --count 1 | grep Version | awk '{ print $2 }')
+		if [ -f $SCRIPTSDIR/pbuilder/xfce/build/${pkg}_${version}_${arch}.changes ]; 
+		then
+			echo "$pkg already built, skipping"
+		else
+			[ "$DEBUG" ] || svn-buildpackage --svn-ignore-new \
+				--svn-builder $SCRIPTSDIR/pbuilder/pdebuild.wrapper &&
+			echo "done"
+		fi
 	else
-	
-		echo "Building $pkg..."
-		if [ -d "$BUILDDIR/$pkg" ];then
-    			cd $BUILDDIR/$pkg
-	    		[ "$DEBUG" ] || svn-buildpackage --svn-ignore-new \
-            		--svn-builder $SCRIPTSDIR/pbuilder/pdebuild.wrapper &&
-			touch $SCRIPTSDIR/pbuilder/xfce/build/$pkg
-	    		echo "done"
-		else
-			echo "'$BUILDDIR/$pkg' is not a directory" > /dev/stderr
-			echo "failed"
-    		fi
-	fi
+		echo "'$BUILDDIR/$pkg' is not a directory" > /dev/stderr
+		echo "failed"
+  fi
 }
 
 echo ""
@@ -103,7 +104,7 @@
 echo ""
 
 # Rough check for needed executables
-NEEDEDBINS='/usr/sbin/pbuilder /usr/sbin/debootstrap
+NEEDEDBINS='/usr/sbin/pbuilder /usr/bin/cdebootstrap
             /usr/bin/fakeroot /usr/bin/svn-buildpackage'
 for bin in $NEEDEDBINS; do
     if [ ! -x $bin ]; then
@@ -120,13 +121,16 @@
     exit
 fi
 
-if [ -z "$PACKAGE" ]; then
+if [ -z "$PACKAGES" ]; then
 	# Build every package listed in $PKGFILE (avoiding comments)
 	for pkg in $(grep -v "^#" $PKGFILE | cut -f 1 -d " "); do
 		build $pkg
 	done
 else
 	# Build the package specified on the command line
-	build "$PACKAGE"
+	for pkg in $PACKAGES
+	do	
+		build $pkg
+	done
 fi
 




More information about the Pkg-xfce-commits mailing list