spk rev 137

spk-find: fix count
author Christophe Lincoln <pankso@slitaz.org>
date Sun Mar 30 18:34:55 2014 +0200 (2014-03-30)
parents aded92d8f7bf
children 2024b7748587
files spk-find
line diff
     1.1 --- a/spk-find	Sat Mar 29 11:04:11 2014 +0000
     1.2 +++ b/spk-find	Sun Mar 30 18:34:55 2014 +0200
     1.3 @@ -40,6 +40,7 @@
     1.4  newline
     1.5  boldify $(gettext "Spk find: $find")
     1.6  separator
     1.7 +
     1.8  IFS="|"
     1.9  grep "$find" $pkgsdesc | while read pkg vers desc null
    1.10  do
    1.11 @@ -47,7 +48,15 @@
    1.12  	echo -n "$pkg"; indent 16 "$desc"
    1.13  done
    1.14  unset IFS
    1.15 +
    1.16 +if [ -f "$count" ]; then
    1.17 +	count=$(cat $count | wc -l)
    1.18 +	color=32
    1.19 +else
    1.20 +	count=0
    1.21 +	color=31
    1.22 +fi
    1.23  separator
    1.24 -boldify "Packages found: $(cat $count | wc -l)" && newline
    1.25 +boldify "Packages found: $(colorize $color $count)" && newline
    1.26  rm -rf $count
    1.27  exit 0