spk diff spk-find @ rev 158
Translate to Russian.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Mon Dec 01 03:25:44 2014 +0200 (2014-12-01) |
parents | b70363c4c5e2 |
children |
line diff
1.1 --- a/spk-find Sun Mar 30 18:34:55 2014 +0200 1.2 +++ b/spk-find Mon Dec 01 03:25:44 2014 +0200 1.3 @@ -15,8 +15,8 @@ 1.4 # 1.5 1.6 find="$1" 1.7 -count="/tmp/spk/count" 1.8 -mkdir -p $(dirname $count) 1.9 +cfile="/tmp/spk/count" 1.10 +mkdir -p $(dirname $cfile) 1.11 1.12 # 1.13 # Functions 1.14 @@ -27,7 +27,10 @@ 1.15 name=$(basename $0) 1.16 cat << EOT 1.17 1.18 -$(boldify $(gettext "Usage:")) $name [package] 1.19 +$(boldify $(gettext "Usage:")) $name [package|--options] 1.20 + 1.21 +$(boldify $(gettext "Options:")) 1.22 + --short $(gettext "Short packages list format") 1.23 1.24 EOT 1.25 exit 0 1.26 @@ -41,22 +44,32 @@ 1.27 boldify $(gettext "Spk find: $find") 1.28 separator 1.29 1.30 -IFS="|" 1.31 -grep "$find" $pkgsdesc | while read pkg vers desc null 1.32 -do 1.33 - echo "$pkg" >> $count 1.34 - echo -n "$pkg"; indent 16 "$desc" 1.35 -done 1.36 -unset IFS 1.37 +# --files or packages 1.38 +if [ "$files" ]; then 1.39 + type="Files" 1.40 + echo "TODO" 1.41 +else 1.42 + type="Packages" 1.43 + IFS="|" 1.44 + grep "$find" $pkgsdesc | while read pkg vers desc null 1.45 + do 1.46 + echo "$pkg" >> ${cfile} 1.47 + echo "$(colorize 34 $pkg)${vers# }" 1.48 + [ "$short" ] || echo " $desc" 1.49 + done 1.50 + unset IFS 1.51 +fi 1.52 1.53 -if [ -f "$count" ]; then 1.54 - count=$(cat $count | wc -l) 1.55 +# Sep and stats 1.56 +if [ -f "$cfile" ]; then 1.57 + count=$(cat $cfile | wc -l) 1.58 color=32 1.59 else 1.60 count=0 1.61 color=31 1.62 fi 1.63 separator 1.64 -boldify "Packages found: $(colorize $color $count)" && newline 1.65 -rm -rf $count 1.66 +boldify "$type found: $(colorize $color $count)" && newline 1.67 + 1.68 +rm -rf ${cfile} 1.69 exit 0