summaryrefslogtreecommitdiff
path: root/tools/make-tarball
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-03-11 21:15:45 +0100
committerGitHub <noreply@github.com>2020-03-11 21:15:45 +0100
commitfd87c24ff8f6f09a7e2cc223a4e8cdb8c08f1ef8 (patch)
treeb754b3991e5e57a9ae9155819f73fa0cbd4be269 /tools/make-tarball
parentca9a4eb26b41c204d1bd3a15586b14a5dde950bb (diff)
parentc6627bc05a57645e6af8b9a5a67e452d9f37e487 (diff)
downloadvyos-cloud-init-fd87c24ff8f6f09a7e2cc223a4e8cdb8c08f1ef8.tar.gz
vyos-cloud-init-fd87c24ff8f6f09a7e2cc223a4e8cdb8c08f1ef8.zip
Merge pull request #4 from zdc/T2117
Cloud-init: T2117: Updated to 20.1 version
Diffstat (limited to 'tools/make-tarball')
-rwxr-xr-xtools/make-tarball12
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/make-tarball b/tools/make-tarball
index 8d540139..462e7d04 100755
--- a/tools/make-tarball
+++ b/tools/make-tarball
@@ -15,24 +15,27 @@ Usage: ${0##*/} [revision]
options:
-h | --help print usage
-o | --output FILE write to file
+ --version VERSION Set the version used in the tarball. Default value is determined with 'git describe'.
--orig-tarball Write file cloud-init_<version>.orig.tar.gz
--long Use git describe --long for versioning
EOF
}
short_opts="ho:v"
-long_opts="help,output:,orig-tarball,long"
+long_opts="help,output:,version:,orig-tarball,long"
getopt_out=$(getopt --name "${0##*/}" \
--options "${short_opts}" --long "${long_opts}" -- "$@") &&
eval set -- "${getopt_out}" || { Usage 1>&2; exit 1; }
long_opt=""
orig_opt=""
+version=""
while [ $# -ne 0 ]; do
cur=$1; next=$2
case "$cur" in
-h|--help) Usage; exit 0;;
-o|--output) output=$next; shift;;
+ --version) version=$next; shift;;
--long) long_opt="--long";;
--orig-tarball) orig_opt=".orig";;
--) shift; break;;
@@ -41,7 +44,12 @@ while [ $# -ne 0 ]; do
done
rev=${1:-HEAD}
-version=$(git describe --abbrev=8 "--match=[0-9]*" ${long_opt} $rev)
+if [ -z "$version" ]; then
+ version=$(git describe --abbrev=8 "--match=[0-9]*" ${long_opt} $rev)
+elif [ ! -z "$long_opt" ]; then
+ echo "WARNING: --long has no effect when --version is passed" >&2
+ exit 1
+fi
archive_base="cloud-init-$version"
if [ -z "$output" ]; then