Hello community, here is the log from the commit of package mksh for openSUSE:Factory checked in at 2017-12-18 08:59:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mksh (Old) and /work/SRC/openSUSE:Factory/.mksh.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mksh" Mon Dec 18 08:59:11 2017 rev:16 rq:557261 version:54 Changes: -------- --- /work/SRC/openSUSE:Factory/mksh/mksh.changes 2017-12-01 15:54:33.126063721 +0100 +++ /work/SRC/openSUSE:Factory/.mksh.new/mksh.changes 2017-12-18 08:59:13.971595628 +0100 @@ -1,0 +2,6 @@ +Fri Dec 15 07:59:20 UTC 2017 - wer...@suse.de + +- Add patch mksh-locale.patch to enable the mksh to set internal + lcoale settings like utf support during runtime + +------------------------------------------------------------------- New: ---- mksh-locale.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mksh.spec ++++++ --- /var/tmp/diff_new_pack.WK9bz2/_old 2017-12-18 08:59:14.787556239 +0100 +++ /var/tmp/diff_new_pack.WK9bz2/_new 2017-12-18 08:59:14.791556046 +0100 @@ -30,6 +30,8 @@ Source: https://www.mirbsd.org/MirOS/dist/mir/mksh/%{name}-R%{version}.tgz # PATCH-FEATURE-OPENSUSE mksh-vendor-mkshrc.patch g...@opensuse.org -- Add support for a vendor-supplied kshrc which is read by interactive shells before $ENV or $HOME/.mkshrc are processed Patch0: mksh-vendor-mkshrc.patch +# PATCH-FEATURE-OPENSUSE mksh-locale.patch -- Add support for setting locale in running mksh +Patch1: mksh-locale.patch BuildRequires: ed # for %%check BuildRequires: perl @@ -63,6 +65,7 @@ %prep %setup -q -n %{name} %patch0 -p1 -b .p0 +%patch1 -p0 -b .p1 %if 0%{?suse_version} > 0 %if !0%{?is_opensuse} @@ -84,6 +87,11 @@ w EOF %endif +# Some timing issues on qemu ppc* systems +case "$(uname -m)" in +ppc*) sed -ri '/sleep/{s/(sleep)[[:space:]]+2/\1 5/;}' check.t + sed -ri '/regression-65/,/^---/{s/(time-limit:)[[:space:]]+3/\1 5/;}' check.t +esac ed -s mksh.1 <<-'EOF' /insert-your-name-here/s/^\.\\" // s/insert-your-name-here/SUSE/ ++++++ mksh-locale.patch ++++++ Add support for setting locale after mksh has started. With this change it is possible to override the locale in the personal ~/.profile or ~/.mkshrc as well as in the system wide /etc/profile. --- main.c | 3 +-- sh.h | 1 + var.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ var_spec.h | 6 ++++++ 4 files changed, 59 insertions(+), 2 deletions(-) --- main.c +++ main.c 2017-12-15 07:34:47.135915295 +0000 @@ -46,7 +46,6 @@ extern char **environ; #define MKSH_DEFAULT_TMPDIR MKSH_UNIXROOT "/tmp" #endif -static uint8_t isuc(const char *); static int main_init(int, const char *[], Source **, struct block **); void chvt_reinit(void); static void reclaim(void); @@ -155,7 +154,7 @@ static const char *empty_argv[] = { Tmksh, NULL }; -static uint8_t +uint8_t isuc(const char *cx) { char *cp, *x; uint8_t rv = 0; --- sh.h +++ sh.h 2017-12-15 07:35:43.938851966 +0000 @@ -2169,6 +2169,7 @@ void set_prompt(int, Source *); int pprompt(const char *, int); /* main.c */ int include(const char *, int, const char **, bool); +uint8_t isuc(const char *); int command(const char *, int); int shell(Source * volatile, volatile bool); /* argument MUST NOT be 0 */ --- var.c +++ var.c 2017-12-15 07:33:49.364996826 +0000 @@ -28,6 +28,13 @@ #include <sys/sysctl.h> #endif +#if HAVE_LANGINFO_CODESET +#include <langinfo.h> +#endif +#if HAVE_SETLOCALE_CTYPE +#include <locale.h> +#endif + __RCSID("$MirOS: src/bin/mksh/var.c,v 1.209 2016/11/11 23:31:39 tg Exp $"); /*- @@ -1326,6 +1333,28 @@ setspec(struct tbl *vp) strdupx(tmpdir, s, APERM); } return; +#if HAVE_SETLOCALE_CTYPE + case V_LC_ALL: + case V_LC_CTYPE: + case V_LANG: + { + char *loc; + loc = str_val(global("LC_ALL")); + if (loc == null) + loc = str_val(global("LC_CTYPE")); + if (loc == null) + loc = str_val(global("LANG")); + if (loc == null) + return; + setlocale(LC_CTYPE, loc); +#if HAVE_LANGINFO_CODESET + if (!isuc(loc)) + loc = nl_langinfo(CODESET); +#endif + UTFMODE = isuc(loc); + } + return; +#endif /* common sub-cases */ case V_COLUMNS: case V_LINES: @@ -1444,6 +1473,28 @@ unsetspec(struct tbl *vp) tmpdir = NULL; } break; +#if HAVE_SETLOCALE_CTYPE + case V_LC_ALL: + case V_LC_CTYPE: + case V_LANG: + { + char *loc; + loc = str_val(global("LC_ALL")); + if (loc == null) + loc = str_val(global("LC_CTYPE")); + if (loc == null) + loc = str_val(global("LANG")); + if (loc == null) + break; + setlocale(LC_CTYPE, loc); +#if HAVE_LANGINFO_CODESET + if (!isuc(loc)) + loc = nl_langinfo(CODESET); +#endif + UTFMODE = isuc(loc); + } + break; +#endif case V_LINENO: case V_RANDOM: case V_SECONDS: --- var_spec.h +++ var_spec.h 2017-12-15 07:29:01.550386292 +0000 @@ -68,6 +68,12 @@ FN(TERM) FN(TMOUT) FN(TMPDIR) +#if HAVE_SETLOCALE_CTYPE +FN(LANG) +FN(LC_CTYPE) +FN(LC_ALL) +#endif + #undef FN #undef F0 #undef VARSPEC_DEFNS