chiark / gitweb /
untested git support
[bin.git] / baz-update-config
index 6a45d910f1ba70a402af562db55976456898b7eb..71588857cf05a071aa174c184359ebe5e9f722b2 100755 (executable)
@@ -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
                                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
                                fi
-                               (cd "$DIR" && bzr pull "$VERSION")
+                               (cd "$DIR" && git pull "$VERSION")
                        else
                        else
-                               bzr get "$VERSION" "$DIR"
+                               git clone "$VERSION" "$DIR"
                        fi
                        ;;
                *)
                        fi
                        ;;
                *)