summaryrefslogtreecommitdiff
path: root/toru
diff options
context:
space:
mode:
authorNicolas Reynolds <fauno@kiwwwi.com.ar>2011-11-01 17:16:48 -0300
committerNicolas Reynolds <fauno@kiwwwi.com.ar>2011-11-01 17:16:48 -0300
commit46798e856bcfa70791e19e7729322ad2f425d157 (patch)
tree66aad71e0a139d190fe06b6475c575e962b17d02 /toru
parent4c4f7255e97bde5524e3798b4b777a94e37da23d (diff)
PKGBUILD path caching
* Toru is overly complex * Moved path caching to toru-path. Run it without arguments to update the PKGBUILD paths cache * Updated fullpkg to check this new paths cache
Diffstat (limited to 'toru')
-rwxr-xr-xtoru42
1 files changed, 4 insertions, 38 deletions
diff --git a/toru b/toru
index d622510..55e4119 100755
--- a/toru
+++ b/toru
@@ -12,43 +12,7 @@
# * Possibility to hook up ABS dirs besides ABSROOT (low priority)
# * Tell updates and non available binary packages (working on this)
-source /etc/abs.conf
-source /etc/libretools.conf
-
-if [ ! -w "$TORUPATH" ]; then
- error "Toru's path isn't writable. Please check $TORUPATH"
- exit 1
-fi
-
-# TODO move to common functions
-# usage : in_array( $needle, $haystack )
-function in_array {
- [[ $2 ]] || return 1 # Not found
-
- local needle=$1; shift
- local item
-
- for item in "$@"; do
- [[ ${item#@} = $needle ]] && return 0 # Found
- done
-
- return 1 # Not Found
-}
-
-# Stores the lastsync date
-lastsync() {
- local lastsyncfile
-
- lastsyncfile=$1
-
- [ -e ${lastsyncfile} -a ! -w ${lastsyncfile} ] && {
- error "The sync date can't be saved. ${lastsyncfile} isn't writable."
- return 1
- }
-
- date +%s > ${lastsyncfile}
- touch ${lastsyncfile}
-}
+source $(dirname $0)/toru-utils
# Saves contents on a named cache
# $1 cache name (repo)
@@ -267,7 +231,9 @@ update() {
# See above FIXME
# print_package_array "${updates[@]}" > ${TMPDIR}/updates
- store_cache ${_repo}.updates ${TMPDIR}/updates
+ if [ -r ${TMPDIR}/updates ]; then
+ store_cache ${_repo}.updates ${TMPDIR}/updates
+ fi
else
$quiet || msg "Reading updates from cache..."