From 1c0f141f863736b2c5c47d6d9f20b75c8cbf8318 Mon Sep 17 00:00:00 2001 From: Gabriel Becker Date: Tue, 10 Nov 2020 18:10:17 +0100 Subject: [PATCH] Fix bash_dconf_settings to grep whole keyword alike. --- .../dconf_gnome_disable_automount/tests/wrong_value.fail.sh | 3 +++ shared/macros-bash.jinja | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/linux_os/guide/system/software/gnome/gnome_media_settings/dconf_gnome_disable_automount/tests/wrong_value.fail.sh b/linux_os/guide/system/software/gnome/gnome_media_settings/dconf_gnome_disable_automount/tests/wrong_value.fail.sh index 35c6e417ad..0272781515 100644 --- a/linux_os/guide/system/software/gnome/gnome_media_settings/dconf_gnome_disable_automount/tests/wrong_value.fail.sh +++ b/linux_os/guide/system/software/gnome/gnome_media_settings/dconf_gnome_disable_automount/tests/wrong_value.fail.sh @@ -5,3 +5,6 @@ install_dconf_and_gdm_if_needed clean_dconf_settings + +add_dconf_setting "org/gnome/desktop/media-handling" "automount-open" "false" "local.d" "00-security-settings" +add_dconf_lock "org/gnome/desktop/media-handling" "automount-open" "local.d" "00-security-settings" diff --git a/shared/macros-bash.jinja b/shared/macros-bash.jinja index ee48bec12d..0add877cbc 100644 --- a/shared/macros-bash.jinja +++ b/shared/macros-bash.jinja @@ -181,7 +181,7 @@ then printf '%s=%s\n' "{{{ key }}}" "{{{ value }}}" >> ${DCONFFILE} else escaped_value="$(sed -e 's/\\/\\\\/g' <<< "{{{ value }}}")" - if grep -q "^\\s*{{{ key }}}" "${SETTINGSFILES[@]}" + if grep -q "^\\s*{{{ key }}}\\s*=" "${SETTINGSFILES[@]}" then sed -i "s/\\s*{{{ key }}}\\s*=\\s*.*/{{{ key }}}=${escaped_value}/g" "${SETTINGSFILES[@]}" else