diff options
| author | Chad Smith <chad.smith@canonical.com> | 2018-06-21 14:32:27 -0600 |
|---|---|---|
| committer | Chad Smith <chad.smith@canonical.com> | 2018-06-21 14:32:27 -0600 |
| commit | ba53ceb5a8a30c10951ec3ac49b8d6ebbe09a524 (patch) | |
| tree | 5b68f0602daea648d48b3dc16809b0d66fb565d1 /tools/make-tarball | |
| parent | 7d1e8976bba629f30da45e814a5a97e2f4b7de3d (diff) | |
| parent | 2d6e4219db73e80c135efd83753f9302f778f08d (diff) | |
| download | vyos-cloud-init-ba53ceb5a8a30c10951ec3ac49b8d6ebbe09a524.tar.gz vyos-cloud-init-ba53ceb5a8a30c10951ec3ac49b8d6ebbe09a524.zip | |
merge from master at 18.3
Diffstat (limited to 'tools/make-tarball')
| -rwxr-xr-x | tools/make-tarball | 15 |
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 |
