summaryrefslogtreecommitdiff
path: root/tools/make-tarball
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2018-04-12 15:51:45 -0600
committerChad Smith <chad.smith@canonical.com>2018-04-12 15:51:45 -0600
commit49b562c94838f4e2c0aa0df01a5247d06bc8a561 (patch)
tree5790e0c68ddc5deac544499933a94be81350eb6c /tools/make-tarball
parent4b86ab9a25b512420ecfe98953a3f3a6e4b4bba1 (diff)
downloadvyos-cloud-init-49b562c94838f4e2c0aa0df01a5247d06bc8a561.tar.gz
vyos-cloud-init-49b562c94838f4e2c0aa0df01a5247d06bc8a561.zip
tools: Fix make-tarball cli tool usage for development
This tool is used to assist during the creation of ubuntu packages for release testing. Address the following on the command-line: * --help option now print usage * Add --orig-tarball which creates named output file cloud-init_<release-version>.orig.tar.gz * drop unused --verbose option
Diffstat (limited to 'tools/make-tarball')
-rwxr-xr-xtools/make-tarball15
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/make-tarball b/tools/make-tarball
index 3197689f..8d540139 100755
--- a/tools/make-tarball
+++ b/tools/make-tarball
@@ -13,22 +13,28 @@ Usage: ${0##*/} [revision]
create a tarball of revision (default HEAD)
options:
- -o | --output FILE write to file
+ -h | --help print usage
+ -o | --output FILE write to file
+ --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:,long,verbose"
+long_opts="help,output:,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=""
while [ $# -ne 0 ]; do
cur=$1; next=$2
case "$cur" in
+ -h|--help) Usage; exit 0;;
-o|--output) output=$next; shift;;
--long) long_opt="--long";;
+ --orig-tarball) orig_opt=".orig";;
--) shift; break;;
esac
shift;
@@ -39,7 +45,10 @@ version=$(git describe --abbrev=8 "--match=[0-9]*" ${long_opt} $rev)
archive_base="cloud-init-$version"
if [ -z "$output" ]; then
- output="$archive_base.tar.gz"
+ if [ ! -z "$orig_opt" ]; then
+ archive_base="cloud-init_$version"
+ fi
+ output="$archive_base$orig_opt.tar.gz"
fi
# when building an archiving from HEAD, ensure that there aren't any