]> git.ipfire.org Git - thirdparty/git.git/commitdiff
DoKernelOrg: add --clean-stage
authorJunio C Hamano <gitster@pobox.com>
Thu, 23 Jun 2011 00:12:30 +0000 (17:12 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 23 Jun 2011 00:14:33 +0000 (17:14 -0700)
DoKernelOrg

index ef4b8154fbd443338b9be0fdf45853b85598f6ce..b31452a921d24eca43d57ad66afc730c8a22cafd 100755 (executable)
@@ -6,7 +6,7 @@ ln_or_cp () {
        ln -f "$@" || cp -f "$@"
 }
 
-STAGE= narch= arch= master= jobs= rpm=t final=
+STAGE= narch= arch= master= jobs= rpm=t final= clean_stage=
 G=/pub/software/scm/git
 THIS=$(git describe HEAD)
 
@@ -18,6 +18,7 @@ do
        -j*) jobs="$1" ;;
        --dist-only) rpm=f ;;
        --stage=?*) STAGE=${1#--stage=} ;;
+       --clean-stage) clean_stage=t ;;
        --final) final=t ;;
        --pub=?*) G=${1#--pub=} ;;
        *) echo >&3 "Eh? $1"; exit 1 ;;
@@ -30,6 +31,20 @@ do
        STAGE="${STAGE%/}"
 done
 
+if test -n "$clean_stage" && test -d "$STAGE/$G"
+then
+       echo -n "Remove $STAGE/$G [y/N]? "
+       read yesno
+       case "$yesno" in
+       [yY])
+               rm -fr "$STAGE/$G" &&
+               mkdir -p "$STAGE/$G" || exit ;;
+       *)
+               echo "Not removing, then"
+               exit 0 ;;
+       esac
+fi
+
 if test -z "$master"
 then
        case "$(hostname)" in
@@ -97,8 +112,10 @@ then
        ) || exit
        make clean
        echo >&2 "Done -- move RPMS to the master machine."
-       (cd $HOME/rpms && sha1sum TARPIT/$V.$arch.$dist.tar) >&2
        echo >&2 "scp $HOME/rpms/TARPIT/$V.$arch.$dist.tar master.kernel.org:rpms/TARPIT"
+       echo >&2 "sha1sum -c <<\EOF"
+       (cd $HOME/rpms && sha1sum TARPIT/$V.$arch.$dist.tar) >&2
+       echo >&2 "EOF"
        exit
 fi