@@ -23,19 +23,19 @@ branch='master'
2323tag=' no'
2424certid=' X'
2525
26-
2726usage (){
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
3939do
4040 case " $opt " in
4141 v) version=" $OPTARG " ;;
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
7374fi
7475
7576if [ -d " $outputdir " ]; then
76- rm $outputdir /*
77+ rm -r $outputdir /*
7778else
7879 mkdir $outputdir
7980fi
80-
8181cp $sourcedir /KEYS $outputdir /KEYS
8282
8383cd $sourcedir
@@ -87,8 +87,8 @@ git archive --format=zip --prefix=apache-cloudstack-$version-incubating-src/ $br
8787
8888cd $outputdir
8989echo ' 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
9393echo ' md5'
9494gpg -v --print-md MD5 apache-cloudstack-$version -incubating-src.tar.gz > apache-cloudstack-$version -incubating-src.tar.gz.md5
0 commit comments