diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-10-22 17:47:57 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-10-22 17:47:57 +0200 |
commit | 40a429d2f3aea6931c826f887f351414f80d640e (patch) | |
tree | b0257db2e54ea7c98203e256fd424b28bd6d7b09 /server/mrrepo | |
parent | 19ff8ac28a266b60d28cf3d9cf7464ac79836480 (diff) |
Cleanup mkrepo, mrrepo some more
Diffstat (limited to 'server/mrrepo')
-rwxr-xr-x | server/mrrepo | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/server/mrrepo b/server/mrrepo index 91f6966..85a037c 100755 --- a/server/mrrepo +++ b/server/mrrepo @@ -31,12 +31,12 @@ function error () { info "$*"; exit 1; } prot="http" host= path= -verb="0" +verb=0 -while [ "$#" -gt "0" ]; do +while [ "$#" -gt 0 ]; do case "$1" in -v) - verb="1" + verb=1 shift ;; -s) @@ -67,20 +67,20 @@ fi cd "$path" curl_ops=() -curl_ops+=("-f") # Fail on HTTP errors. -curl_ops+=("--max-time" "30") # Finish in 30 seconds. +curl_ops+=(-f) # Fail on HTTP errors. +curl_ops+=(--max-time 30) # Finish in 30 seconds. -if [ "$verb" -ge "1" ]; then - curl_ops+=("--progress-bar") +if [ "$verb" -ge 1 ]; then + curl_ops+=(--progress-bar) else - curl_ops+=("-s" "-S") # Silent but show errors. + curl_ops+=(-s -S) # Silent but show errors. fi function fetch () # <url> [<curl-options>] { local u="$1"; shift - if [ "$verb" -ge "1" ]; then + if [ "$verb" -ge 1 ]; then info "${curl_ops[@]}" "$@" "$u" fi @@ -99,8 +99,8 @@ done <manifest old=("$(find . -type d -name '*.git' -print -prune | sed -e 's%^./%%' -)") git_ops=() -if [ "$verb" -eq "0" ]; then - git_ops+=("-q") +if [ "$verb" -eq 0 ]; then + git_ops+=(-q) fi for r in "${new[@]}"; do @@ -110,7 +110,7 @@ for r in "${new[@]}"; do fi fi if [ ! -d "$r" ]; then - if [ "$verb" -ge "1" ]; then + if [ "$verb" -ge 1 ]; then info "new repository $r in manifest, cloning" info git clone "${git_ops[@]}" --mirror "git://$host/$r" "$r" fi @@ -121,7 +121,7 @@ for r in "${new[@]}"; do # fetch "$prot://$host/$r/description" -o "$r/description" else - if [ "$verb" -ge "1" ]; then + if [ "$verb" -ge 1 ]; then info "existing repository $r, fetching" info git -C "$r" fetch "${git_ops[@]}" --prune --tags fi @@ -140,7 +140,7 @@ for o in "${old[@]}"; do done if [ -n "$o" ]; then - if [ "$verb" -ge "1" ]; then + if [ "$verb" -ge 1 ]; then info "repository $o is no longer in manifest, removing" fi rm -rf "$o" |