summaryrefslogtreecommitdiff
path: root/src/toru/toru-path
diff options
context:
space:
mode:
Diffstat (limited to 'src/toru/toru-path')
-rwxr-xr-xsrc/toru/toru-path13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/toru/toru-path b/src/toru/toru-path
index fac4e5a..07efb11 100755
--- a/src/toru/toru-path
+++ b/src/toru/toru-path
@@ -37,12 +37,12 @@ main() {
check_vars abs ABSROOT || exit 1
if [ ! -w "$TORUPATH" ]; then
- error "Toru's path isn't writable. Please check $TORUPATH"
+ error "Toru's path isn't writable. Please check your TORUPATH: %q" "$TORUPATH"
exit 1
fi
- lastsyncfile=${TORUPATH}/lastsync.paths
- pathfile=${TORUPATH}/paths.tch
+ local lastsyncfile=${TORUPATH}/lastsync.paths
+ local pathfile=${TORUPATH}/paths.tch
if [ ! -e "${pathfile}" ]; then
tcamgr create "${pathfile}"
@@ -50,10 +50,10 @@ main() {
# TODO: ability to use flags to pass in other directories to fullrepos
+ local fullrepos=()
# This loops over ${REPOS[@]} backward. This is because early entries
# in REPOS have higher precidence, but the way this is implemented,
# the later entries have precedence, so we need to flip the order.
- fullrepos=()
for (( i = ${#REPOS[@]}-1 ; i >= 0 ; i-- )); do
$VERBOSE && msg "Processing [%s]" "${REPOS[$i]}"
@@ -64,7 +64,7 @@ main() {
# Find PKGBUILDs in ${fullrepos[@]}
find_args=("${fullrepos[@]}" -mindepth 2 -maxdepth 3 -type f -name PKGBUILD)
- if ! $FORCE && [[ -e $lastsyncfile ]]; then
+ if [[ -e $lastsyncfile ]] && ! $FORCE; then
# if lastfilesync exists, only look at things that have
# changed since then (unless $FORCE is on)
find_args+=(-newer "${lastsyncfile}")
@@ -75,9 +75,10 @@ main() {
# Add information from each of the PKGBUILDs to the toru cache.
msg "Updating path cache"
msg2 "%d PKGBUILDs to update" ${#pkgbuilds[@]}
+ local _pkgbuild fullpath
for _pkgbuild in "${pkgbuilds[@]}"; do
# plain "$_pkgbuild"
- if ! load_PKGBUILD "${_pkgbuild}" >/dev/null 2>&1; then
+ if ! load_PKGBUILD "${_pkgbuild}" &>/dev/null; then
error "%q contains errors, skipping" "${_pkgbuild}"
continue
fi