tazpkg diff modules/search @ rev 931
Add module/bb: manage Busybox applets.
Remove function definitions that are now in the /lib/libtaz.sh (die, im).
Remove function definitions that are now in the /lib/libtaz.sh (die, im).
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sun Jan 08 11:24:12 2017 +0200 (2017-01-08) |
parents | a02e36d44d06 |
children | 24c9c0777880 |
line diff
1.1 --- a/modules/search Fri Aug 28 16:10:34 2015 +0300 1.2 +++ b/modules/search Sun Jan 08 11:24:12 2017 +0200 1.3 @@ -13,19 +13,6 @@ 1.4 1.5 1.6 1.7 -# Translate category names (must be last in line) 1.8 - 1.9 -translate_category() { 1.10 - sed "s|base-system$|$(_ base-system)|; s|x-window$|$(_ x-window)|; 1.11 - s|utilities$|$(_ utilities)|; s|network$|$(_ network)|; 1.12 - s|graphics$|$(_ graphics)|; s|multimedia$|$(_ multimedia)|; 1.13 - s|office$|$(_ office)|; s|development$|$(_ development)|; 1.14 - s|system-tools$|$(_ system-tools)|; s|security$|$(_ security)|; 1.15 - s|games$|$(_ games)|; s|misc$|$(_ misc)|; s|meta$|$(_ meta)|; 1.16 - s|non-free$|$(_ non-free)|; s|all$|$(_ all)|; s|extra$|$(_ extra)|" 1.17 -} 1.18 - 1.19 - 1.20 # Search pattern in installed packages. 1.21 1.22 search_in_installed_packages() { 1.23 @@ -38,7 +25,7 @@ 1.24 index($1 "-" $2, pattern) { 1.25 printf "%-24s%-18s%s\n", $1, $2, $3; 1.26 printf "1" >> t 1.27 - }' "$PKGS_DB/installed.info" | translate_category 1.28 + }' "$PKGS_DB/installed.info" | tazpkg call translate_category 1.29 num=$(wc -m < "$TMPLIST"); rm "$TMPLIST" 1.30 1.31 footer "$(_p \ 1.32 @@ -61,7 +48,7 @@ 1.33 index($1 "-" $2, pattern) { 1.34 printf "%-24s%-18s%s\n", $1, $2, $3; 1.35 printf "1" >> t 1.36 - }' "$i" | translate_category 1.37 + }' "$i" | tazpkg call translate_category 1.38 done 1.39 1.40 for i in $PKGS_DB/extra.list $PKGS_DB/undigest/*/extra.list; do 1.41 @@ -70,7 +57,7 @@ 1.42 index($1 "-" $5, pattern) { 1.43 printf "%-24s%-18s%s\n", $1 " (extra)", $5, $4; 1.44 printf "1" >> t 1.45 - }' "$i" | translate_category 1.46 + }' "$i" | tazpkg call translate_category 1.47 done 1.48 1.49 if [ ! -f "$PKGS_DB/packages.info" ]; then 1.50 @@ -185,8 +172,9 @@ 1.51 1.52 # Check all pkg files.list in search match which specify the package 1.53 # name and the full path to the file(s). 1.54 - for pkg in $INSTALLED/*; do 1.55 - if grep -qs "$2" "$pkg/files.list"; then 1.56 + for pkg in $(awk -F$'\t' '{print $1}' $PKGS_DB/installed.info); do 1.57 + FL="$INSTALLED/$pkg/files.list" 1.58 + if grep -qs "$2" "$FL"; then 1.59 newline 1.60 emsg "<c 33>$(_ 'Package %s:' "$pkg")</c>" 1.61 awk -vtmp="$TMPLIST" -vfile="$2" -vcfile="$(colorize 32 $2)" ' 1.62 @@ -196,7 +184,7 @@ 1.63 print " "$0; 1.64 printf "1" >> tmp; 1.65 } 1.66 - ' "$pkg/files.list" 1.67 + ' "$FL" 1.68 fi 1.69 done 1.70