blob: 5065a305dbeeecf6d2f7a6d63fe363ebc05ad350 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#!/bin/bash
source $(dirname $(command -v $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 ${_pkgbuild})
for _pkg in ${pkgbase} ${pkgname[@]} ${provides[@]}; do
paths+=(${_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}
|