[Pkg-xfce-commits] r555 - scripts/pbuilder
Emanuele Rocca
ema at costa.debian.org
Mon Apr 24 08:22:06 UTC 2006
Author: ema
Date: 2006-04-24 08:22:06 +0000 (Mon, 24 Apr 2006)
New Revision: 555
Modified:
scripts/pbuilder/README
scripts/pbuilder/pdebuild-sources.sh
scripts/pbuilder/pdebuild.wrapper
Log:
pbuilder script changes:
- Choose whether to build goodies or desktop stuff
- Debug variable added
- A bit more of error handling
Thanks to Carles Mu?\195?\177oz Gorriz
Modified: scripts/pbuilder/README
===================================================================
--- scripts/pbuilder/README 2006-04-23 16:38:13 UTC (rev 554)
+++ scripts/pbuilder/README 2006-04-24 08:22:06 UTC (rev 555)
@@ -1,6 +1,6 @@
0) Install pbuilder, debootstrap, fakeroot, svn-buildpackage
-1) Set the correct paths in pdebuild.conf, pdebuild.wrapper and pdebuild-sources.sh
+1) Set the correct $BASEDIR in pdebuild.conf
2) Run ./pdebuild-sources.sh
Modified: scripts/pbuilder/pdebuild-sources.sh
===================================================================
--- scripts/pbuilder/pdebuild-sources.sh 2006-04-23 16:38:13 UTC (rev 554)
+++ scripts/pbuilder/pdebuild-sources.sh 2006-04-24 08:22:06 UTC (rev 555)
@@ -4,15 +4,47 @@
#
# vim:textwidth=0
-BASEDIR=$HOME/debian/pkg-xfce
-CONFFILE=$BASEDIR/scripts/pbuilder/pdebuild.conf
+# Uncomment this variable to debug
+#DEBUG=true
+CONFFILE=./pdebuild.conf
. $CONFFILE
+if [ ! -d "$BASEDIR/desktop" ] || [ ! -d "$BASEDIR/goodies" ];then
+ (
+ echo "ERROR: \$BASEDIR is not set correctly"
+ echo "Please edit your $CONFFILE and fix this problem"
+ ) > /dev/stderr
+ exit 1
+fi
+
+export PKGXFCEBASEDIR=$BASEDIR
+
DESKTOPDIR=$BASEDIR/desktop/trunk
+GOODIESDIR=$BASEDIR/goodies
SCRIPTSDIR=$BASEDIR/scripts
-PKGFILE=$SCRIPTSDIR/desktop-build.txt
+BUILDING=$1
+
+case $BUILDING in
+ "desktop")
+ BUILDDIR=$DESKTOPDIR
+ PKGFILE=$SCRIPTSDIR/desktop-build.txt
+ ;;
+ "goodies")
+ BUILDDIR=$GOODIESDIR
+ PKGFILE=$SCRIPTSDIR/goodies-build.txt
+ ;;
+ *)
+ echo "Usage: $0 [desktop|goodies]"
+ exit 1
+ ;;
+esac
+
+echo ""
+echo "Building $BUILDING : $BUILDDIR"
+echo ""
+
# Rough check for needed executables
NEEDEDBINS='/usr/sbin/pbuilder /usr/sbin/debootstrap
/usr/bin/fakeroot /usr/bin/svn-buildpackage'
@@ -28,20 +60,26 @@
if [ ! -f "$BASETGZ" ]; then
echo "Creating base.tgz"
- sudo $PBUILDER create --debug \
+ [ "$DEBUG" ] || sudo $PBUILDER create --debug \
--configfile $CONFFILE > $PBUILDERDIR/log/pbuilder-create.log \
2> $PBUILDERDIR/log/pbuilder-create-errors.log
else
echo "Updating base.tgz"
- sudo $PBUILDER update --debug \
- --configfile $CONFFILE > $PBUILDERDIR/log/pbuilder-update.log \
+ [ "$DEBUG" ] || sudo $PBUILDER update --debug \
+ --configfile $CONFFILE > $PBUILDERDIR/log/pbuilder-update.log \
2> $PBUILDERDIR/log/pbuilder-update-errors.log
fi
# Build every package listed in $PKGFILE (avoiding comments)
for pkg in $(grep -v "^#" $PKGFILE); do
echo "Building $pkg..."
- cd $DESKTOPDIR/$pkg
- svn-buildpackage --svn-ignore-new --svn-builder $SCRIPTSDIR/pbuilder/pdebuild.wrapper
- echo "done"
+ if [ -d "$BUILDDIR/$pkg" ];then
+ cd $BUILDDIR/$pkg
+ [ "$DEBUG" ] || svn-buildpackage --svn-ignore-new \
+ --svn-builder $SCRIPTSDIR/pbuilder/pdebuild.wrapper
+ echo "done"
+ else
+ echo "'$BUILDDIR/$pkg' is not a directory" > /dev/stderr
+ echo "failed"
+ fi
done
Modified: scripts/pbuilder/pdebuild.wrapper
===================================================================
--- scripts/pbuilder/pdebuild.wrapper 2006-04-23 16:38:13 UTC (rev 554)
+++ scripts/pbuilder/pdebuild.wrapper 2006-04-24 08:22:06 UTC (rev 555)
@@ -1,6 +1,6 @@
#!/bin/sh
-D=$HOME/debian/pkg-xfce/scripts/pbuilder
+D=$PKGXFCEBASEDIR/scripts/pbuilder
pdebuild --configfile $D/pdebuild.conf \
--logfile $D/xfce/log/`basename $(pwd)`-buildd.log \
More information about the Pkg-xfce-commits
mailing list