tazpkg rev 711
tazpkg: 'desc' shows description or short description.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Mon Dec 15 04:00:54 2014 +0200 (2014-12-15) |
parents | 58f001f8e2bc |
children | 68b77b7f356c |
files | tazpkg |
line diff
1.1 --- a/tazpkg Mon Dec 15 03:27:27 2014 +0200 1.2 +++ b/tazpkg Mon Dec 15 04:00:54 2014 +0200 1.3 @@ -1487,15 +1487,18 @@ 1.4 1.5 desc) 1.6 # Display package description.txt if available. 1.7 - if [ -f "$INSTALLED/$PACKAGE/description.txt" ]; then 1.8 + if [ -n "$(grep -e "^$PACKAGE " $PKGS_DB/installed.info)" ]; then 1.9 title 'Description of package "%s"' $PACKAGE 1.10 - cat $INSTALLED/$PACKAGE/description.txt 1.11 + if [ -f "$INSTALLED/$PACKAGE/description.txt" ]; then 1.12 + cat $INSTALLED/$PACKAGE/description.txt 1.13 + else 1.14 + awk -F$'\t' '{if ($1 == "'$PACKAGE'") print $4}' $PKGS_DB/installed.info 1.15 + fi 1.16 footer 1.17 else 1.18 - newline 1.19 - _ 'Sorry, no description available for this package.' 1.20 - newline 1.21 - fi ;; 1.22 + _ 'Package "%s" is not installed.' "$PACKAGE" 1.23 + fi 1.24 + ;; 1.25 1.26 1.27 activity|log|-a)