X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=id-deb-build%2Fid-pbuild-root.sh;h=e0d1e14fa631afd223459d03e29185fea90d0bdb;hb=839efe6d8548bf2453b282bd49cf1deca4ad079f;hp=1707786693a948d21c1e868754d1684f2b9a63ce;hpb=8e02411beadd0f2f2cbf5a9f90b05dd6dd5693db;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 1707786..e0d1e14 100755 --- a/id-deb-build/id-pbuild-root.sh +++ b/id-deb-build/id-pbuild-root.sh @@ -1,69 +1,87 @@ #!/bin/sh - usage() { cat <&2 fi -rm -fr ${dist}-${arch} - -if test ! -f $HOME/.pbuilderrc; then - echo "$HOME/.pbuilderrc missing" +if test -z "$DIST"; then + echo "id-pbuild-root.sh: missing --dist" 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 +if test -z "$ARCH"; then + echo "id-pbuild-root.sh: missing --arch" + exit 1 fi +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: +