~mil/mepo-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH mepo] fix user_pin_updater on all locales

Details
Message ID
<20221029034426.110792-1-laalsaas@systemli.org>
DKIM signature
missing
Download raw message
Patch: +1 -1
The script mepo_ui_menu_user_pin_updater is using geoclue per default.
However, the where-am-i binary outputs the coordinates in a number
format which is locale-specific. i.e. if you've set
LC_NUMERIC="de_DE.UTF-8" , where-am-i will use the comma as the decimal
seperator instead of the point. This will lead to the following mepolang
statement produced by the script:

> pin_add 6 0 51,028178 13,710861 user_location;

Mepo can't deal with this and will silently ignore it. The fix is to set
the LC_NUMERIC variable to en_US for calling where-am-i.
---
 scripts/mepo_ui_menu_user_pin_updater.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/mepo_ui_menu_user_pin_updater.sh b/scripts/mepo_ui_menu_user_pin_updater.sh
index a6b13ab..2cb56b3 100755
--- a/scripts/mepo_ui_menu_user_pin_updater.sh
+++ b/scripts/mepo_ui_menu_user_pin_updater.sh
@@ -28,7 +28,7 @@ coordsviageoclue() {

  /usr/libexec/geoclue-2.0/demos/agent > /dev/null &
  AGENTPID=$!
  /usr/libexec/geoclue-2.0/demos/where-am-i -t $MEPO_TIMEOUT_GEOCLUE |
  LC_NUMERIC=en_US.UTF-8 /usr/libexec/geoclue-2.0/demos/where-am-i -t $MEPO_TIMEOUT_GEOCLUE |
    grep -E "Latitude|Longitude:" -m2 |
    cut -d: -f2 |
    tr -d "° " |
-- 
2.38.0
Details
Message ID
<fd8c7fdb-5c53-42b5-8080-9972f91d408a@app.fastmail.com>
In-Reply-To
<20221029034426.110792-1-laalsaas@systemli.org> (view parent)
DKIM signature
missing
Download raw message
On Fri, Oct 28, 2022, at 11:44 PM, laalsaas wrote:
> The script mepo_ui_menu_user_pin_updater is using geoclue per default.
> However, the where-am-i binary outputs the coordinates in a number
> format which is locale-specific. i.e. if you've set
> LC_NUMERIC="de_DE.UTF-8" , where-am-i will use the comma as the decimal
> seperator instead of the point. This will lead to the following mepolang
> statement produced by the script:
>
>> pin_add 6 0 51,028178 13,710861 user_location;
>
> Mepo can't deal with this and will silently ignore it. The fix is to set
> the LC_NUMERIC variable to en_US for calling where-am-i.
> ---
>  scripts/mepo_ui_menu_user_pin_updater.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/mepo_ui_menu_user_pin_updater.sh 
> b/scripts/mepo_ui_menu_user_pin_updater.sh
> index a6b13ab..2cb56b3 100755
> --- a/scripts/mepo_ui_menu_user_pin_updater.sh
> +++ b/scripts/mepo_ui_menu_user_pin_updater.sh
> @@ -28,7 +28,7 @@ coordsviageoclue() {
> 
>    /usr/libexec/geoclue-2.0/demos/agent > /dev/null &
>    AGENTPID=$!
> -  /usr/libexec/geoclue-2.0/demos/where-am-i -t $MEPO_TIMEOUT_GEOCLUE |
> +  LC_NUMERIC=en_US.UTF-8 /usr/libexec/geoclue-2.0/demos/where-am-i -t 
> $MEPO_TIMEOUT_GEOCLUE |
>      grep -E "Latitude|Longitude:" -m2 |
>      cut -d: -f2 |
>      tr -d "° " |
> -- 
> 2.38.0

Thanks, applied!
Reply to thread Export thread (mbox)