From: Arkadiusz Miśkiewicz Date: Thu, 5 Oct 2023 17:14:27 +0000 (+0200) Subject: rel 3; drop builtin cat and sleep X-Git-Tag: auto/th/mksh-59c-3 X-Git-Url: http://git.pld-linux.org/gitweb.cgi?p=packages%2Fmksh.git;a=commitdiff_plain;h=HEAD;hp=17fbd678b4236f7d49bd95ece6cc609b4c3d14b2 rel 3; drop builtin cat and sleep Buildin cat and sleep break signal delivery to shell (visible in timelimit.spec test suite). Upstream already removed these builtins. --- diff --git a/drop-builtins.patch b/drop-builtins.patch new file mode 100644 index 0000000..740c3aa --- /dev/null +++ b/drop-builtins.patch @@ -0,0 +1,45 @@ +diff -urN mksh.org/funcs.c mksh/funcs.c +--- mksh.org/funcs.c 2020-08-27 21:53:11.000000000 +0200 ++++ mksh/funcs.c 2023-10-05 19:06:16.456613978 +0200 +@@ -98,7 +98,6 @@ + {Tsgbreak, c_brkcont}, + {T__builtin, c_builtin}, + {Tbuiltin, c_builtin}, +- {Tbcat, c_cat}, + {Tcd, c_cd}, + /* dash compatibility hack */ + {"chdir", c_cd}, +@@ -152,9 +151,6 @@ + #ifdef MKSH_PRINTF_BUILTIN + {"~printf", c_printf}, + #endif +-#if HAVE_SELECT +- {"sleep", c_sleep}, +-#endif + #ifdef __MirBSD__ + /* alias to "true" for historical reasons */ + {"domainname", c_true}, +From 2f8a1b53b98c24c6506afdf1dd272febd49e65d2 Mon Sep 17 00:00:00 2001 +From: tg +Date: Sun, 24 Jan 2021 19:41:07 +0000 +Subject: [PATCH] fix builtin removal-related fuckup + +--- + check.t | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/check.t b/check.t +index f22cf367a..c6e25d712 100644 +--- a/check.t ++++ b/check.t +@@ -150,9 +150,8 @@ name: selftest-direct-builtin-call + description: + Check that direct builtin calls work + stdin: +- ln -s "$__progname" cat || cp "$__progname" cat + ln -s "$__progname" echo || cp "$__progname" echo +- ./echo -c 'echo foo' | ./cat -u ++ ./echo -c 'echo foo' + expected-stdout: + -c echo foo + --- diff --git a/mksh-circumflex.patch b/mksh-circumflex.patch index 36ad817..dc6276b 100644 --- a/mksh-circumflex.patch +++ b/mksh-circumflex.patch @@ -1,7 +1,19 @@ -diff -ur mksh-56.orig/eval.c mksh-56/eval.c ---- mksh-56.orig/eval.c 2017-08-12 22:10:26.321676398 +0200 -+++ mksh-56/eval.c 2017-08-12 22:40:32.672676143 +0200 -@@ -1005,6 +1005,7 @@ +diff -urNp -x '*.orig' mksh-59c.org/check.t mksh-59c/check.t +--- mksh-59c.org/check.t 2020-10-31 04:53:30.000000000 +0100 ++++ mksh-59c/check.t 2021-03-20 19:53:40.714261839 +0100 +@@ -2484,7 +2484,7 @@ expected-stdout: + !bc +bc ,bc 0bc 1bc ^bc cbc + !bc +bc ,bc -bc 0bc 1bc ^bc cbc + abc bbc +- ^bc abc bbc ++ !bc +bc ,bc -bc 0bc 1bc ^bc cbc + +bc ,bc -bc + -bc 0bc 1bc + --- +diff -urNp -x '*.orig' mksh-59c.org/eval.c mksh-59c/eval.c +--- mksh-59c.org/eval.c 2020-05-05 23:34:54.000000000 +0200 ++++ mksh-59c/eval.c 2021-03-20 19:53:40.717595272 +0100 +@@ -1108,6 +1108,7 @@ expand( switch (ord(c)) { case ORD('['): case ORD('!'): @@ -9,10 +21,10 @@ diff -ur mksh-56.orig/eval.c mksh-56/eval.c case ORD('-'): case ORD(']'): /* -diff -ur mksh-56.orig/misc.c mksh-56/misc.c ---- mksh-56.orig/misc.c 2017-08-12 22:10:26.321676398 +0200 -+++ mksh-56/misc.c 2017-08-12 22:40:32.672676143 +0200 -@@ -966,7 +966,7 @@ +diff -urNp -x '*.orig' mksh-59c.org/misc.c mksh-59c/misc.c +--- mksh-59c.org/misc.c 2020-08-27 21:53:12.000000000 +0200 ++++ mksh-59c/misc.c 2021-03-20 19:53:40.717595272 +0100 +@@ -1018,7 +1018,7 @@ gmatch_cclass(const unsigned char *pat, char *subp; /* check for negation */ @@ -21,10 +33,10 @@ diff -ur mksh-56.orig/misc.c mksh-56/misc.c p += 2; negated = true; } -diff -ur mksh-56.orig/sh.h mksh-56/sh.h ---- mksh-56.orig/sh.h 2017-08-12 22:10:26.325009789 +0200 -+++ mksh-56/sh.h 2017-08-12 22:40:32.696009488 +0200 -@@ -550,6 +550,7 @@ +diff -urNp -x '*.orig' mksh-59c.org/sh.h mksh-59c/sh.h +--- mksh-59c.org/sh.h 2020-10-31 04:53:33.000000000 +0100 ++++ mksh-59c/sh.h 2021-03-20 19:53:40.717595272 +0100 +@@ -580,6 +580,7 @@ extern int __cdecl setegid(gid_t); */ #define MAGIC KSH_BEL /* prefix for *?[!{,} during expand */ #define ISMAGIC(c) (ord(c) == ORD(MAGIC)) @@ -32,15 +44,3 @@ diff -ur mksh-56.orig/sh.h mksh-56/sh.h EXTERN const char *safe_prompt; /* safe prompt if PS1 substitution fails */ -diff -ur mksh-56.orig/check.t mksh-56/check.t ---- mksh-56.orig/check.t 2017-08-12 22:10:26.321676398 +0200 -+++ mksh-56/check.t 2017-08-12 22:41:46.886083258 +0200 -@@ -2438,7 +2438,7 @@ - !bc +bc ,bc 0bc 1bc ^bc cbc - !bc +bc ,bc -bc 0bc 1bc ^bc cbc - abc bbc -- ^bc abc bbc -+ !bc +bc ,bc -bc 0bc 1bc ^bc cbc - +bc ,bc -bc - -bc 0bc 1bc - --- diff --git a/mksh-mkshrc_support.patch b/mksh-mkshrc_support.patch index 3cde184..d34f4c8 100644 --- a/mksh-mkshrc_support.patch +++ b/mksh-mkshrc_support.patch @@ -1,6 +1,7 @@ ---- mksh-50/main.c.orig 2014-08-21 18:13:38.072682886 +0200 -+++ mksh-50/main.c 2014-08-21 18:29:13.715976954 +0200 -@@ -591,9 +591,14 @@ +diff -urNp -x '*.orig' mksh-59c.org/main.c mksh-59c/main.c +--- mksh-59c.org/main.c 2020-10-01 22:29:21.000000000 +0200 ++++ mksh-59c/main.c 2021-03-20 19:54:06.508364229 +0100 +@@ -695,9 +695,14 @@ main_init(int argc, const char *argv[], if (Flag(FLOGIN)) include(substitute("$HOME/.profile", 0), 0, NULL, true); if (Flag(FTALKING)) { @@ -14,5 +15,5 @@ + include(cp, 0, NULL, true); + } } - } else { - include(MKSH_SUID_PROFILE, 0, NULL, true); + } + if (restricted_shell) { diff --git a/mksh.spec b/mksh.spec index fca8e56..2ee61f3 100644 --- a/mksh.spec +++ b/mksh.spec @@ -4,19 +4,22 @@ %bcond_without static # static version of mksh %bcond_without tests # rtchecks and test.sh checks +%define vernr %(echo %{version} | tr -d 'a-z') + Summary: MirBSD Korn Shell Summary(pl.UTF-8): Powłoka Korna z MirBSD Name: mksh -Version: 57 -Release: 1 +Version: 59c +Release: 3 License: BSD Group: Applications/Shells Source0: https://www.mirbsd.org/MirOS/dist/mir/mksh/%{name}-R%{version}.tgz -# Source0-md5: 4d2686535252ea6a57bdec531498239a +# Source0-md5: 99f8ac3c1d8a30b913d509f1969a4aaa Source1: %{name}-mkshrc Source2: get-source.sh Patch0: %{name}-mkshrc_support.patch Patch1: %{name}-circumflex.patch +Patch2: drop-builtins.patch URL: https://www.mirbsd.org/mksh.htm %if %{with tests} BuildRequires: ed @@ -83,10 +86,13 @@ W tym pakiecie jest mksh skonsolidowany statycznie. %patch0 -p1 %patch1 -p1 +%patch2 -p1 + +sed -i -e 's|fgrep|grep -F|g' check.t # sed rules instead of patch (needed update for every release) sed -i -e 's|\(#define.*MKSH_VERSION.*\)"|\1 @DISTRO@"|g' sh.h -sed -i -e 's|\(@(#)MIRBSD KSH.*\)|\1 @DISTRO@|g' check.t +sed -i -e 's|\(KSH R%{vernr}.*\)|\1 @DISTRO@|g' check.t # fill distro sed -i -e 's#@DISTRO@#PLD/Linux 3.0#g' check.t sh.h @@ -205,7 +211,7 @@ end %files %defattr(644,root,root,755) %doc dot.mkshrc -%config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/mkshrc +%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mkshrc %attr(755,root,root) %{_bindir}/mksh %attr(755,root,root) %{_bindir}/ksh %attr(755,root,root) %{_bindir}/sh