diff --git a/.gitignore b/.gitignore index d3dedb4..be97a71 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ mksh-R40d.cpio.gz /mksh_40.9.20120630.orig.tar.gz +/mksh-R41.tgz diff --git a/mksh.spec b/mksh.spec index 0cec9c2..e11abda 100644 --- a/mksh.spec +++ b/mksh.spec @@ -1,17 +1,16 @@ %define _bindir /bin -%global snapshot 20120630 Summary: MirBSD enhanced version of the Korn Shell Name: mksh -Version: 40i -Release: 0%{?dist}.%{snapshot} +Version: 41 +Release: 1%{?dist} # BSD (setmode.c), ISC (strlcpy.c), MirOS (the rest) License: MirOS and ISC and BSD Group: System Environment/Shells URL: http://www.mirbsd.de/%{name}.htm -Source0: ftp://ftp.debian.org/debian/pool/main/m/%{name}/%{name}_40.9.%{snapshot}.orig.tar.gz -#Source0: http://www.mirbsd.org/MirOS/dist/mir/%{name}/%{name}-R%{version}.cpio.gz +Source0: http://www.mirbsd.org/MirOS/dist/mir/%{name}/%{name}-R%{version}.tgz Source1: dot-mkshrc Source2: lksh.1 +Source3: rtchecks.expected Requires(post): grep Requires(postun): sed BuildRequires: util-linux, ed @@ -25,18 +24,37 @@ modern, robust shell good for interactive and especially script use, being a bourne shell replacement, pdksh successor and an alternative to the C shell. %prep -%setup -q -T -c +#%setup -q -T -c +%setup -q -n %{name} -# rpm.org has no support for *.cpio.gz -#gzip -dc %{SOURCE0} | cpio -imd -#mv %{name}/* . && rm -rf %{name} -tar xvzf %{SOURCE0} -mv mksh-40.9.%{snapshot}.orig/* . +# we'll need this later due to -DMKSH_GCC55009 +cat >rtchecks <<'EOF' +typeset -i sari=0 +typeset -Ui uari=0 +typeset -i x=0 +print -r -- $((x++)):$sari=$uari. +let --sari --uari +print -r -- $((x++)):$sari=$uari. +sari=2147483647 uari=2147483647 +print -r -- $((x++)):$sari=$uari. +let ++sari ++uari +print -r -- $((x++)):$sari=$uari. +let --sari --uari +let 'sari *= 2' 'uari *= 2' +let ++sari ++uari +print -r -- $((x++)):$sari=$uari. +let ++sari ++uari +print -r -- $((x++)):$sari=$uari. +sari=-2147483648 uari=-2147483648 +print -r -- $((x++)):$sari=$uari. +let --sari --uari +print -r -- $((x++)):$sari=$uari. +EOF %build -CFLAGS="$RPM_OPT_FLAGS" sh Build.sh -r -c lto +CFLAGS="$RPM_OPT_FLAGS -DMKSH_DISABLE_EXPERIMENTAL -DMKSH_GCC55009" sh Build.sh -r -c lto cp test.sh test_mksh.sh -CFLAGS="$RPM_OPT_FLAGS" sh Build.sh -L -r -c lto +CFLAGS="$RPM_OPT_FLAGS -DMKSH_DISABLE_EXPERIMENTAL -DMKSH_GCC55009" sh Build.sh -L -r -c lto cp test.sh test_lksh.sh %install @@ -49,6 +67,14 @@ install -D -p -m 644 dot.mkshrc $RPM_BUILD_ROOT%{_sysconfdir}/mkshrc install -D -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/skel/.mkshrc %check +./mksh rtchecks >rtchecks.got 2>&1 +if ! cmp --quiet rtchecks.got %{SOURCE3} +then + echo "rtchecks failed" + diff -Naurp %{SOURCE3} rtchecks.got + exit 1 +fi + for tf in test_mksh.sh test_lksh.sh do echo > test.wait @@ -84,6 +110,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/lksh.1* %changelog +* Mon Dec 03 2012 Michal Hlavinka - 41-1 +- Upgrade to 41 + * Fri Jul 20 2012 Michal Hlavinka - 40i-0.20120630 - Upgrade to pre-release of 40i - includes new legacy shell lksh for old scripts requiring pdksh or similar old diff --git a/rtchecks.expected b/rtchecks.expected new file mode 100644 index 0000000..0d9a267 --- /dev/null +++ b/rtchecks.expected @@ -0,0 +1,8 @@ +0:0=0. +1:-1=4294967295. +2:2147483647=2147483647. +3:-2147483648=2147483648. +4:-1=4294967295. +5:0=0. +6:-2147483648=2147483648. +7:2147483647=2147483647. diff --git a/sources b/sources index 99b8b4e..a4f2891 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d2da844ef5ae1c6c68d0675a4d0c1229 mksh_40.9.20120630.orig.tar.gz +70eca50d9340412714ef09b7060ebde9 mksh-R41.tgz