From 94118b896a5d44914cfdbf065abc04699e5d5885 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Mon, 23 Sep 2024 16:43:06 +0200 Subject: [PATCH] dependencies: Trisquel 10: Fix script for non-english locales. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Acked-by: Adrien 'neox' Bourmault --- 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}"