summaryrefslogtreecommitdiff
path: root/toru-path
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@kiwwwi.com.ar>2012-11-03 13:29:38 -0300
committerNicolás Reynolds <fauno@kiwwwi.com.ar>2012-11-03 13:29:38 -0300
commit04af64022ed0a0bf618e23c0ed7512c168d479c7 (patch)
tree2d907dd87c94721a77829bca93e21783598a4c8d /toru-path
parent5863c70d969c4654e0ea99f7b68876bc4aa5770b (diff)
Traverse REPOS backwards
This ensures packages in stable repos are added last to the path cache
Diffstat (limited to 'toru-path')
-rwxr-xr-xtoru-path8
1 files changed, 7 insertions, 1 deletions
diff --git a/toru-path b/toru-path
index 7f1d599..957f49b 100755
--- a/toru-path
+++ b/toru-path
@@ -3,6 +3,7 @@
source $(dirname $(command -v $0))/toru-utils
TORUPATH=${T:-${TORUPATH}}
+VERBOSE=${V:-false}
if [ ! -w "$TORUPATH" ]; then
error "Toru's path isn't writable. Please check $TORUPATH"
@@ -18,7 +19,11 @@ fi
# TODO pass other paths via flags
# ABSROOT has trailing slash
-fullrepos=($(for _repo in ${REPOS[@]}; do echo "${ABSROOT}${_repo}"; done))
+fullrepos=()
+for (( i = ${#REPOS[@]}-1 ; i >= 0 ; i-- )); do
+ ${VERBOSE} && msg "Processing [%s]" ${REPOS[$i]}
+ fullrepos+=("${ABSROOT}${REPOS[$i]}")
+done
pkgbuilds=($(get_pkgbuilds ${fullrepos[@]}))
msg "Updating path cache"
@@ -33,6 +38,7 @@ for _pkgbuild in ${pkgbuilds[@]}; do
fullpath=$(dirname ${_pkgbuild})
for _pkg in ${pkgbase} ${pkgname[@]} ${provides[@]}; do
+ $VERBOSE && msg2 "${_pkg} -> ${fullpath}"
tcamgr put ${PATHFILE} ${_pkg/[<>=]*} ${fullpath}
done