5 if [ -z "$CONFIG" ]; then
6 echo "Usage: $0 CONFIG" >&2
15 for line in $(baz cat-config "$1" 2>/dev/null || cat "$1"); do
21 echo "Updating $DIR ($VERSION) ..."
24 bzr+ssh://*|http://*|sftp://*)
25 if [ -d "$DIR" ]; then
26 if [ ! -d "$DIR/.bzr" ]; then
27 echo "$DIR is not a bzr checkout; cannot update" >&2
29 elif [ -f "$DIR/.bzr/branch/bound" ]; then
32 (cd "$DIR" && bzr pull "$VERSION")
37 bzr checkout "$VERSION" "$DIR"
40 bzr get "$VERSION" "$DIR"
46 if [ -d "$DIR" ]; then
47 if [ ! -d "$DIR/.git" ]; then
48 echo "$DIR is not a git checkout; cannot update" >&2
51 (cd "$DIR" && git pull "$VERSION")
53 git clone "$VERSION" "$DIR"
57 if [ -d "$DIR" ]; then
58 if [ ! -d "$DIR/{arch}" ]; then
59 echo "$DIR is not an arch checkout; cannot update" >&2
62 OLDVERSION="$(baz tree-version -d "$DIR")"
63 if [ "$VERSION" != "$OLDVERSION" ]; then
64 baz switch -d "$DIR" "$VERSION"
66 baz update -d "$DIR" "$VERSION"
69 baz get "$VERSION" "$DIR"