diff options
author | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2012-11-03 13:37:08 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2012-11-03 13:37:08 -0300 |
commit | 9983b0c757834d61b9099a5953dec9d92330ac76 (patch) | |
tree | 25da78388d742dd71b581df54d3fef33f34b61b4 /toru-path | |
parent | 38550a26dc66a8e5dd462da65acaf56119964536 (diff) | |
parent | 958043bd456f8e60f54a2b2e3a601439394558ca (diff) |
Merge branch 'master' into smart-cleanup
Conflicts:
update-cleansystem
Diffstat (limited to 'toru-path')
-rwxr-xr-x | toru-path | 29 |
1 files changed, 19 insertions, 10 deletions
@@ -2,22 +2,35 @@ 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" exit 1 fi LASTSYNCFILE=${TORUPATH}/lastsync.paths +PATHFILE=${TORUPATH}/paths.tch + +if [ ! -e "${PATHFILE}" ]; then + tcamgr create "${PATHFILE}" +fi # TODO pass other paths via flags -pkgbuilds=($(get_pkgbuilds ${ABSROOT})) -paths=() +# ABSROOT has trailing slash +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" msg2 "${#pkgbuilds[@]} PKGBUILDs to update" for _pkgbuild in ${pkgbuilds[@]}; do - $DEBUG && plain "$_pkgbuild" - source ${_pkgbuild} || { +# plain "$_pkgbuild" + source ${_pkgbuild} >/dev/null 2>&1 || { error "${_pkgbuild} contains errors, skipping" continue } @@ -25,15 +38,11 @@ for _pkgbuild in ${pkgbuilds[@]}; do fullpath=$(dirname ${_pkgbuild}) for _pkg in ${pkgbase} ${pkgname[@]} ${provides[@]}; do - paths+=(${_pkg/[<>=]*}:${fullpath}) + $VERBOSE && msg2 "${_pkg} -> ${fullpath}" + tcamgr put ${PATHFILE} ${_pkg/[<>=]*} ${fullpath} done unset pkgbase pkgname provides done - -# TODO remove old paths -# by joining new paths to old paths and exclude the joining points from the -# cache (sort of a sql join) -echo ${paths[@]} | tr ' ' "\n" | sort >> ${TORUPATH}/paths lastsync ${LASTSYNCFILE} |