Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package systemd-inputmethod-generator for openSUSE:Factory checked in at 2022-03-06 18:15:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/systemd-inputmethod-generator (Old) and /work/SRC/openSUSE:Factory/.systemd-inputmethod-generator.new.1958 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "systemd-inputmethod-generator" Sun Mar 6 18:15:44 2022 rev:3 rq:959675 version:1.0.2 Changes: -------- --- /work/SRC/openSUSE:Factory/systemd-inputmethod-generator/systemd-inputmethod-generator.changes 2022-02-27 22:44:20.170652112 +0100 +++ /work/SRC/openSUSE:Factory/.systemd-inputmethod-generator.new.1958/systemd-inputmethod-generator.changes 2022-03-06 18:15:58.955827686 +0100 @@ -1,0 +2,8 @@ +Sun Mar 6 04:22:55 UTC 2022 - Marguerite Su <i...@marguerite.su> + +- update version 1.0.2 + * $LANG may not set at early stage of systemd user instance, + read /etc/locale.conf first then defaults to en_US. + * $HOME may set to /var/lib/sddm, ignore for that case + +------------------------------------------------------------------- Old: ---- systemd-inputmethod-generator-1.0.1.tar.gz New: ---- systemd-inputmethod-generator-1.0.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ systemd-inputmethod-generator.spec ++++++ --- /var/tmp/diff_new_pack.enKh8H/_old 2022-03-06 18:15:59.419827749 +0100 +++ /var/tmp/diff_new_pack.enKh8H/_new 2022-03-06 18:15:59.423827750 +0100 @@ -17,7 +17,7 @@ Name: systemd-inputmethod-generator -Version: 1.0.1 +Version: 1.0.2 Release: 0 Summary: Expose INPUT_METHOD environment variable License: GPL-3.0-or-later ++++++ systemd-inputmethod-generator-1.0.1.tar.gz -> systemd-inputmethod-generator-1.0.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-inputmethod-generator-1.0.1/.git/COMMIT_EDITMSG new/systemd-inputmethod-generator-1.0.2/.git/COMMIT_EDITMSG --- old/systemd-inputmethod-generator-1.0.1/.git/COMMIT_EDITMSG 2022-02-27 10:26:46.709264721 +0100 +++ new/systemd-inputmethod-generator-1.0.2/.git/COMMIT_EDITMSG 2022-03-06 05:22:29.370962579 +0100 @@ -1 +1 @@ -be aware of user custom settings, /etc/sysconfig/language, and zh_CN.UTF-8 +LANG may not set Binary files old/systemd-inputmethod-generator-1.0.1/.git/index and new/systemd-inputmethod-generator-1.0.2/.git/index differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-inputmethod-generator-1.0.1/.git/logs/HEAD new/systemd-inputmethod-generator-1.0.2/.git/logs/HEAD --- old/systemd-inputmethod-generator-1.0.1/.git/logs/HEAD 2022-02-27 10:26:46.709264721 +0100 +++ new/systemd-inputmethod-generator-1.0.2/.git/logs/HEAD 2022-03-06 05:22:29.366962636 +0100 @@ -1,2 +1,3 @@ 0000000000000000000000000000000000000000 aff6d56580804179de8afb503a97fc24b4cfe8e1 marguerite <i...@marguerite.su> 1645880741 +0800 clone: from https://github.com/openSUSE-zh/systemd-inputmethod-generator aff6d56580804179de8afb503a97fc24b4cfe8e1 09b3c536765fb692d5b3cc9d92aeba92f6225922 marguerite <i...@marguerite.su> 1645953807 +0800 commit: be aware of user custom settings, /etc/sysconfig/language, and zh_CN.UTF-8 +09b3c536765fb692d5b3cc9d92aeba92f6225922 e0eecaa7ea44d79d2f74c2a271b660ed40e99bc2 marguerite <i...@marguerite.su> 1646540457 +0800 commit: LANG may not set diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-inputmethod-generator-1.0.1/.git/logs/refs/heads/main new/systemd-inputmethod-generator-1.0.2/.git/logs/refs/heads/main --- old/systemd-inputmethod-generator-1.0.1/.git/logs/refs/heads/main 2022-02-27 10:26:46.709264721 +0100 +++ new/systemd-inputmethod-generator-1.0.2/.git/logs/refs/heads/main 2022-03-06 05:22:29.366962636 +0100 @@ -1,2 +1,3 @@ 0000000000000000000000000000000000000000 aff6d56580804179de8afb503a97fc24b4cfe8e1 marguerite <i...@marguerite.su> 1645880741 +0800 clone: from https://github.com/openSUSE-zh/systemd-inputmethod-generator aff6d56580804179de8afb503a97fc24b4cfe8e1 09b3c536765fb692d5b3cc9d92aeba92f6225922 marguerite <i...@marguerite.su> 1645953807 +0800 commit: be aware of user custom settings, /etc/sysconfig/language, and zh_CN.UTF-8 +09b3c536765fb692d5b3cc9d92aeba92f6225922 e0eecaa7ea44d79d2f74c2a271b660ed40e99bc2 marguerite <i...@marguerite.su> 1646540457 +0800 commit: LANG may not set diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-inputmethod-generator-1.0.1/.git/logs/refs/remotes/origin/main new/systemd-inputmethod-generator-1.0.2/.git/logs/refs/remotes/origin/main --- old/systemd-inputmethod-generator-1.0.1/.git/logs/refs/remotes/origin/main 2022-02-27 10:26:46.709264721 +0100 +++ new/systemd-inputmethod-generator-1.0.2/.git/logs/refs/remotes/origin/main 2022-03-06 05:22:29.366962636 +0100 @@ -1 +1,2 @@ aff6d56580804179de8afb503a97fc24b4cfe8e1 09b3c536765fb692d5b3cc9d92aeba92f6225922 marguerite <i...@marguerite.su> 1645953829 +0800 update by push +09b3c536765fb692d5b3cc9d92aeba92f6225922 e0eecaa7ea44d79d2f74c2a271b660ed40e99bc2 marguerite <i...@marguerite.su> 1646540482 +0800 update by push Binary files old/systemd-inputmethod-generator-1.0.1/.git/objects/64/1bc07013a4f201a55bdc0e9af72f99bfda7270 and new/systemd-inputmethod-generator-1.0.2/.git/objects/64/1bc07013a4f201a55bdc0e9af72f99bfda7270 differ Binary files old/systemd-inputmethod-generator-1.0.1/.git/objects/b1/1d54df2c3bf94f6eef3e2caede6f0d8b6f05d9 and new/systemd-inputmethod-generator-1.0.2/.git/objects/b1/1d54df2c3bf94f6eef3e2caede6f0d8b6f05d9 differ Binary files old/systemd-inputmethod-generator-1.0.1/.git/objects/e0/eecaa7ea44d79d2f74c2a271b660ed40e99bc2 and new/systemd-inputmethod-generator-1.0.2/.git/objects/e0/eecaa7ea44d79d2f74c2a271b660ed40e99bc2 differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-inputmethod-generator-1.0.1/.git/refs/heads/main new/systemd-inputmethod-generator-1.0.2/.git/refs/heads/main --- old/systemd-inputmethod-generator-1.0.1/.git/refs/heads/main 2022-02-27 10:26:46.709264721 +0100 +++ new/systemd-inputmethod-generator-1.0.2/.git/refs/heads/main 2022-03-06 05:22:29.362962693 +0100 @@ -1 +1 @@ -09b3c536765fb692d5b3cc9d92aeba92f6225922 +e0eecaa7ea44d79d2f74c2a271b660ed40e99bc2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-inputmethod-generator-1.0.1/.git/refs/remotes/origin/main new/systemd-inputmethod-generator-1.0.2/.git/refs/remotes/origin/main --- old/systemd-inputmethod-generator-1.0.1/.git/refs/remotes/origin/main 2022-02-27 10:26:46.709264721 +0100 +++ new/systemd-inputmethod-generator-1.0.2/.git/refs/remotes/origin/main 2022-03-06 05:22:29.366962636 +0100 @@ -1 +1 @@ -09b3c536765fb692d5b3cc9d92aeba92f6225922 +e0eecaa7ea44d79d2f74c2a271b660ed40e99bc2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-inputmethod-generator-1.0.1/inputmethod.py3 new/systemd-inputmethod-generator-1.0.2/inputmethod.py3 --- old/systemd-inputmethod-generator-1.0.1/inputmethod.py3 2022-02-27 10:26:46.701264816 +0100 +++ new/systemd-inputmethod-generator-1.0.2/inputmethod.py3 2022-03-06 05:22:29.334963094 +0100 @@ -7,22 +7,26 @@ def input_method_exist(im): if not im: return False - system_paths = ["/etc/X11/xim.d", "/usr/etc/X11/xim.d"] - for path in system_paths: + for path in ["/etc/X11/xim.d", "/usr/etc/X11/xim.d"]: path = join(path, im) if isfile(path): return True return False def get_current_input_method(): - system_paths = ["/etc/X11/xim.d", "/usr/etc/X11/xim.d"] pattern = '^export\s+(INPUT_METHOD|XMODIFIERS)=("@im=)?([A-Za-z0-9]+)(")?$' pattern_sysconfig = '^INPUT_METHOD="([A-Za-z0-9]+)"$' input_method = "" # find input_method in $HOME/.xim or $HOME/.i18n + home = environ.get("HOME") + # the first user session started via systemd is always the display manager's greeter + # whose $HOME is, eg: /var/lib/sddm + if not home.startswith("/home"): + return + for conf in [".xim", ".i18n", ".profile", ".login"]: - conf = join(environ.get("HOME"), conf) + conf = join(home, conf) if isfile(conf): file = open(conf, "r") @@ -39,7 +43,7 @@ # use user-specified INPUT_METHOD if input_method_exist(input_method): print("INPUT_METHOD={}".format(input_method.lower())) - exit + return # try to use INPUT_METHOD in /etc/sysconfig/language if isfile("/etc/sysconfig/language"): @@ -53,10 +57,26 @@ if input_method_exist(input_method): print("INPUT_METHOD={}".format(input_method.lower())) - exit + return # use language default - lang = environ.get("LANG").split(".")[0] # "zh_CN" + lang = environ.get("LANG") + + if not lang: + # read /etc/locale.conf to determine lang + file = open("/etc/locale.conf", "r") + for line in file: + find = search("^LC_CTYPE=([A-Za-z0-9_\-\.]+)$", line) + if find: + lang = find.group(1) + break + file.close() + + if lang: + lang = lang.split(".")[0] # "zh_CN" + else: + lang = "en_US" + inputmethods = [] for path in ["/etc/X11/xim.d", "/usr/etc/X11/xim.d"]: path = join(path, lang) @@ -64,7 +84,8 @@ inputmethods = [f for f in listdir(path) if isfile(join(path, f))] if not inputmethods: # leave INPUT_METHOD unset - exit + return + i = 0 j = 0 for im in inputmethods: