DoKernelOrg: add --clean-stage
Junio C Hamano committed
Jun 22, 2011 at 17:12 UTC
b453fed6af45cb9c0e91a9c124c4a19730c8b70d
1 file changed
+19
-2
DoKernelOrg
+19
-2
@@ -6,7 +6,7 @@ ln_or_cp () {
6
ln -f "$@" || cp -f "$@"
7
}
8
9
-STAGE= narch= arch= master= jobs= rpm=t final=
9
+STAGE= narch= arch= master= jobs= rpm=t final= clean_stage=
10
G=/pub/software/scm/git
11
THIS=$(git describe HEAD)
12
@@ -18,6 +18,7 @@ do
18
-j*) jobs="$1" ;;
19
--dist-only) rpm=f ;;
20
--stage=?*) STAGE=${1#--stage=} ;;
21
+ --clean-stage) clean_stage=t ;;
22
--final) final=t ;;
23
--pub=?*) G=${1#--pub=} ;;
24
*) echo >&3 "Eh? $1"; exit 1 ;;
@@ -30,6 +31,20 @@ do
31
STAGE="${STAGE%/}"
32
done
33
34
+if test -n "$clean_stage" && test -d "$STAGE/$G"
35
+then
36
+ echo -n "Remove $STAGE/$G [y/N]? "
37
+ read yesno
38
+ case "$yesno" in
39
+ [yY])
40
+ rm -fr "$STAGE/$G" &&
41
+ mkdir -p "$STAGE/$G" || exit ;;
42
+ *)
43
+ echo "Not removing, then"
44
+ exit 0 ;;
45
+ esac
46
+fi
47
+
48
if test -z "$master"
49
then
50
case "$(hostname)" in
@@ -97,8 +112,10 @@ then
112
) || exit
113
make clean
114
echo >&2 "Done -- move RPMS to the master machine."
100
- (cd $HOME/rpms && sha1sum TARPIT/$V.$arch.$dist.tar) >&2
115
echo >&2 "scp $HOME/rpms/TARPIT/$V.$arch.$dist.tar master.kernel.org:rpms/TARPIT"
116
+ echo >&2 "sha1sum -c <<\EOF"
117
+ (cd $HOME/rpms && sha1sum TARPIT/$V.$arch.$dist.tar) >&2
118
+ echo >&2 "EOF"
119
exit
120
fi
121