--- /dev/null
+#!/bin/sh
+
+usage()
+{
+ cat <<EOF
+Usage: id-pbuild1.sh [OPTIONS]
+Options:
+ [--dsc=dscfile]
+ [--dist=distribution]
+ [--arch=architecture]
+EOF
+ exit $1
+}
+
+while test $# -gt 0; do
+ case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ case $1 in
+ --dist=*)
+ dist=$optarg
+ ;;
+ --arch=*)
+ arch=$optarg
+ ;;
+ --dsc=*)
+ dsc=$optarg
+ ;;
+ -*)
+ do_help=yes
+ ;;
+ esac
+ shift
+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
+fi
+DIST=$dist ARCH=$arch $PBUILDER --update --override-config
+DIST=$dist ARCH=$arch $PBUILDER --build $dsc
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation: 2
+# sh-basic-offset: 4
+# End:
usage()
{
cat <<EOF
-Usage: id-pbuild-all.sh [OPTIONS]
+Usage: id-pbuild.sh [OPTIONS]
Options:
[--debian=distros]
[--ubuntu=distros]
--product=*)
PRODUCT=$optarg
;;
- --remote=*)
- REMOTE=$optarg
- ;;
-*)
do_help=yes
;;
usage 1 1>&2
fi
-if test "$REMOTE"; then
- if test ! -d deb-src; then
- echo "deb-src not in current directory"
- exit 1
- fi
- cd deb-src
- PRODUCT=`echo *.dsc|sed 's/_.*//g'`
- cd ..
- ssh $REMOTE "mkdir -p $PRODUCT/deb-src"
- scp IDMETA $REMOTE:$PRODUCT
- scp deb-src/*.gz deb-src/*.dsc $REMOTE:$PRODUCT/deb-src
- if $upload; then
- ssh $REMOTE "cd $PRODUCT; \$HOME/proj/git-tools/id-deb-build/id-pbuild.sh --upload"
- else
- ssh $REMOTE "cd $PRODUCT; sudo \$HOME/proj/git-tools/id-deb-build/id-pbuild.sh"
- fi
- exit 0
+PBUILDROOT=`dirname $0`/id-pbuild-root.sh
+if test ! -x $PBUILDROOT; then
+ echo "$PBUILDROOT not found"
+ exit 1
fi
+
if test -d deb-src; then
cd deb-src
fi
+
for f in *.dsc; do
if test -f "$f"; then
PKG=$f
echo "${PKG} does not exist"
exit 1
fi
-PBUILDER=/usr/sbin/pbuilder
if test -z "$PRODUCT"; then
- PRODUCT=`echo *.dsc|sed 's/_.*//g'`
+ PRODUCT=`echo *.dsc|sed 's/_.*//g'`
fi
ARCHS="i386 amd64"
if grep "Architecture: all" $PKG >/dev/null; then
echo "===================================================="
exit 0
fi
-# remove existing package directories
-for f in [a-z]*; do
- if test -d $f; then
- rm -fr $f
- fi
-done
rm -f *.log
i=0
for dist in ${DEBIAN_DIST} ${UBUNTU_DIST}; do
for arch in ${USE_ARCHS}; do
- rm -fr ${dist}-${arch}
- (
- 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 $PKG
- ) >${dist}-${arch}.log 2>&1 &
+ sudo -n $PBUILDROOT \
+ --dist=$dist --arch=$arch --dsc=$PKG >${dist}-${arch}.log 2>&1 &
i=`expr $i + 1`
if test $i -eq $concurrency; then
i=0
wait
+ if test -f ${dist}-${arch}/*.dsc; then
+ :
+ else
+ echo "No .dsc file for ${dist}-${arch}"
+ exit 1
+ fi
fi
done
done