From 3361347425fdb503110bebbcfec5a5853d3abeb5 Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Tue, 7 Aug 2012 15:55:40 +0200 Subject: [PATCH] bee-cache: New command 'grep [grep-options] [pattern]' Allows to grep in INVENTORY file and just print matching/non-matching lines dependent on grep options. Calls system grep and takes all options the system grep handles. If no search pattern is given, undefined behavior occurs. --- src/bee-cache.sh.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/bee-cache.sh.in b/src/bee-cache.sh.in index b852843..0ec8df5 100644 --- a/src/bee-cache.sh.in +++ b/src/bee-cache.sh.in @@ -71,6 +71,11 @@ function cache_update_pkg() { return 0 } +function cache_grep() { + ${BEEFLOCK} --shared ${BEECACHE_INVENTORY} \ + grep "${@}" ${BEECACHE_INVENTORY} +} + function print_conflicts() { local pkg=${1} @@ -239,6 +244,9 @@ cache_verify tmpinstall_to_filenames case "${cmd}" in + grep) + cache_grep "${@}" | cut -d ' ' -f${FIELDS} + ;; update) cache_update "${@}" ;;