Skip to content

Commit bae835d

Browse files
committed
adding an option to the build script to permit setting a pgp key with which to sign
1 parent 03fcc26 commit bae835d

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎tools/build/build_asf.sh‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ branch='master'
2323
tag='no'
2424
certid='X'
2525

26-
2726
usage(){
2827
echo "usage: $0 -v version [-b branch] [-s source dir] [-o output dir] [-t [-u]] [-h]"
2928
echo " -v sets the version"
3029
echo " -b sets the branch (defaults to 'master')"
3130
echo " -s sets the source directory (defaults to $sourcedir)"
3231
echo " -o sets the output directory (defaults to $outputdir)"
3332
echo " -t tags the git repo with the version"
34-
echo " -u sets the certificate ID to sign the tag with (if not provided, the default key is attempted)"
33+
echo " -u sets the certificate ID to sign the tag with (if not provided, the default key is attempted)"
34+
echo " -k sets the key to sign the tarball with"
3535
echo " -h"
3636
}
3737

38-
while getopts v:s:o:b:tu:h opt
38+
while getopts v:s:o:b:tu:k:h opt
3939
do
4040
case "$opt" in
4141
v) version="$OPTARG";;
@@ -44,9 +44,10 @@ do
4444
b) branch="$OPTARG";;
4545
t) tag='yes';;
4646
u) certid="$OPTARG";;
47+
k) keyid="--default-key $OPTARG";;
4748
h) usage
4849
exit 0;;
49-
\?) # unknown flag
50+
/?) # unknown flag
5051
usage
5152
exit 1;;
5253
esac
@@ -73,11 +74,10 @@ else
7374
fi
7475

7576
if [ -d "$outputdir" ]; then
76-
rm $outputdir/*
77+
rm -r $outputdir/*
7778
else
7879
mkdir $outputdir
7980
fi
80-
8181
cp $sourcedir/KEYS $outputdir/KEYS
8282

8383
cd $sourcedir
@@ -87,8 +87,8 @@ git archive --format=zip --prefix=apache-cloudstack-$version-incubating-src/ $br
8787

8888
cd $outputdir
8989
echo 'armor'
90-
gpg -v --armor --output apache-cloudstack-$version-incubating-src.tar.gz.asc --detach-sig apache-cloudstack-$version-incubating-src.tar.gz
91-
gpg -v --armor --output apache-cloudstack-$version-incubating-src.zip.asc --detach-sig apache-cloudstack-$version-incubating-src.zip
90+
gpg -v $keyid --armor --output apache-cloudstack-$version-incubating-src.tar.gz.asc --detach-sig apache-cloudstack-$version-incubating-src.tar.gz
91+
gpg -v $keyid --armor --output apache-cloudstack-$version-incubating-src.zip.asc --detach-sig apache-cloudstack-$version-incubating-src.zip
9292

9393
echo 'md5'
9494
gpg -v --print-md MD5 apache-cloudstack-$version-incubating-src.tar.gz > apache-cloudstack-$version-incubating-src.tar.gz.md5

0 commit comments

Comments
 (0)