diff options
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} |