usage()
{
cat <<EOF
-Usage: id-pbuild1.sh [OPTIONS]
+Usage: id-pbuild-root.sh [OPTIONS]
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
}
--dsc=*)
dsc=$optarg
;;
+ --home=*)
+ HOME=$optarg
+ ;;
-*)
- do_help=yes
+ usage 1
;;
esac
shift
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 /var/cache/pbuilder/${dist}-${arch}-base.tgz; then
- DIST=$dist ARCH=$arch $PBUILDER --create
+
+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
+ 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