tazpkg annotate lib/tazpkgbox/search @ rev 135
Fix more typos
author | Mike D. Smith <MikeDSmith25@gmail.com> |
---|---|
date | Sun Jul 20 07:42:20 2008 +0000 (2008-07-20) |
parents | 37357de247a3 |
children | 6b1ec4c465a7 |
rev | line source |
---|---|
pankso@81 | 1 #!/bin/sh |
pankso@81 | 2 # |
MikeDSmith25@135 | 3 # This script provides a suitable output for the search results. |
pankso@81 | 4 # |
pankso@81 | 5 |
pankso@81 | 6 # Clean preview results. |
pankso@81 | 7 rm -f /tmp/tazpkgbox/search-installed |
pankso@81 | 8 touch /tmp/tazpkgbox/search-installed |
pankso@81 | 9 |
pascal@100 | 10 list_files() |
pascal@100 | 11 { |
pascal@100 | 12 sed 's/.\[[01]m//g' | awk 'BEGIN { show=0 } { |
pascal@100 | 13 if (/^===/) show=1-show; |
pascal@100 | 14 else if (/^Package/) pkg=$2; |
pascal@100 | 15 else if ($0 != "" && show != 0) printf("%s||%s\n",pkg,$0); |
pascal@100 | 16 }' |
pascal@100 | 17 } |
pascal@100 | 18 |
pascal@100 | 19 if [ "$1" = "--files" ]; then |
pascal@100 | 20 tazpkg search-file "$SEARCH" | list_files > \ |
pascal@100 | 21 /tmp/tazpkgbox/search-installed |
pascal@101 | 22 tazpkg search-file "$SEARCH" --mirror | list_files > \ |
pascal@100 | 23 /tmp/tazpkgbox/search-mirrored |
pascal@100 | 24 exit 0 |
pascal@100 | 25 fi |
pascal@100 | 26 |
pankso@81 | 27 # Search installed. |
pankso@81 | 28 for i in `ls /var/lib/tazpkg/installed` |
pankso@81 | 29 do |
pankso@81 | 30 . /var/lib/tazpkg/installed/$i/receipt |
pankso@81 | 31 if echo "$PACKAGE $SHORT_DESC" | grep -q "$SEARCH"; then |
pankso@81 | 32 echo "$PACKAGE|$VERSION|$SHORT_DESC" >> /tmp/tazpkgbox/search-installed |
pankso@81 | 33 fi |
pankso@81 | 34 done |
pankso@81 | 35 |
pankso@81 | 36 # Search mirrored. |
pankso@81 | 37 grep "$SEARCH" /var/lib/tazpkg/packages.desc > /tmp/tazpkgbox/search-mirrored |
pankso@81 | 38 |
pankso@81 | 39 exit 0 |