diff options
author | Joshua Ismael Haase Hernández <hahj87@gmail.com> | 2012-01-22 23:06:56 -0600 |
---|---|---|
committer | Joshua Ismael Haase Hernández <hahj87@gmail.com> | 2012-01-22 23:06:56 -0600 |
commit | 7a00f2a55b69c39ae8ebad99b3d91a509b614b1b (patch) | |
tree | 7ca94ca289c069374cac149545a86234270d8fe6 /toru-path | |
parent | 825ac89cfa857e4379e9e1baf6d470cf9e583dde (diff) | |
parent | 0985429b68d8da1016bf4a84b2a2d32fb8c3027c (diff) |
Merge branch 'master' of gitpar:libretools
Diffstat (limited to 'toru-path')
-rwxr-xr-x | toru-path | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/toru-path b/toru-path new file mode 100755 index 0000000..7500aed --- /dev/null +++ b/toru-path @@ -0,0 +1,32 @@ +#!/bin/bash + +source $(dirname $0)/toru-utils + +LASTSYNCFILE=${TORUPATH}/lastsync.paths + +# TODO pass other paths via flags +pkgbuilds=($(get_pkgbuilds ${ABSROOT})) +paths=() + +msg "Updating path cache" +msg2 "${#pkgbuilds[@]} PKGBUILDs to update" +for _pkgbuild in ${pkgbuilds[@]}; do + $DEBUG && plain "$_pkgbuild" + source ${_pkgbuild} || { + error "${_pkgbuild} contains errors, skipping" + continue + } + + fullpath=$(dirname $(readlink -f ${_pkgbuild})) + + for _pkg in ${pkgname[@]} ${provides[@]}; do + paths+=(${_pkg/[<>=]*}:${fullpath}) + done + + unset pkgname provides +done + +# TODO remove old paths +echo ${paths[@]} | tr ' ' "\n" | sort >> ${TORUPATH}/paths + +lastsync ${LASTSYNCFILE} |