wok-current diff tazpkg/stuff/checkspace-module.patch @ rev 25685

Add checkspace / fetchall feature for tazpkg
author Stanislas Leduc <shann@slitaz.org>
date Thu Mar 14 20:28:39 2024 +0000 (18 months ago)
parents
children ece35c6e0e49
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tazpkg/stuff/checkspace-module.patch	Thu Mar 14 20:28:39 2024 +0000
     1.3 @@ -0,0 +1,31 @@
     1.4 +--- a/modules/upgrade
     1.5 ++++ b/modules/upgrade
     1.6 +@@ -16,6 +16,9 @@
     1.7 + # Get TazPkg working environment
     1.8 + . @@MODULES@@/getenv
     1.9 +
    1.10 ++# Get TazPkg checkspace module
    1.11 ++. @@MODULES@@/checkspace
    1.12 ++
    1.13 + time="$(date +%s)"
    1.14 +
    1.15 + # Recharge packages databases (if necessary) (respects already exported "root" value)
    1.16 +@@ -114,6 +122,7 @@
    1.17 + 	install="n"
    1.18 + 	_ 'System is up-to-date...'
    1.19 + else
    1.20 ++	spaceneed=$(check_space)
    1.21 + 	blocked_count=$(wc -m < "$blocked_counter")
    1.22 +
    1.23 + 	blocked=$(_p \
    1.24 +@@ -131,6 +139,10 @@
    1.25 + 	'%s installed packages scanned in %ds' "$pkgs" \
    1.26 + 	"<c 32>$pkgs</c>" "$time")"
    1.27 +
    1.28 ++emsg "$(_p \
    1.29 ++       'You need %s free space' \
    1.30 ++       'You need %s free space' "$spaceneed" \
    1.31 ++       "<c 32>$spaceneed</c>")"
    1.32 +
    1.33 + # Clean
    1.34 + rm "$blocked_counter" "$tmp_up_list"