From: Colin Watson Date: Thu, 12 May 2005 09:27:43 +0000 (+0000) Subject: Add a couple of tools to make working with Bazaar archives more convenient. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=9d47b500450089aa57eb7f5df4047220c8b78a3c;p=bin.git Add a couple of tools to make working with Bazaar archives more convenient. --- diff --git a/bazpath b/bazpath new file mode 100755 index 0000000..8311b4b --- /dev/null +++ b/bazpath @@ -0,0 +1,22 @@ +#! /bin/sh -e +# Work out Bazaar archive names for branches or tags of the current +# directory. + +WANTED="$1" +ME="$(baz tree-version)" + +if [ "$WANTED" ]; then + ARCHIVE="$(baz parse-package-name --arch "$ME")" + CATEGORY="$(baz parse-package-name --category "$ME")" + case $WANTED in + *--*) + echo "$ARCHIVE/$CATEGORY--$WANTED" + ;; + *) + VERSION="$(baz parse-package-name --vsn "$ME")" + echo "$ARCHIVE/$CATEGORY--$WANTED--$VERSION" + ;; + esac +else + echo "$ME" +fi diff --git a/baztag b/baztag new file mode 100755 index 0000000..249f61a --- /dev/null +++ b/baztag @@ -0,0 +1,38 @@ +#! /bin/sh -e + +usage () { + cat <&2 + exit 1 +fi + +while :; do + case $1 in + --help) usage; exit 0 ;; + -n|--no-act) + NOACT=echo + shift + ;; + --) shift; break ;; + *) usage >&2; exit 1 ;; + esac +done + +if [ $# -eq 0 ]; then + usage >&2 + exit 1 +fi +VERSION="$1" + +$NOACT baz branch "$(bazpath)" "$(bazpath "releases--$VERSION")"