chiark / gitweb /
add chroot-setup, chroot-teardown, and chroot-enter suite of tools
[bin.git] / bazpath
1 #! /bin/sh -e
2 # Work out Bazaar archive names for branches or tags of the current
3 # directory.
4
5 WANTED="$1"
6 ME="$(baz tree-version)"
7
8 if [ "$WANTED" ]; then
9         ARCHIVE="$(baz parse-package-name --arch "$ME")"
10         CATEGORY="$(baz parse-package-name --category "$ME")"
11         case $WANTED in
12                 *--*)
13                         echo "$ARCHIVE/$CATEGORY--$WANTED"
14                         ;;
15                 *)
16                         VERSION="$(baz parse-package-name --vsn "$ME")"
17                         echo "$ARCHIVE/$CATEGORY--$WANTED--$VERSION"
18                         ;;
19         esac
20 else
21         echo "$ME"
22 fi