mkdist.sh: do not use debian/changelog
[git-tools-moved-to-github.git] / id-deb-build / id-pbuild-root.sh
index 3eeb85e..1707786 100755 (executable)
@@ -8,6 +8,10 @@ Options:
         [--dsc=dscfile]
        [--dist=distribution]
        [--arch=architecture]
+        [--home=home]
+
+This script is should be called with root privilege. It is meant to be
+called by id-pbuild.sh.
 EOF
     exit $1
 }
@@ -28,8 +32,11 @@ while test $# -gt 0; do
        --dsc=*)
            dsc=$optarg
            ;;
+       --home=*)
+           HOME=$optarg
+           ;;
        -*)
-           do_help=yes
+           usage 1
            ;;
     esac
     shift
@@ -37,8 +44,16 @@ done
 
 PBUILDER=/usr/sbin/pbuilder
 
+if test -z "$dist" -o -z "$arch"; then
+    echo "dist and arch must be given"
+    usage 1
+fi
 rm -fr ${dist}-${arch}
 
+if test ! -f $HOME/.pbuilderrc; then
+    echo "$HOME/.pbuilderrc missing"
+    exit 1
+fi
 if test "$dsc"; then
     if test ! -f /var/cache/pbuilder/${dist}-${arch}-base.tgz; then
        DIST=$dist ARCH=$arch $PBUILDER --create