gnuboot-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1 13/15] dependencies: Trisquel 10: Fix script for non-english l


From: Denis 'GNUtoo' Carikli
Subject: [PATCH v1 13/15] dependencies: Trisquel 10: Fix script for non-english locales.
Date: Mon, 23 Sep 2024 16:43:06 +0200

In French 'Installed' is 'Installé', and so when French is being used,
the grep that is used to understand if a package is already installed
fails.

This was broken by the commit 5050b5365e02069f1f6421177a9dcc532b299b75
("dependencies: trisquel-10: workaround package not found if already
installed.").

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
---
 resources/dependencies/trisquel-10 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/resources/dependencies/trisquel-10 
b/resources/dependencies/trisquel-10
index bf2de53..1083110 100755
--- a/resources/dependencies/trisquel-10
+++ b/resources/dependencies/trisquel-10
@@ -30,8 +30,13 @@ install_packages()
 {
     to_install=""
 
+    # Users might run Trisquel in various languages, and it is easier to
+    # grep for 'Installed' in the language being used than properly setup
+    # everything to use the right locale for the given situation.
+    installed="$(pkcon resolve packagekit-tools | tail -n1 | awk {print $1})"
+
     for package in $@ ; do
-        if pkcon resolve ${package} | grep '^Installed' 2>&1>/dev/null ; then
+        if pkcon resolve ${package} | grep "^${installed}" 2>&1>/dev/null ; 
then
             continue
         else
             to_install="${to_install} ${package}"
-- 
2.46.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]