From b4bd7fe863a1801e58a17c619737484848e2c0ca Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Fri, 1 Aug 2014 10:05:14 -0400 Subject: minor naming tweaks, remove useless rm -rf --- asp.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/asp.in b/asp.in index 0797bc9..3ac8021 100644 --- a/asp.in +++ b/asp.in @@ -71,7 +71,7 @@ version() { printf 'asp v0\n' } -update() { +update_all() { local r for r in "${ARCH_GIT_REPOS[@]}"; do @@ -84,11 +84,13 @@ update_packages() { local refspecs=() remote pkgname declare -A refspec_map + # map packages to remotes for pkgname; do package_init -n "$pkgname" remote || return 1 refspec_map["$remote"]+=" packages/$pkgname" done + # update each remote all at once for remote in "${!refspec_map[@]}"; do read -ra refspecs <<<"${refspec_map["$remote"]}" remote_update_refs "$remote" "${refspecs[@]}" @@ -118,7 +120,6 @@ initialize() { git init || return 1 for remote in "${ARCH_GIT_REPOS[@]}"; do - rm -rf "$remote" git remote add "$remote" git://projects.archlinux.org/svntogit/"$remote".git done @@ -222,7 +223,7 @@ shift case $action in update) if (( $# == 0 )); then - update + update_all else update_packages "$@" fi -- cgit v1.2.3-70-g09d2