SliTaz SliTaz Forum

You are not logged in.

#1 2019-03-25 05:28:50

Darjeeling
Member
Registered: 2012-02-06
Posts: 210

Removing locale packages ...

... can cause problems because they all change the currently configured locale, regardless whether or not this is the locale that has been removed. I've just checked some packages and it looks like they all have this in their receipts ...

[c]
# Back to C if it's the last used locale.
post_remove()
{
    echo -e "LANG=C\nLC_ALL=C" > /etc/locale.conf
}
[/c]

Offline

#2 2019-03-25 18:00:16

Darjeeling
Member
Registered: 2012-02-06
Posts: 210

Re: Removing locale packages ...

I think post_remove() in the receipt of the locale packages should look like this ...

[c]
# Back to C if this is the currently used locale.
post_remove()
{
    if grep -Fq "xx_" /etc/locale.conf; then
        echo -e "LANG=C\nLC_ALL=C" > /etc/locale.conf
    fi
}
[/c]
... where "xx_" stands for the language part of the locale string, e.g. "de_", "es_", "fr_", "pt_", "ru_" etc.

Any opinions?

Offline

#3 2019-03-26 12:36:10

Darjeeling
Member
Registered: 2012-02-06
Posts: 210

Re: Removing locale packages ...

Thanks Pascal ... and your solution is much more elegant :-)

Offline

#4 2019-04-03 19:37:23

Darjeeling
Member
Registered: 2012-02-06
Posts: 210

Re: Removing locale packages ...

There's still something wrong with this. Although locales are properly removed and the currently used locale is no longer changed by the removal (unless it is the one that has been removed), the post_remove() function now gives an error message ...

[c]
The following packages have been modified by package "locale-de":
  dialog
  kbd-base
  locale-en

Removing package "locale-de"
================================================================================
Removing all files installed...                                      [ Done ]
Execute post-remove commands...                                      [ Failed ]
Removing package receipt...                                          [ Done ]
================================================================================
Package "locale-de" (5.0) removed.

The following packages have been modified by package "locale-es":
  kbd-base
  locale-en

Removing package "locale-es"
================================================================================
Removing all files installed...                                      [ Done ]
Execute post-remove commands...                                      [ Failed ]
Removing package receipt...                                          [ Done ]
================================================================================
Package "locale-es" (5.0) removed.

The following packages have been modified by package "locale-it":
  dialog
  kbd-base
  locale-en

Removing package "locale-it"
================================================================================
Removing all files installed...                                      [ Done ]
Execute post-remove commands...                                      [ Failed ]
Removing package receipt...                                          [ Done ]
================================================================================
Package "locale-it" (5.0) removed.

The following packages have been modified by package "locale-ru":
  dialog
  kbd-base
  locale-en
  locale-pt_BR

Removing package "locale-ru"
================================================================================
Removing all files installed...                                      [ Done ]
Execute post-remove commands...                                      [ Failed ]
Removing package receipt...                                          [ Done ]
================================================================================
Package "locale-ru" (5.0) removed.

The following packages have been modified by package "locale-pt_BR":
  dialog
  kbd-base
  locale-en

Removing package "locale-pt_BR"
================================================================================
Removing all files installed...                                      [ Done ]
Execute post-remove commands...                                      [ Failed ]
Removing package receipt...                                          [ Done ]
================================================================================
Package "locale-pt_BR" (5.0) removed.
[/c]

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.018 seconds, 7 queries executed - Memory usage: 1.54 MiB (Peak: 1.77 MiB) ]