From: Adam Dickmeiss Date: Fri, 20 Aug 2010 11:44:56 +0000 (+0200) Subject: Add support for remote build (option --remote) X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=61ccccd556208dab55c8031de69887d8c00ac31c;p=git-tools-moved-to-github.git Add support for remote build (option --remote) For example, --remote=idpbuilder@squeeze will build as user idpbuilder on squeeze. Before rebuild remove old output (not when doing --upload of course). --- diff --git a/id-deb-build/id-pbuild.sh b/id-deb-build/id-pbuild.sh index cab6efa..03e48f0 100755 --- a/id-deb-build/id-pbuild.sh +++ b/id-deb-build/id-pbuild.sh @@ -43,6 +43,9 @@ while test $# -gt 0; do --upload) upload=true ;; + --remote=*) + REMOTE=$optarg + ;; -*) do_help=yes ;; @@ -54,6 +57,24 @@ if test "$do_help" = "yes"; then 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 +fi if test -d deb-src; then cd deb-src fi @@ -94,6 +115,14 @@ if $upload; then echo "./update-archive.sh" 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 date