From 12377d79078170ec47c1fa5fb56b12ecb13367e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Sat, 20 Oct 2012 16:04:17 -0300 Subject: Use TokyoCabinet to store the PKGBUILD path cache --- toru-where | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'toru-where') diff --git a/toru-where b/toru-where index 02a7a88..f732dc0 100755 --- a/toru-where +++ b/toru-where @@ -1,11 +1,10 @@ #!/bin/bash # Locates a PKGBUILD dir on toru's path cache -source $(dirname $(command -v $0))/toru-utils +source /etc/libretools.conf -# Look in all cached but pick the last one -grep "^${1}:" "${TORUPATH}/paths" 2>/dev/null| \ - tail -n1 2>/dev/null|\ - cut -d: -f2 2>/dev/null +PATHFILE=${TORUPATH}/paths.tch + +exec tcamgr get ${PATHFILE} $1 exit $? -- cgit v1.2.3-2-g168b From 7389eee3207cf2e06b6392cac3cdbe622d284df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Mon, 29 Oct 2012 15:55:54 -0300 Subject: Return nothing when missing --- toru-where | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'toru-where') diff --git a/toru-where b/toru-where index f732dc0..e9ab29d 100755 --- a/toru-where +++ b/toru-where @@ -1,10 +1,7 @@ #!/bin/bash # Locates a PKGBUILD dir on toru's path cache - source /etc/libretools.conf PATHFILE=${TORUPATH}/paths.tch -exec tcamgr get ${PATHFILE} $1 - -exit $? +tcamgr get ${PATHFILE} $1 2>/dev/null || echo "" -- cgit v1.2.3-2-g168b