X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=id-deb-build%2Fid-pbuild-root.sh;h=e0d1e14fa631afd223459d03e29185fea90d0bdb;hb=f23a522439343470ed9e0df49d4d1efe222b3e44;hp=d37e205ca814fec77946ac68ac70841ab48e4056;hpb=13a7b0bfb3dc2338c23cd2f0ebde01b3723ca574;p=git-tools-moved-to-github.git diff --git a/id-deb-build/id-pbuild-root.sh b/id-deb-build/id-pbuild-root.sh index d37e205..e0d1e14 100755 --- a/id-deb-build/id-pbuild-root.sh +++ b/id-deb-build/id-pbuild-root.sh @@ -1,51 +1,87 @@ #!/bin/sh - usage() { cat <&2 +fi +if test -z "$DIST"; then + echo "id-pbuild-root.sh: missing --dist" + exit 1 +fi +if test -z "$ARCH"; then + echo "id-pbuild-root.sh: missing --arch" + exit 1 fi -DIST=$dist ARCH=$arch $PBUILDER --update --override-config -DIST=$dist ARCH=$arch $PBUILDER --build $dsc +if test -z "$DSC"; then + echo "id-pbuild-root.sh: missing --dsc" + exit 1 +fi +if test ! -x /usr/bin/lxc-attach; then + echo "No lxc-attach. Probably not running on mochi!!" + exit 1 +fi +export DIST ARCH # export for pbuilder to see +echo "$DIST-$ARCH begin" +if $update; then + if ! lxc-attach -n pbuilder -- pbuilder --update --override-config >update-${DIST}-${ARCH}.log 2>&1; then + if ! lxc-attach -n pbuilder -- pbuilder --create >create-${DIST}-${ARCH}.log 2>&1; then + echo "$DIST-$ARCH failed. Inspect deb-src/create-${DIST}-${ARCH}.log" + exit 2 + fi + if ! lxc-attach -n pbuilder -- pbuilder --update --override-config >update-${DIST}-${ARCH}.log 2>&1; then + echo "$DIST-$ARCH failed. Inspect deb-src/update-${DIST}-${ARCH}.log" + exit 2 + fi + fi +fi +if ! lxc-attach -n pbuilder -- pbuilder --build $DSC >build-${DIST}-${ARCH}.log 2>&1; then + echo "$DIST-$ARCH failed. Inspect deb-src/build-${DIST}-${ARCH}.log" + exit 3 +fi +echo "$DIST-$ARCH done" +exit 0 # Local Variables: # mode:shell-script -# sh-indentation: 2 +# sh-indentation: 4 # sh-basic-offset: 4 # End: +