tazpkg rev 654
tazpkg: add command 'activity'
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sun Feb 16 13:53:53 2014 +0100 (2014-02-16) |
parents | cd04a2519d5b |
children | 7690c439778e |
files | tazpkg |
line diff
1.1 --- a/tazpkg Sun Feb 16 13:06:34 2014 +0100 1.2 +++ b/tazpkg Sun Feb 16 13:53:53 2014 +0100 1.3 @@ -109,53 +109,55 @@ 1.4 usage () { 1.5 cat << EOT 1.6 1.7 -$(eval_gettext 'SliTaz package manager - Version: $VERSION') 1.8 +$(eval_gettext 'SliTaz package manager - Version:') $(colorize 34 $VERSION) 1.9 1.10 $(boldify "$(gettext 'Usage:')") 1.11 $(gettext 'tazpkg [command] [package|dir|pattern|list|cat|--opt] [dir|--opt]') 1.12 + 1.13 $(boldify "$(gettext 'SHell:')") tazpkg shell 1.14 1.15 $(boldify "$(gettext 'Commands:')") 1.16 - usage $(gettext 'Print this short usage.') 1.17 - bugs $(gettext 'Show known bugs in packages.') 1.18 - list|-l $(gettext 'List installed packages on the system by category or all.') 1.19 - list-mirror|-lm $(gettext 'List all available packages on the mirror (--diff for new).') 1.20 - info $(gettext 'Print information about a package.') 1.21 - desc $(gettext 'Print description of a package (if it exists).') 1.22 - list-files|-lf $(gettext 'List the files installed with a package.') 1.23 - list-config $(gettext 'List the configuration files.') 1.24 - search|-s $(gettext 'Search for a package by pattern or name (options: -i|-l|-m).') 1.25 - search-pkgname $(gettext 'Search on mirror for package having a particular file.') 1.26 - search-file|-sf $(gettext 'Search for file(s) in all installed packages files.') 1.27 - install|-i $(gettext 'Install a local (*.tazpkg) package (--forced to force).') 1.28 + usage $(gettext 'Print this short usage') 1.29 + bugs $(gettext 'Show known bugs in packages') 1.30 + activity|-a $(gettext 'Show TazPKG activity log') 1.31 + list|-l $(gettext 'List installed packages on the system by category or all') 1.32 + list-mirror|-lm $(gettext 'List all available packages on the mirror (--diff for new)') 1.33 + info $(gettext 'Print information about a package') 1.34 + desc $(gettext 'Print description of a package (if it exists)') 1.35 + list-files|-lf $(gettext 'List the files installed with a package') 1.36 + list-config $(gettext 'List the configuration files') 1.37 + search|-s $(gettext 'Search for a package by pattern or name (options: -i|-l|-m)') 1.38 + search-pkgname $(gettext 'Search on mirror for package having a particular file') 1.39 + search-file|-sf $(gettext 'Search for file(s) in all installed packages files') 1.40 + install|-i $(gettext 'Install a local (*.tazpkg) package (--forced to force)') 1.41 install-list $(gettext 'Install all packages from a list of packages.') 1.42 - remove|-r $(gettext 'Remove the specified package and all installed files.') 1.43 - extract|-e $(gettext 'Extract a (*.tazpkg) package into a directory.') 1.44 - pack $(gettext 'Pack an unpacked or prepared package tree.') 1.45 - recharge $(gettext 'Recharge your packages.list from the mirror.') 1.46 - up|help-up $(eval_gettext 'Check packages $CHECKSUM to list and install latest upgrades.') 1.47 - repack $(gettext 'Create a package archive from an installed package.') 1.48 - repack-config $(gettext 'Create a package archive with configuration files.') 1.49 - recompress $(gettext 'Rebuild a package with a better compression ratio.') 1.50 - block|unblock $(gettext 'Block an installed package version or unblock it for upgrade.') 1.51 - get $(gettext 'Download a package into the current directory.') 1.52 - get-install|-gi $(gettext 'Download and install a package from the mirror.') 1.53 - get-install-list $(gettext 'Download and install a list of packages from the mirror.') 1.54 - check $(gettext 'Verify consistency of installed packages.') 1.55 - add-flavor $(gettext 'Install the flavor list of packages.') 1.56 - install-flavor $(gettext 'Install the flavor list of packages and remove other ones.') 1.57 - set-release $(gettext 'Change release and update packages.') 1.58 - clean-cache|-cc $(gettext 'Clean all packages downloaded in cache directory.') 1.59 - depends $(gettext 'Display dependencies tree.') 1.60 - rdepends $(gettext 'Display reverse dependencies tree.') 1.61 - convert $(gettext 'Convert deb/rpm/tgz/pet/sfs/sb/arch/ipk package to tazpkg).') 1.62 - link $(gettext 'Link a package from another slitaz installation.') 1.63 - setup-mirror|-sm $(gettext 'Change the mirror url configuration.') 1.64 - list-undigest $(gettext 'List undigest mirrors.') 1.65 - remove-undigest $(gettext 'Remove an undigest mirror.') 1.66 - add-undigest $(gettext 'Add an undigest mirror.') 1.67 - setup-undigest $(gettext 'Update an undigest mirror.') 1.68 - reconfigure $(gettext 'Replay post install script from package.') 1.69 + remove|-r $(gettext 'Remove the specified package and all installed files') 1.70 + extract|-e $(gettext 'Extract a (*.tazpkg) package into a directory') 1.71 + pack $(gettext 'Pack an unpacked or prepared package tree') 1.72 + recharge $(gettext 'Recharge your packages.list from the mirror') 1.73 + up|help-up $(eval_gettext 'Check packages $CHECKSUM to list and install latest upgrades') 1.74 + repack $(gettext 'Create a package archive from an installed package') 1.75 + repack-config $(gettext 'Create a package archive with configuration files') 1.76 + recompress $(gettext 'Rebuild a package with a better compression ratio') 1.77 + block|unblock $(gettext 'Block an installed package version or unblock it for upgrade') 1.78 + get $(gettext 'Download a package into the current directory') 1.79 + get-install|-gi $(gettext 'Download and install a package from the mirror') 1.80 + get-install-list $(gettext 'Download and install a list of packages from the mirror') 1.81 + check $(gettext 'Verify consistency of installed packages') 1.82 + add-flavor $(gettext 'Install the flavor list of packages') 1.83 + install-flavor $(gettext 'Install the flavor list of packages and remove other ones') 1.84 + set-release $(gettext 'Change release and update packages') 1.85 + clean-cache|-cc $(gettext 'Clean all packages downloaded in cache directory') 1.86 + depends $(gettext 'Display dependencies tree') 1.87 + rdepends $(gettext 'Display reverse dependencies tree') 1.88 + convert $(gettext 'Convert deb/rpm/tgz/pet/sfs/sb/arch/ipk package to tazpkg)') 1.89 + link $(gettext 'Link a package from another slitaz installation') 1.90 + setup-mirror|-sm $(gettext 'Change the mirror url configuration') 1.91 + list-undigest $(gettext 'List undigest mirrors') 1.92 + remove-undigest $(gettext 'Remove an undigest mirror') 1.93 + add-undigest $(gettext 'Add an undigest mirror') 1.94 + setup-undigest $(gettext 'Update an undigest mirror') 1.95 + reconfigure $(gettext 'Replay post install script from package') 1.96 1.97 EOT 1.98 } 1.99 @@ -1746,8 +1748,8 @@ 1.100 [ "$BUILD_DEPENDS" ] && emsg "<b>$(gettext 'Build deps :')</b> $BUILD_DEPENDS" 1.101 [ "$WANTED" ] && emsg "<b>$(gettext 'Wanted src :')</b> $WANTED" 1.102 [ "$WEB_SITE" ] && emsg "<b>$(gettext 'Web site :')</b> $WEB_SITE" 1.103 - footer 1.104 - ;; 1.105 + footer ;; 1.106 + 1.107 desc) 1.108 # Display package description.txt if available. 1.109 if [ -f "$INSTALLED/$PACKAGE/description.txt" ]; then 1.110 @@ -1759,6 +1761,26 @@ 1.111 gettext "Sorry, no description available for this package."; echo 1.112 newline 1.113 fi ;; 1.114 + 1.115 + activity|log|-a) 1.116 + # Show activity log 1.117 + [ "$nb" ] || nb=18 1.118 + title 'TazPKG Activity' 1.119 + IFS=" " 1.120 + tail -n ${nb} ${LOG} | while read date hour none action none pkg vers none 1.121 + do 1.122 + case "$action" in 1.123 + Installed) 1.124 + echo "$date $hour : $(colorize 32 $action) $pkg $vers" ;; 1.125 + Removed) 1.126 + echo "$date $hour : $(colorize 31 $action) $pkg $vers" ;; 1.127 + *) 1.128 + echo "$date $hour : $(boldify $action) $pkg $vers" ;; 1.129 + esac 1.130 + done 1.131 + unset IFS 1.132 + separator && newline ;; 1.133 + 1.134 search|-s) 1.135 # Search for a package by pattern or name. 1.136 PATTERN="$2" 1.137 @@ -1771,7 +1793,7 @@ 1.138 fi 1.139 title 'Search result for: $PATTERN' 1.140 # Default is to search in installed pkgs and the raw list. 1.141 - case $3 in 1.142 + case "$3" in 1.143 -i|--installed) 1.144 search_in_installed_packages ;; 1.145 -l|--list) 1.146 @@ -1782,6 +1804,7 @@ 1.147 search_in_installed_packages 1.148 search_in_packages_list ;; 1.149 esac ;; 1.150 + 1.151 search-file|-sf) 1.152 # Search for a file by pattern or name in all files.list. 1.153 if [ -z "$2" ]; then