Skip to content

Commit

Permalink
bee-cache: New command 'grep [grep-options] [pattern]'
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mariux committed Aug 7, 2012
1 parent b0bb8be commit 3361347
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/bee-cache.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down Expand Up @@ -239,6 +244,9 @@ cache_verify
tmpinstall_to_filenames

case "${cmd}" in
grep)
cache_grep "${@}" | cut -d ' ' -f${FIELDS}
;;
update)
cache_update "${@}"
;;
Expand Down

0 comments on commit 3361347

Please sign in to comment.