tazpkg annotate modules/cache @ rev 855

cache: fix working; install: install official conf.files if destination is absent; tazpkg-notify: change icons
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon Nov 09 04:54:02 2015 +0200 (2015-11-09)
parents d6cbd0c5f273
children af67b2269d1f
rev   line source
al@844 1 #!/bin/sh
al@844 2 # TazPkg - Tiny autonomous zone packages manager, hg.slitaz.org/tazpkg
al@844 3 # cache - TazPkg module
al@844 4 # Work with package cache
al@844 5
al@844 6
al@844 7 # Connect function libraries
al@844 8 . /lib/libtaz.sh
al@844 9
al@844 10 # Get TazPkg working environment
al@844 11 . @@MODULES@@/getenv
al@844 12
al@844 13
al@844 14
al@844 15
al@844 16 case $1 in
al@844 17 clean)
al@855 18 num=$(find "$CACHE_DIR" -name '*.tazpkg' | wc -l)
al@844 19 size=$(du -hs "$CACHE_DIR" | cut -f1 | sed 's|\.0||')
al@844 20 [ "$num" -eq 0 ] && size="0K"
al@844 21
al@844 22 title 'Cleaning cache directory...'
al@844 23 action 'Path: %s' "$CACHE_DIR"
al@844 24 find "$CACHE_DIR" -name '*.tazpkg' -delete
al@844 25 status
al@844 26
al@844 27 footer "$(_p \
al@844 28 '%s file removed from cache (%s).' \
al@844 29 '%s files removed from cache (%s).' "$num" \
al@844 30 "$(colorize 32 "$num")" "$size")"
al@844 31 ;;
al@855 32 esac