8
Usage: [revno [output.tar.gz]]
10
Create a tarball of revno (or tag) in output.tar.gz
11
revno defaults to \`bzr revno\`.
12
output filename defaults to:
13
curtin-X.Y~bzrREVNO.tar.gz
14
or, if a tag is given:
17
if UNCOMMITTED is set to non '0' in environment
18
then uncommitted changes will be kept in the tarball.
23
fail() { echo "$@" 1>&2; exit 1; }
25
[ -z "$TEMP_D" ] || rm -Rf "$TEMP_D"
29
if [ "${UNCOMMITTED:-0}" != "0" ]; then
30
export_uncommitted="--uncommitted"
33
[ "$1" = "-h" -o "$1" = "--help" ] && { Usage; exit 0; }
39
tag:*) version="${1#tag:}";;
40
HEAD) revno="$(bzr revno)"; revargs="-r $revno";;
41
[0-9]*) revno="$1" ; revargs="-r $1";;
45
if [ -z "$version" ]; then
46
bzr cat $revargs debian/changelog.trunk > "$TEMP_D/clog" ||
47
fail "failed to extract debian/change.log.trunk at $revargs"
49
clogver_o=$(sed -n '1s,.*(\([^)]*\)).*,\1,p' $TEMP_D/clog)
50
clogver_upstream=${clogver_o%%-*}
52
version="$mmm~bzr$revno"
55
if [ -z "$output" ]; then
56
output="$sourcename-$version.tar.gz"
59
bzr export ${export_uncommitted} \
60
--format=tgz --root="$sourcename-${version}" $revargs $output