summaryrefslogtreecommitdiff
path: root/update-sources
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2021-08-31 19:58:04 +0200
committerErich Eckner <git@eckner.net>2021-08-31 19:58:04 +0200
commit6adbf2645b4e6c58837c36d62d8c830456533e73 (patch)
treeaee0a9538e20659fe29604a05b26d11046aa6ebf /update-sources
parent54282a81301fd506a934c2bb9801e1775e65e99d (diff)
downloadarchlinuxewe-6adbf2645b4e6c58837c36d62d8c830456533e73.tar.xz
update-sources: remove repositoriy if update fails
Diffstat (limited to 'update-sources')
-rwxr-xr-xupdate-sources6
1 files changed, 4 insertions, 2 deletions
diff --git a/update-sources b/update-sources
index 1b4e98daf..2a0aa41ca 100755
--- a/update-sources
+++ b/update-sources
@@ -31,11 +31,13 @@ elif [ $# -eq 1 ]; then
case "${1%%: *}" in
'git')
- git -C "${1#*: }" fetch --all -p
+ git -C "${1#*: }" fetch --all -p \
+ || rm -rf --one-file-system "${1#*: }"
;;
'svn')
cd "${1#*: }"
- svn update
+ svn update \
+ || rm -rf --one-file-system "${1#*: }"
;;
*)
>&2 printf '%s: unknown VCS "%s"\n' "$0" "${1%%: *}"