Hello community, here is the log from the commit of package live-langset-data for openSUSE:Factory checked in at 2018-06-19 12:01:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/live-langset-data (Old) and /work/SRC/openSUSE:Factory/.live-langset-data.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "live-langset-data" Tue Jun 19 12:01:52 2018 rev:8 rq:616857 version:2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/live-langset-data/live-langset-data.changes 2018-06-05 12:52:43.002066282 +0200 +++ /work/SRC/openSUSE:Factory/.live-langset-data.new/live-langset-data.changes 2018-06-19 12:01:57.565828169 +0200 @@ -1,0 +2,11 @@ +Tue Jun 12 07:52:34 UTC 2018 - fv...@suse.com + +- Add new method of invocation for jeos-firstboot +- Try to overwrite existing values in vconsole.conf +- Don't write _NOT countries into zypp/RequestedLocales +- Add sysconfig handling back +- Ignore suffix on passed locale +- Call set-keymap after set-x11-keymap +- Restart of systemd-vconsole-setup is not necessary + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ live-langset-data.spec ++++++ --- /var/tmp/diff_new_pack.eYlusK/_old 2018-06-19 12:01:58.177805446 +0200 +++ /var/tmp/diff_new_pack.eYlusK/_new 2018-06-19 12:01:58.185805149 +0200 @@ -20,7 +20,7 @@ Version: 2.0 Release: 0 Summary: Scripts and data to allow locale switching in live media -License: GPL-2.0 +License: GPL-2.0-only Group: System/YaST Url: https://build.opensuse.org/package/show/openSUSE:Factory:Live/live-langset-data Source1: langset.sh ++++++ langset.sh ++++++ --- /var/tmp/diff_new_pack.eYlusK/_old 2018-06-19 12:01:58.269802030 +0200 +++ /var/tmp/diff_new_pack.eYlusK/_new 2018-06-19 12:01:58.269802030 +0200 @@ -1,19 +1,30 @@ #!/bin/sh -lang=en_US -for o in $(cat /proc/cmdline); do - case $o in - lang=*) - eval $o - ;; - keytable=*) - eval $o - ;; - esac -done +# Support two methods of invocation: +# a) Called without arguments, use /proc/cmdline (lang= and keytable=) +# b) Called with arguments, use $1 as lang and $2 as keytable + +if [ $# != 0 ]; then + lang=$1 + keytable=$2 +else + lang=en_US + for o in $(cat /proc/cmdline); do + case $o in + lang=*) + eval $o + ;; + keytable=*) + eval $o + ;; + esac + done +fi + +# Strip potential .UTF-8 suffix +lang="${lang%%.*}" -# we need the _NOT so there is always a field 2 -Country=$(echo "$lang"_NOT | cut -d_ -f2) +Country=$(echo "$lang" | cut -d_ -f2) Language=$(echo "$lang" | cut -d_ -f1) file="/usr/share/langset/$Language""_$Country" @@ -28,14 +39,35 @@ [ -n "$RC_LC_MESSAGES" ] || RC_LC_MESSAGES=$RC_LANG [ -z "$RC_LANG" ] || localectl set-locale LANG=$RC_LANG LC_MESSAGES=$RC_LC_MESSAGES -[ -z "$CONSOLE_FONT" ] || echo "FONT=$CONSOLE_FONT" >> /etc/vconsole.conf -[ -z "$CONSOLE_SCREENMAP" ] || echo "FONT_MAP=$CONSOLE_SCREENMAP" >> /etc/vconsole.conf -[ -z "$CONSOLE_UNICODEMAP" ] || echo "FONT_UNIMAP=$CONSOLE_UNICODEMAP" >> /etc/vconsole.conf +# set_vconsole_option KEY value +set_vconsole_option() { + # "t;q1" means that this sed command exits with 1 if no substitution was done + sed -i"" -E "s/^$1=.+\$/$1=$2/g;t;q1" /etc/vconsole.conf && return + echo "$1=$2" >> /etc/vconsole.conf +} + +[ -z "$CONSOLE_FONT" ] || set_vconsole_option FONT "$CONSOLE_FONT" +[ -z "$CONSOLE_SCREENMAP" ] || set_vconsole_option FONT_MAP "$CONSOLE_SCREENMAP" +[ -z "$CONSOLE_UNICODEMAP" ] || set_vconsole_option FONT_UNIMAP "$CONSOLE_UNICODEMAP" + +# set_sysconfig_option KEY value +set_sysconfig_option() { + sed -i -e "s#$1=\".*#$1=\"$2\"#" /etc/sysconfig/language + sed -i -e "s#$1=\".*#$1=\"$2\"#" /etc/sysconfig/keyboard + sed -i -e "s#$1=\".*#$1=\"$2\"#" /etc/sysconfig/console +} + +# Set legacy sysconfig values for backwards-compat +[ -z "$CONSOLE_FONT" ] || set_sysconfig_option CONSOLE_FONT "$CONSOLE_FONT" +[ -z "$CONSOLE_SCREENMAP" ] || set_sysconfig_option CONSOLE_SCREENMAP "$CONSOLE_SCREENMAP" +[ -z "$CONSOLE_UNICODEMAP" ] || set_sysconfig_option CONSOLE_UNICODEMAP "$CONSOLE_UNICODEMAP" +[ -z "$RC_LANG" ] || set_sysconfig_option RC_LANG "$RC_LANG" +[ -z "$RC_LC_MESSAGES" ] || set_sysconfig_option RC_LC_MESSAGES "$RC_LC_MESSAGES" +[ -z "$KEYTABLE" ] || set_sysconfig_option KEYTABLE "$KEYTABLE" +[ -z "$COMPOSETABLE" ] || set_sysconfig_option COMPOSETABLE "$COMPOSETABLE" # Try the lang-provided keytable first [ -z "$KEYTABLE" ] || localectl set-keymap $KEYTABLE -# Then override with the cmdline provided one, if possible -[ -z "$keytable" ] || localectl set-keymap $keytable [ -n "$TIMEZONE" ] && [ -f "/usr/share/zoneinfo/$TIMEZONE" ] && rm -f /etc/localtime && ln -s /usr/share/zoneinfo/$TIMEZONE /etc/localtime @@ -43,7 +75,7 @@ localectl set-x11-keymap "$XkbLayout" "$XkbModel" "$XkbVariant" "$XkbOptions" fi -echo "$Language""_$Country" > /var/lib/zypp/RequestedLocales +# Override with the cmdline provided one, if possible +[ -z "$keytable" ] || localectl set-keymap $keytable -# Apply the settings -systemctl restart systemd-vconsole-setup +echo "$lang" > /var/lib/zypp/RequestedLocales