c == '-' || c == ']' || c == '*' || c == '?'))
shf_putc(MAGIC, shf);
shf_putc(c, shf);
+diff -urN mksh.org/check.t mksh/check.t
+--- mksh.org/check.t 2014-01-11 19:10:02.000000000 +0100
++++ mksh/check.t 2014-01-20 14:12:37.924222697 +0100
+@@ -2085,7 +2085,7 @@
+ cbc
+ -bc cbc
+ abc bbc
+- ^bc abc bbc
++ !bc -bc ^bc cbc
+ !bc -bc ^bc cbc
+ ---
+ name: glob-range-2
---- mksh-40b/sh.h~ 2011-10-15 20:27:37.000000000 +0200
-+++ mksh-40b/sh.h 2011-10-18 17:56:07.152596641 +0200
-@@ -381,7 +381,7 @@
- #define NOT '!' /* might use ^ (ie, [!...] vs [^..]) */
- #define NOT2 '^'
+--- mksh-48b/sh.h~ 2013-10-15 09:18:13.000000000 +0200
++++ mksh-48b/sh.h 2013-10-15 09:18:46.706838235 +0200
+@@ -985,7 +985,7 @@
+ EXTERN char *current_wd;
--#define LINE 4096 /* input line size */
-+#define LINE 16384 /* input line size */
-
- EXTERN const char *safe_prompt; /* safe prompt if PS1 substitution fails */
- EXTERN const char initvsn[] I__("KSH_VERSION=@(#)MIRBSD KSH " MKSH_VERSION);
+ /* input line size */
+-#define LINE (4096 - ALLOC_SIZE)
++#define LINE (16384 - ALLOC_SIZE)
+ /*
+ * Minimum required space to work with on a line - if the prompt leaves
+ * less space than this on a line, the prompt is truncated.
---- main.c~ 2011-07-07 18:15:26.961632040 +0100
-+++ main.c 2011-07-07 18:15:50.664694256 +0100
-@@ -532,10 +532,14 @@
- char *env_file;
-
- /* include $ENV */
-- env_file = substitute(substitute("${ENV:-" MKSHRC_PATH "}", 0),
-- DOTILDE);
-+ env_file = substitute(substitute("${ENV}", 0), DOTILDE);
- if (*env_file != '\0')
- include(env_file, 0, NULL, true);
-+ else {
-+ env_file = substitute(MKSHRC_PATH, DOTILDE);
-+ include("/etc/mkshrc", 0, NULL, true);
-+ include(env_file, 0, NULL, true);
-+ }
- }
-
- if (restricted) {
+--- 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,10 +591,14 @@
+ if (Flag(FLOGIN))
+ include(substitute("$HOME/.profile", 0), 0, NULL, true);
+ if (Flag(FTALKING)) {
+- cp = substitute(substitute("${ENV:-" MKSHRC_PATH "}",
+- 0), DOTILDE);
++ cp = substitute(substitute("${ENV}", 0), DOTILDE);
+ if (cp[0] != '\0')
+ include(cp, 0, NULL, true);
++ else {
++ cp = substitute(MKSHRC_PATH, DOTILDE);
++ include("/etc/mkshrc", 0, NULL, true);
++ include(cp, 0, NULL, true);
++ }
+ }
+ } else {
+ include(MKSH_SUID_PROFILE, 0, NULL, true);
---- mksh-40.org/main.c 2011-07-07 17:21:37.608256172 +0100
-+++ mksh-40/main.c 2011-07-07 17:22:44.980829725 +0100
-@@ -73,7 +73,6 @@
+--- mksh-49/main.c~ 2014-01-20 14:20:05.000000000 +0200
++++ mksh-49/main.c 2014-01-20 14:20:37.166725505 +0200
+@@ -74,7 +74,6 @@
#if !defined(ANDROID) && !defined(MKSH_UNEMPLOYED)
/* not in Android for political reasons */
/* not in ARGE mksh due to no job control */
- "stop=kill -STOP",
- "suspend=kill -STOP $$",
#endif
"autoload=typeset -fu",
---- mksh-40.org/mksh.1 2011-06-12 16:34:43.000000000 +0100
-+++ mksh-40/mksh.1 2011-07-07 17:23:08.177234851 +0100
-@@ -1092,7 +1092,6 @@
+ "functions=typeset -f",
+--- mksh-49/mksh.1~ 2014-01-11 20:10:06.000000000 +0200
++++ mksh-49/mksh.1 2014-01-20 14:21:04.704670524 +0200
+@@ -1131,7 +1131,6 @@
nameref=\*(aqtypeset \-n\*(aq
nohup=\*(aqnohup \*(aq
r=\*(aqfc \-e \-\*(aq
-stop=\*(aqkill \-STOP\*(aq
- suspend=\*(aqkill \-STOP $$\*(aq
type=\*(aqwhence \-v\*(aq
.Ed
---- mksh-40.orig/check.t 2011-07-07 17:43:03.450369958 +0100
-+++ mksh-40/check.t 2011-07-07 17:43:24.303467293 +0100
-@@ -5941,7 +5941,6 @@
+ .Pp
+--- mksh-49/check.t~ 2014-01-11 20:10:02.000000000 +0200
++++ mksh-49/check.t 2014-01-20 14:21:32.202611748 +0200
+@@ -6766,7 +6766,6 @@
nohup='nohup '
r='fc -e -'
source='PATH=$PATH:. command .'
- stop='kill -STOP'
- suspend='kill -STOP $$'
type='whence -v'
---
-@@ -6010,7 +6009,6 @@
+ name: aliases-1-hartz4
+@@ -6834,7 +6833,6 @@
nohup='nohup '
r='fc -e -'
source='PATH=$PATH:. command .'
- stop='kill -STOP'
- suspend='kill -STOP $$'
type='whence -v'
---
-@@ -6034,7 +6032,6 @@
+ name: aliases-3b
+@@ -6857,7 +6855,6 @@
nohup='nohup '
r='fc -e -'
source='PATH=$PATH:. command .'
- stop='kill -STOP'
- suspend='kill -STOP $$'
type='whence -v'
---
+ name: aliases-2b-hartz4
#
-# TODO: https://bugs.launchpad.net/mksh/+bug/1179287
-#
# Conditional build:
%bcond_without static # static version of mksh
%bcond_without tests # rtchecks and test.sh checks
-#
-#
+
Summary: MirBSD Korn Shell
Summary(pl.UTF-8): Powłoka Korna z MirBSD
Name: mksh
-Version: 47
-Release: 3
+Version: 50c
+Release: 1
License: BSD
Group: Applications/Shells
Source0: http://www.mirbsd.org/MirOS/dist/mir/mksh/%{name}-R%{version}.tgz
-# Source0-md5: 71c7cbcd78306897801b8b6691091e66
+# Source0-md5: 263512ebbb06c92e6128da97b2eae17c
Source1: %{name}-mkshrc
Patch0: %{name}-mkshrc_support.patch
Patch1: %{name}-circumflex.patch
BuildRequires: perl-base
%endif
%{?with_static:BuildRequires: glibc-static}
-BuildRequires: rpmbuild(macros) >= 1.462
+BuildRequires: rpmbuild(macros) >= 1.670
# is needed for /etc directory existence
Requires(pre): FHS
Requires: setup >= 2.4.6-2
gzip -dc %{SOURCE0} | cpio -mid
mv mksh/* .; rmdir mksh
-%patch0 -p0
+%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
sed -i -e 's|\(@(#)MIRBSD KSH.*\)|\1 @DISTRO@|g' check.t
# fill distro
-sed -i -e 's#@DISTRO@#TLD/Linux#g' check.t sh.h
+sed -i -e 's#@DISTRO@#TLD/Linux 3.0#g' check.t sh.h
# sanity checks
grep TLD/Linux check.t || exit 1
grep TLD/Linux sh.h || exit 1
%post -p %add_etc_shells -p /bin/sh /bin/ksh /bin/mksh
%preun -p %remove_etc_shells -p /bin/sh /bin/ksh /bin/mksh
-%posttrans -p %add_etc_shells -p /bin/sh /bin/ksh /bin/mksh
-
%post static -p %add_etc_shells -p /bin/mksh.static
%preun static -p %remove_etc_shells -p /bin/mksh.static
+%triggerpostun -p <lua> -- pdksh
+if arg[2] ~= 0 then
+%lua_add_etc_shells /bin/sh /bin/ksh /bin/mksh
+end
+
%files
%defattr(644,root,root,755)
%doc dot.mkshrc