summaryrefslogtreecommitdiff
path: root/asp.in
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2014-08-01 10:05:14 -0400
committerDave Reisner <dreisner@archlinux.org>2014-08-01 10:05:14 -0400
commitb4bd7fe863a1801e58a17c619737484848e2c0ca (patch)
tree7321b1acd1f5db7fa6538b394adcd2e0c2778c3b /asp.in
parent58ce3499676cea818f2e49bbc3a5bf33a71ac964 (diff)
downloadasp32-b4bd7fe863a1801e58a17c619737484848e2c0ca.tar.xz
minor naming tweaks, remove useless rm -rf
Diffstat (limited to 'asp.in')
-rw-r--r--asp.in7
1 files 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