# HG changeset patch # User Stanislas Leduc # Date 1710486901 0 # Node ID ece35c6e0e494b3a147b566e9e8b086882870203 # Parent 3c2b1b2d0d5912464d6b39802a7839519d8415f4 Rework tazpkg getall/checkspace feature diff -r 3c2b1b2d0d59 -r ece35c6e0e49 tazpkg/receipt --- a/tazpkg/receipt Thu Mar 14 20:28:39 2024 +0000 +++ b/tazpkg/receipt Fri Mar 15 07:15:01 2024 +0000 @@ -46,11 +46,10 @@ # Patch for upgrade core system package first patch -p1 < $stuff/upgrade-core-pkg.patch - # Add fetchall, checkspace feature - cp -a $stuff/checkspace modules/ + # Add getall, checkspace feature + cp -a $stuff/checkspace $stuff/getall modules/ patch -p1 < $stuff/checkspace-module.patch - patch -p1 < $stuff/upgrade-fetch-all.patch - patch -p1 < $stuff/translation-fetchall.patch + patch -p1 < $stuff/getall-module.patch rm modules/upgrade.orig sed -i 's|\. receipt|. ./receipt|' */* diff -r 3c2b1b2d0d59 -r ece35c6e0e49 tazpkg/stuff/checkspace --- a/tazpkg/stuff/checkspace Thu Mar 14 20:28:39 2024 +0000 +++ b/tazpkg/stuff/checkspace Fri Mar 15 07:15:01 2024 +0000 @@ -1,6 +1,5 @@ #!/bin/sh -export LC_ALL=C size=0 result=0 unit="Mo" @@ -44,5 +43,5 @@ unit="Go" fi -echo "$(printf '%0.2f' $result) $unit" +echo "$(LC_ALL=C printf '%0.2f' $result) $unit" } diff -r 3c2b1b2d0d59 -r ece35c6e0e49 tazpkg/stuff/checkspace-module.patch --- a/tazpkg/stuff/checkspace-module.patch Thu Mar 14 20:28:39 2024 +0000 +++ b/tazpkg/stuff/checkspace-module.patch Fri Mar 15 07:15:01 2024 +0000 @@ -23,9 +23,35 @@ "$pkgs" "$time")" +emsg "$(_p \ -+ 'You need %s free space' \ -+ 'You need %s free space' "$spaceneed" \ ++ 'You need %s free space.' \ ++ 'You need %s free space.' "$spaceneed" \ + "$spaceneed")" # Clean rm "$blocked_counter" "$tmp_up_list" +--- a/po/fr.po ++++ b/po/fr.po +@@ -1329,6 +1329,10 @@ + msgid "Do you wish to install them now? (y/N)" + msgstr "Voulez-vous les installer maintenant ? (o/N)" + ++#: modules/upgrade:147 ++msgid "You need %s free space." ++msgstr "Vous avez besoin de %s d'espace libre." ++ + #: modules/upgrade:157 + msgid "Leaving without any upgrades installed." + msgstr "Sortie sans avoir installé de mise à jour." +--- a/po/tazpkg.pot ++++ b/po/tazpkg.pot +@@ -1314,6 +1314,10 @@ + msgid "Do you wish to install them now? (y/N)" + msgstr "" + ++#: modules/upgrade:147 ++msgid "You need %s free space." ++msgstr "" ++ + #: modules/upgrade:157 + msgid "Leaving without any upgrades installed." + msgstr "" diff -r 3c2b1b2d0d59 -r ece35c6e0e49 tazpkg/stuff/getall --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazpkg/stuff/getall Fri Mar 15 07:15:01 2024 +0000 @@ -0,0 +1,19 @@ +#!/bin/sh + +# Fetch all pkgs upgrade +fetchall_pkgs() +{ +cd $SAVE_CACHE_DIR/$SLITAZ_RELEASE/packages +for pkg in $(cat "$UP_LIST"); do + lpkg=${1//-/\-} + # Get depends of package + deps=$(grep "^${pkg//-\-}$(printf '\t')" /var/lib/tazpkg/packages.info | awk -F "\t" '{print $8}') + for dep in $deps; do + if [ ! -d /var/lib/tazpkg/installed/$dep ]; then + tazpkg get $dep + fi + done + tazpkg get $pkg +done +cd - > /dev/null +} diff -r 3c2b1b2d0d59 -r ece35c6e0e49 tazpkg/stuff/getall-module.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazpkg/stuff/getall-module.patch Fri Mar 15 07:15:01 2024 +0000 @@ -0,0 +1,50 @@ +--- a/modules/upgrade ++++ b/modules/upgrade +@@ -16,6 +16,9 @@ + # Get TazPkg working environment + . @@MODULES@@/getenv + ++# Get TazPkg getall module ++. @@MODULES@@/getall ++ + time="$(date +%s)" + + # Recharge packages databases (if necessary) (respects already exported "root" value) +--- a/modules/upgrade ++++ b/modules/upgrade +@@ -147,6 +147,9 @@ + fi + case "$answer" in + 0) ++ # Fetch all pkgs upgrade ++ _ 'Fetch all updates :' ++ fetchall_pkgs + for pkg in $(cat "$UP_LIST"); do + echo 'y' | tazpkg -gi "$pkg" --forced #--reason="upgrade" + done +--- a/po/fr.po ++++ b/po/fr.po +@@ -1329,6 +1329,10 @@ + msgid "Do you wish to install them now? (y/N)" + msgstr "Voulez-vous les installer maintenant ? (o/N)" + ++#: modules/upgrade:151 ++msgid "Fetch all updates :" ++msgstr "Téléchargment des mises à jour :" ++ + #: modules/upgrade:157 + msgid "Leaving without any upgrades installed." + msgstr "Sortie sans avoir installé de mise à jour." +--- a/po/tazpkg.pot ++++ b/po/tazpkg.pot +@@ -1314,6 +1314,10 @@ + msgid "Do you wish to install them now? (y/N)" + msgstr "" + ++#: modules/upgrade:151 ++msgid "Fetch all updates :" ++msgstr "" ++ + #: modules/upgrade:157 + msgid "Leaving without any upgrades installed." + msgstr "" diff -r 3c2b1b2d0d59 -r ece35c6e0e49 tazpkg/stuff/translation-fetchall.patch --- a/tazpkg/stuff/translation-fetchall.patch Thu Mar 14 20:28:39 2024 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ ---- a/po/fr.po -+++ b/po/fr.po -@@ -1329,6 +1329,10 @@ - msgid "Do you wish to install them now? (y/N)" - msgstr "Voulez-vous les installer maintenant ? (o/N)" - -+#: modules/upgrade:151 -+msgid "Fetch all updates..." -+msgstr "Téléchargment des mises à jour..." -+ - #: modules/upgrade:157 - msgid "Leaving without any upgrades installed." - msgstr "Sortie sans avoir installé de mise à jour." ---- a/po/tazpkg.pot -+++ b/po/tazpkg.pot -@@ -1314,6 +1314,10 @@ - msgid "Do you wish to install them now? (y/N)" - msgstr "" - -+#: modules/upgrade:151 -+msgid "Fetch all updates..." -+msgstr "" -+ - #: modules/upgrade:157 - msgid "Leaving without any upgrades installed." - msgstr "" diff -r 3c2b1b2d0d59 -r ece35c6e0e49 tazpkg/stuff/upgrade-fetch-all.patch --- a/tazpkg/stuff/upgrade-fetch-all.patch Thu Mar 14 20:28:39 2024 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ ---- a/modules/upgrade -+++ b/modules/upgrade -@@ -147,6 +147,13 @@ - fi - case "$answer" in - 0) -+ # Fetch all pkgs upgrade -+ _ 'Fetch all updates...' -+ cd $SAVE_CACHE_DIR/$SLITAZ_RELEASE/packages -+ for pkg in $(cat "$UP_LIST"); do -+ tazpkg get $pkg -+ done -+ cd - > /dev/null - for pkg in $(cat "$UP_LIST"); do - echo 'y' | tazpkg -gi "$pkg" --forced #--reason="upgrade" - done