# HG changeset patch # User Pascal Bellard # Date 1211487624 0 # Node ID d72efc8ec019f1486419a1b419f7815877c7f29e # Parent 404417fa9f9328593c146f19d255f6ec2d7cfc80 tazpkgbox: add search files diff -r 404417fa9f93 -r d72efc8ec019 lib/tazpkgbox/search --- a/lib/tazpkgbox/search Thu May 22 19:08:09 2008 +0000 +++ b/lib/tazpkgbox/search Thu May 22 20:20:24 2008 +0000 @@ -7,6 +7,23 @@ rm -f /tmp/tazpkgbox/search-installed touch /tmp/tazpkgbox/search-installed +list_files() +{ + sed 's/.\[[01]m//g' | awk 'BEGIN { show=0 } { + if (/^===/) show=1-show; + else if (/^Package/) pkg=$2; + else if ($0 != "" && show != 0) printf("%s||%s\n",pkg,$0); + }' +} + +if [ "$1" = "--files" ]; then + tazpkg search-file "$SEARCH" | list_files > \ + /tmp/tazpkgbox/search-installed + tazpkg search-file "$SEARCH" --files | list_files > \ + /tmp/tazpkgbox/search-mirrored + exit 0 +fi + # Search installed. for i in `ls /var/lib/tazpkg/installed` do diff -r 404417fa9f93 -r d72efc8ec019 tazpkgbox --- a/tazpkgbox Thu May 22 19:08:09 2008 +0000 +++ b/tazpkgbox Thu May 22 20:20:24 2008 +0000 @@ -187,7 +187,7 @@ 580120 RESULT_INSTALLED - + cat /tmp/tazpkgbox/search-installed echo "$RESULT_INSTALLED" > /tmp/tazpkgbox/pkg /usr/lib/slitaz/tazpkgbox/package_infos @@ -200,7 +200,7 @@ 580120 RESULT_MIRROR - + cat /tmp/tazpkgbox/search-mirrored echo "$RESULT_MIRROR" > /tmp/tazpkgbox/pkg /usr/lib/slitaz/tazpkgbox/package_infos @@ -215,12 +215,19 @@ SEARCH +