From 08cb2e3bbbf45510d75d9c464edb7f696bdfb5e4 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 15 May 2006 15:10:37 +0000 Subject: [PATCH] support bzr --- baz-update-config | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/baz-update-config b/baz-update-config index e992cf9..922b75a 100755 --- a/baz-update-config +++ b/baz-update-config @@ -18,14 +18,33 @@ for line in $(baz cat-config "$1"); do DIR="$1" VERSION="$2" - if [ -d "$DIR" ]; then - OLDVERSION="$(baz tree-version -d "$DIR")" - if [ "$VERSION" != "$OLDVERSION" ]; then - baz switch -d "$DIR" "$VERSION" - else - baz update -d "$DIR" "$VERSION" - fi - else - baz get "$VERSION" "$DIR" - fi + case $VERSION in + http://*) + if [ -d "$DIR" ]; then + if [ ! -d "$DIR/.bzr" ]; then + echo "$DIR is not a bzr checkout; cannot update" >&2 + continue + fi + (cd "$DIR" && bzr pull "$VERSION") + else + bzr get "$VERSION" "$DIR" + fi + ;; + *) + if [ -d "$DIR" ]; then + if [ ! -d "$DIR/{arch}" ]; then + echo "$DIR is not an arch checkout; cannot update" >&2 + continue + fi + OLDVERSION="$(baz tree-version -d "$DIR")" + if [ "$VERSION" != "$OLDVERSION" ]; then + baz switch -d "$DIR" "$VERSION" + else + baz update -d "$DIR" "$VERSION" + fi + else + baz get "$VERSION" "$DIR" + fi + ;; + esac done -- 2.30.2