tazpkg diff modules/cache @ rev 955
modules/search: allow search file with dash at start: tazpkg -sf "-spi"
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Dec 22 00:02:54 2017 +0200 (2017-12-22) |
parents | 21ac83abe572 |
children |
line diff
1.1 --- a/modules/cache Mon Nov 09 04:54:02 2015 +0200 1.2 +++ b/modules/cache Fri Dec 22 00:02:54 2017 +0200 1.3 @@ -13,12 +13,12 @@ 1.4 1.5 1.6 1.7 +num=$(find "$CACHE_DIR" -name '*.tazpkg' | wc -l) 1.8 +size=$(du -hs "$CACHE_DIR" | cut -f1 | sed 's|\.0||') 1.9 +[ "$num" -eq 0 ] && size="0K" 1.10 + 1.11 case $1 in 1.12 clean) 1.13 - num=$(find "$CACHE_DIR" -name '*.tazpkg' | wc -l) 1.14 - size=$(du -hs "$CACHE_DIR" | cut -f1 | sed 's|\.0||') 1.15 - [ "$num" -eq 0 ] && size="0K" 1.16 - 1.17 title 'Cleaning cache directory...' 1.18 action 'Path: %s' "$CACHE_DIR" 1.19 find "$CACHE_DIR" -name '*.tazpkg' -delete 1.20 @@ -29,4 +29,15 @@ 1.21 '%s files removed from cache (%s).' "$num" \ 1.22 "$(colorize 32 "$num")" "$size")" 1.23 ;; 1.24 + 1.25 + list) 1.26 + title 'Packages cache' 1.27 + find "$CACHE_DIR" -name '*.tazpkg' -exec busybox ls -lh \{\} \; | \ 1.28 + awk '{printf "%s (%s)\n", $9, $5}' 1.29 + footer "$(_p \ 1.30 + '%s file (%s)' \ 1.31 + '%s files (%s)' "$num" \ 1.32 + "$(colorize 32 "$num")" "$size")" 1.33 + ;; 1.34 + 1.35 esac