wok-current rev 25686
Rework tazpkg getall/checkspace feature
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Fri Mar 15 07:15:01 2024 +0000 (9 months ago) |
parents | 3c2b1b2d0d59 |
children | c7d4cd0674c4 |
files | tazpkg/receipt tazpkg/stuff/checkspace tazpkg/stuff/checkspace-module.patch tazpkg/stuff/getall tazpkg/stuff/getall-module.patch tazpkg/stuff/translation-fetchall.patch tazpkg/stuff/upgrade-fetch-all.patch |
line diff
1.1 --- a/tazpkg/receipt Thu Mar 14 20:28:39 2024 +0000 1.2 +++ b/tazpkg/receipt Fri Mar 15 07:15:01 2024 +0000 1.3 @@ -46,11 +46,10 @@ 1.4 # Patch for upgrade core system package first 1.5 patch -p1 < $stuff/upgrade-core-pkg.patch 1.6 1.7 - # Add fetchall, checkspace feature 1.8 - cp -a $stuff/checkspace modules/ 1.9 + # Add getall, checkspace feature 1.10 + cp -a $stuff/checkspace $stuff/getall modules/ 1.11 patch -p1 < $stuff/checkspace-module.patch 1.12 - patch -p1 < $stuff/upgrade-fetch-all.patch 1.13 - patch -p1 < $stuff/translation-fetchall.patch 1.14 + patch -p1 < $stuff/getall-module.patch 1.15 rm modules/upgrade.orig 1.16 1.17 sed -i 's|\. receipt|. ./receipt|' */*
2.1 --- a/tazpkg/stuff/checkspace Thu Mar 14 20:28:39 2024 +0000 2.2 +++ b/tazpkg/stuff/checkspace Fri Mar 15 07:15:01 2024 +0000 2.3 @@ -1,6 +1,5 @@ 2.4 #!/bin/sh 2.5 2.6 -export LC_ALL=C 2.7 size=0 2.8 result=0 2.9 unit="Mo" 2.10 @@ -44,5 +43,5 @@ 2.11 unit="Go" 2.12 fi 2.13 2.14 -echo "$(printf '%0.2f' $result) $unit" 2.15 +echo "$(LC_ALL=C printf '%0.2f' $result) $unit" 2.16 }
3.1 --- a/tazpkg/stuff/checkspace-module.patch Thu Mar 14 20:28:39 2024 +0000 3.2 +++ b/tazpkg/stuff/checkspace-module.patch Fri Mar 15 07:15:01 2024 +0000 3.3 @@ -23,9 +23,35 @@ 3.4 "<c 32>$pkgs</c>" "$time")" 3.5 3.6 +emsg "$(_p \ 3.7 -+ 'You need %s free space' \ 3.8 -+ 'You need %s free space' "$spaceneed" \ 3.9 ++ 'You need %s free space.' \ 3.10 ++ 'You need %s free space.' "$spaceneed" \ 3.11 + "<c 32>$spaceneed</c>")" 3.12 3.13 # Clean 3.14 rm "$blocked_counter" "$tmp_up_list" 3.15 +--- a/po/fr.po 3.16 ++++ b/po/fr.po 3.17 +@@ -1329,6 +1329,10 @@ 3.18 + msgid "Do you wish to install them now? (y/N)" 3.19 + msgstr "Voulez-vous les installer maintenant ? (o/N)" 3.20 + 3.21 ++#: modules/upgrade:147 3.22 ++msgid "You need %s free space." 3.23 ++msgstr "Vous avez besoin de %s d'espace libre." 3.24 ++ 3.25 + #: modules/upgrade:157 3.26 + msgid "Leaving without any upgrades installed." 3.27 + msgstr "Sortie sans avoir installé de mise à jour." 3.28 +--- a/po/tazpkg.pot 3.29 ++++ b/po/tazpkg.pot 3.30 +@@ -1314,6 +1314,10 @@ 3.31 + msgid "Do you wish to install them now? (y/N)" 3.32 + msgstr "" 3.33 + 3.34 ++#: modules/upgrade:147 3.35 ++msgid "You need %s free space." 3.36 ++msgstr "" 3.37 ++ 3.38 + #: modules/upgrade:157 3.39 + msgid "Leaving without any upgrades installed." 3.40 + msgstr ""
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/tazpkg/stuff/getall Fri Mar 15 07:15:01 2024 +0000 4.3 @@ -0,0 +1,19 @@ 4.4 +#!/bin/sh 4.5 + 4.6 +# Fetch all pkgs upgrade 4.7 +fetchall_pkgs() 4.8 +{ 4.9 +cd $SAVE_CACHE_DIR/$SLITAZ_RELEASE/packages 4.10 +for pkg in $(cat "$UP_LIST"); do 4.11 + lpkg=${1//-/\-} 4.12 + # Get depends of package 4.13 + deps=$(grep "^${pkg//-\-}$(printf '\t')" /var/lib/tazpkg/packages.info | awk -F "\t" '{print $8}') 4.14 + for dep in $deps; do 4.15 + if [ ! -d /var/lib/tazpkg/installed/$dep ]; then 4.16 + tazpkg get $dep 4.17 + fi 4.18 + done 4.19 + tazpkg get $pkg 4.20 +done 4.21 +cd - > /dev/null 4.22 +}
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 5.2 +++ b/tazpkg/stuff/getall-module.patch Fri Mar 15 07:15:01 2024 +0000 5.3 @@ -0,0 +1,50 @@ 5.4 +--- a/modules/upgrade 5.5 ++++ b/modules/upgrade 5.6 +@@ -16,6 +16,9 @@ 5.7 + # Get TazPkg working environment 5.8 + . @@MODULES@@/getenv 5.9 + 5.10 ++# Get TazPkg getall module 5.11 ++. @@MODULES@@/getall 5.12 ++ 5.13 + time="$(date +%s)" 5.14 + 5.15 + # Recharge packages databases (if necessary) (respects already exported "root" value) 5.16 +--- a/modules/upgrade 5.17 ++++ b/modules/upgrade 5.18 +@@ -147,6 +147,9 @@ 5.19 + fi 5.20 + case "$answer" in 5.21 + 0) 5.22 ++ # Fetch all pkgs upgrade 5.23 ++ _ 'Fetch all updates :' 5.24 ++ fetchall_pkgs 5.25 + for pkg in $(cat "$UP_LIST"); do 5.26 + echo 'y' | tazpkg -gi "$pkg" --forced #--reason="upgrade" 5.27 + done 5.28 +--- a/po/fr.po 5.29 ++++ b/po/fr.po 5.30 +@@ -1329,6 +1329,10 @@ 5.31 + msgid "Do you wish to install them now? (y/N)" 5.32 + msgstr "Voulez-vous les installer maintenant ? (o/N)" 5.33 + 5.34 ++#: modules/upgrade:151 5.35 ++msgid "Fetch all updates :" 5.36 ++msgstr "Téléchargment des mises à jour :" 5.37 ++ 5.38 + #: modules/upgrade:157 5.39 + msgid "Leaving without any upgrades installed." 5.40 + msgstr "Sortie sans avoir installé de mise à jour." 5.41 +--- a/po/tazpkg.pot 5.42 ++++ b/po/tazpkg.pot 5.43 +@@ -1314,6 +1314,10 @@ 5.44 + msgid "Do you wish to install them now? (y/N)" 5.45 + msgstr "" 5.46 + 5.47 ++#: modules/upgrade:151 5.48 ++msgid "Fetch all updates :" 5.49 ++msgstr "" 5.50 ++ 5.51 + #: modules/upgrade:157 5.52 + msgid "Leaving without any upgrades installed." 5.53 + msgstr ""
6.1 --- a/tazpkg/stuff/translation-fetchall.patch Thu Mar 14 20:28:39 2024 +0000 6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 6.3 @@ -1,26 +0,0 @@ 6.4 ---- a/po/fr.po 6.5 -+++ b/po/fr.po 6.6 -@@ -1329,6 +1329,10 @@ 6.7 - msgid "Do you wish to install them now? (y/N)" 6.8 - msgstr "Voulez-vous les installer maintenant ? (o/N)" 6.9 - 6.10 -+#: modules/upgrade:151 6.11 -+msgid "Fetch all updates..." 6.12 -+msgstr "Téléchargment des mises à jour..." 6.13 -+ 6.14 - #: modules/upgrade:157 6.15 - msgid "Leaving without any upgrades installed." 6.16 - msgstr "Sortie sans avoir installé de mise à jour." 6.17 ---- a/po/tazpkg.pot 6.18 -+++ b/po/tazpkg.pot 6.19 -@@ -1314,6 +1314,10 @@ 6.20 - msgid "Do you wish to install them now? (y/N)" 6.21 - msgstr "" 6.22 - 6.23 -+#: modules/upgrade:151 6.24 -+msgid "Fetch all updates..." 6.25 -+msgstr "" 6.26 -+ 6.27 - #: modules/upgrade:157 6.28 - msgid "Leaving without any upgrades installed." 6.29 - msgstr ""
7.1 --- a/tazpkg/stuff/upgrade-fetch-all.patch Thu Mar 14 20:28:39 2024 +0000 7.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 7.3 @@ -1,16 +0,0 @@ 7.4 ---- a/modules/upgrade 7.5 -+++ b/modules/upgrade 7.6 -@@ -147,6 +147,13 @@ 7.7 - fi 7.8 - case "$answer" in 7.9 - 0) 7.10 -+ # Fetch all pkgs upgrade 7.11 -+ _ 'Fetch all updates...' 7.12 -+ cd $SAVE_CACHE_DIR/$SLITAZ_RELEASE/packages 7.13 -+ for pkg in $(cat "$UP_LIST"); do 7.14 -+ tazpkg get $pkg 7.15 -+ done 7.16 -+ cd - > /dev/null 7.17 - for pkg in $(cat "$UP_LIST"); do 7.18 - echo 'y' | tazpkg -gi "$pkg" --forced #--reason="upgrade" 7.19 - done