X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?p=bin.git;a=blobdiff_plain;f=baz-update-config;h=71588857cf05a071aa174c184359ebe5e9f722b2;hp=6a45d910f1ba70a402af562db55976456898b7eb;hb=cdb79bca0737bc6c9e39cad2076d392387bc0ff0;hpb=34b8037c044aea04cf2219c93b3cb3c1c5818c76 diff --git a/baz-update-config b/baz-update-config index 6a45d91..7158885 100755 --- a/baz-update-config +++ b/baz-update-config @@ -26,10 +26,31 @@ for line in $(baz cat-config "$1" 2>/dev/null || cat "$1"); do if [ ! -d "$DIR/.bzr" ]; then echo "$DIR is not a bzr checkout; cannot update" >&2 continue + elif [ -f "$DIR/.bzr/branch/bound" ]; then + bzr update "$DIR" + else + (cd "$DIR" && bzr pull "$VERSION") + fi + else + case $VERSION in + bzr+ssh://*|sftp://*) + bzr checkout "$VERSION" "$DIR" + ;; + *) + bzr get "$VERSION" "$DIR" + ;; + esac + fi + ;; + git://*|git+*://*) + if [ -d "$DIR" ]; then + if [ ! -d "$DIR/.git" ]; then + echo "$DIR is not a git checkout; cannot update" >&2 + continue fi - (cd "$DIR" && bzr pull "$VERSION") + (cd "$DIR" && git pull "$VERSION") else - bzr get "$VERSION" "$DIR" + git clone "$VERSION" "$DIR" fi ;; *)