dependencies: Trisquel 10: Fix script for non-english locales.

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 5050b5365e
("dependencies: trisquel-10: workaround package not found if already
installed.").

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2024-09-23 16:43:06 +02:00 committed by Adrien 'neox' Bourmault
parent ed32c282fb
commit 94118b896a
Signed by: neox
GPG Key ID: 57BC26A3687116F6
1 changed files with 6 additions and 1 deletions

View File

@ -30,8 +30,13 @@ install_packages()
{ {
to_install="" 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 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 continue
else else
to_install="${to_install} ${package}" to_install="${to_install} ${package}"