summaryrefslogtreecommitdiff
path: root/tools/make-dist-tarball
blob: 53f99e8c0ecd7b0c3f5b6a8498bdc28f5e54e573 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

Usage() {
   cat <<EOF
Usage: ${0##*/} version
   make a tarball of 'version'
   must be in a bzr directory, and 'version' must be a tag

EOF
}

topdir=$PWD
tag=${1}

[ -n "$tag" ] || { Usage 1>&2 ; exit 1; }

tmpd=$(mktemp -d ); 
trap "rm -Rf '${tmpd}'" 0

out=${topdir}/cloud-init_${tag}.orig.tar.gz

cd ${tmpd} && 
   bzr branch -r "tag:${tag}" "${topdir}" ./cloud-init-${tag} &&
   tar czf "${out}" cloud-init-${tag}/ --exclude cloud-init-${tag}/.bzr &&
   echo "wrote ${out}"