id-pbuild.sh calls id-mk-deb-src.sh automatically
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 3 Aug 2011 13:21:30 +0000 (15:21 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 3 Aug 2011 13:21:30 +0000 (15:21 +0200)
id-deb-build/id-pbuild-root.sh
id-deb-build/id-pbuild.sh

index d37e205..3eeb85e 100755 (executable)
@@ -38,11 +38,14 @@ done
 PBUILDER=/usr/sbin/pbuilder
 
 rm -fr ${dist}-${arch}
-if test ! -f /var/cache/pbuilder/${dist}-${arch}-base.tgz; then
-    DIST=$dist ARCH=$arch $PBUILDER --create
+
+if test "$dsc"; then
+    if test ! -f /var/cache/pbuilder/${dist}-${arch}-base.tgz; then
+       DIST=$dist ARCH=$arch $PBUILDER --create
+    fi
+    DIST=$dist ARCH=$arch $PBUILDER --update --override-config
+    DIST=$dist ARCH=$arch $PBUILDER --build $dsc
 fi
-DIST=$dist ARCH=$arch $PBUILDER --update --override-config
-DIST=$dist ARCH=$arch $PBUILDER --build $dsc
 
 # Local Variables:
 # mode:shell-script
index b9cd94d..501eb6c 100755 (executable)
@@ -64,6 +64,18 @@ if test ! -x $PBUILDROOT; then
     exit 1
 fi
 
+MKDEBSRC=`dirname $0`/id-mk-deb-src.sh
+if test ! -x $MKDEBSRC; then
+    echo "$MKDEBSRC not found"
+    exit 1
+fi
+
+if test -d deb-src; then
+    cd deb-src
+else
+    $MKDEBSRC
+fi
+
 if test -d deb-src; then
     cd deb-src
 fi
@@ -113,9 +125,16 @@ if $upload; then
 fi
 rm -f *.log
 
+# call our privileged wrapper to clean the directories, no --dsc option
+for dist in ${DEBIAN_DIST} ${UBUNTU_DIST}; do
+    for arch in ${USE_ARCHS}; do
+       sudo -n $PBUILDROOT --dist=$dist --arch=$arch
+    done
+done
+
+# call our privileged wrapper to do the real work, with --dsc option
 i=0
 date
-
 for dist in ${DEBIAN_DIST} ${UBUNTU_DIST}; do
     for arch in ${USE_ARCHS}; do
        sudo -n $PBUILDROOT \