Browse Source

[type/__update_alternatives] Fix for non-English locales

Since update-alternatives(1) is localized, screen scraping its output breaks
if the locale is set to non-English.
ander/os_version_debian_sid
Dennis Camera 2 years ago
parent
commit
bbcc81a984
  1. 4
      cdist/conf/type/__update_alternatives/explorer/alternatives
  2. 5
      cdist/conf/type/__update_alternatives/explorer/path_is

4
cdist/conf/type/__update_alternatives/explorer/alternatives vendored

@ -1,4 +1,4 @@
#!/bin/sh -e
update-alternatives --display "${__object_id:?}" 2>/dev/null \
| awk -F ' - ' '/priority [0-9]+$/ { print $1 }'
LC_ALL=C update-alternatives --display "${__object_id:?}" 2>/dev/null \
| awk -F ' - ' '/priority [0-9]+$/ { print $1 }'

5
cdist/conf/type/__update_alternatives/explorer/path_is vendored

@ -1,7 +1,8 @@
#!/bin/sh -e
path_is="$( update-alternatives --display "${__object_id:?}" 2>/dev/null \
| awk '/link currently points to/ {print $5}' )"
path_is=$(
LC_ALL=C update-alternatives --display "${__object_id?}" 2>/dev/null \
| awk '/link currently points to/ { print $5 }')
if [ -z "$path_is" ] && [ -z "${__cdist_dry_run+dry run}" ]
then

Loading…
Cancel
Save