[ksh/f14/master] - disable only known to be broken builtins, let other enabled - skip regression tests if /dev/fd is

Michal Hlavinka mhlavink at fedoraproject.org
Mon Oct 11 13:13:27 UTC 2010


commit 84a09500c9e893179fa9b2784f4dd875799be253
Author: Michal Hlavinka <mhlavink at redhat.com>
Date:   Mon Oct 11 15:13:33 2010 +0200

    - disable only known to be broken builtins, let other enabled
    - skip regression tests if /dev/fd is missing

 .gitignore                  |    4 +++
 expectedresults.log         |   19 +++++++++++++
 ksh-20070328-builtins.patch |   25 +++++++++++++----
 ksh-20100826-fixregr.patch  |   61 +++++++++++++++++++++++++++++++++++++++++++
 ksh.spec                    |   53 +++++++++++++++++++++++++++++++------
 sources                     |    4 +-
 6 files changed, 149 insertions(+), 17 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 255b0ce..5a161d4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,7 @@ ast-ksh.2010-07-01.tgz
 INIT.2010-07-01.tgz
 /ast-ksh.2010-08-11.tgz
 /INIT.2010-08-11.tgz
+/ast-ksh.2010-08-26.tgz
+/INIT.2010-08-26.tgz
+/ast-ksh.2010-09-24.tgz
+/INIT.2010-09-24.tgz
diff --git a/expectedresults.log b/expectedresults.log
new file mode 100644
index 0000000..4bfeb1a
--- /dev/null
+++ b/expectedresults.log
@@ -0,0 +1,19 @@
+	basic.sh[438]: early termination not causing broken pipe
+test basic failed [ 96 tests 1 error ]
+	basic.sh[438]: early termination not causing broken pipe
+test basic(C.UTF-8) failed [ 96 tests 1 error ]
+	shcomp-basic.ksh[438]: early termination not causing broken pipe
+test basic(shcomp) failed [ 96 tests 1 error ]
+	locale.sh[209]: LC_ALL test script failed -- expected 'f1', got ''
+test locale failed [ 21 tests 1 error ]
+	shcomp-locale.ksh[209]: LC_ALL test script failed -- expected 'f1', got ''
+test locale(shcomp) failed [ 21 tests 1 error ]
+	signal.sh[55]: pipe with --pipefail PIPE trap hangs
+	signal.sh[296]: kill -PIPE $$ failed, required termination by signal 'KILL'
+test signal failed [ 37 tests 2 errors ]
+	signal.sh[55]: pipe with --pipefail PIPE trap hangs
+	signal.sh[296]: kill -PIPE $$ failed, required termination by signal 'KILL'
+test signal(C.UTF-8) failed [ 37 tests 2 errorss ]
+	shcomp-signal.ksh[55]: pipe with --pipefail PIPE trap hangs
+	shcomp-signal.ksh[296]: kill -PIPE $$ failed, required termination by signal 'KILL'
+test signal(shcomp) failed [ 37 tests 2 errorsss ]
diff --git a/ksh-20070328-builtins.patch b/ksh-20070328-builtins.patch
index 4c06c3f..e50470a 100644
--- a/ksh-20070328-builtins.patch
+++ b/ksh-20070328-builtins.patch
@@ -1,15 +1,28 @@
-diff -up ksh-20090501/src/cmd/ksh93/data/builtins.c.builtins ksh-20090501/src/cmd/ksh93/data/builtins.c
---- ksh-20090501/src/cmd/ksh93/data/builtins.c.builtins	2009-04-12 09:38:03.000000000 +0200
-+++ ksh-20090501/src/cmd/ksh93/data/builtins.c	2009-05-05 11:20:30.601284246 +0200
-@@ -125,6 +125,7 @@ const struct shtable3 shtab_builtins[] =
+diff -up ksh-20100924/src/cmd/ksh93/data/builtins.c.builtins ksh-20100924/src/cmd/ksh93/data/builtins.c
+--- ksh-20100924/src/cmd/ksh93/data/builtins.c.builtins	2010-08-10 20:58:54.000000000 +0200
++++ ksh-20100924/src/cmd/ksh93/data/builtins.c	2010-10-08 18:08:35.118675557 +0200
+@@ -125,20 +125,28 @@ const struct shtable3 shtab_builtins[] =
  #ifdef SHOPT_CMDLIB_HDR
  #include SHOPT_CMDLIB_HDR
  #else
-+#if 0
++#if 1
  	CMDLIST(basename)
  	CMDLIST(chmod)
  	CMDLIST(dirname)
-@@ -139,6 +140,7 @@ const struct shtable3 shtab_builtins[] =
+ 	CMDLIST(getconf)
+ 	CMDLIST(head)
++#if 0
++does not work when ACLs are used
+ 	CMDLIST(mkdir)
++#endif
+ 	CMDLIST(logname)
++#if 1
++//does not work in chrooted environments, because /dev/fd/? is missing
+ 	CMDLIST(cat)
++#endif
+ 	CMDLIST(cmp)
+ 	CMDLIST(cut)
+ 	CMDLIST(uname)
  	CMDLIST(wc)
  	CMDLIST(sync)
  #endif
diff --git a/ksh-20100826-fixregr.patch b/ksh-20100826-fixregr.patch
new file mode 100644
index 0000000..68fc0a9
--- /dev/null
+++ b/ksh-20100826-fixregr.patch
@@ -0,0 +1,61 @@
+diff -up ksh-20100924/src/cmd/ksh93/tests/builtins.sh.fixregr ksh-20100924/src/cmd/ksh93/tests/builtins.sh
+--- ksh-20100924/src/cmd/ksh93/tests/builtins.sh.fixregr	2010-09-30 08:49:58.225268051 +0200
++++ ksh-20100924/src/cmd/ksh93/tests/builtins.sh	2010-09-30 08:53:58.429519220 +0200
+@@ -293,7 +293,7 @@ fi
+ # we won't get hit by the one second boundary twice, right?
+ [[ $(printf '%T\n' now) == "$(date)" ]] ||
+ [[ $(printf '%T\n' now) == "$(date)" ]] ||
+-err_exit 'printf "%T" now'
++err_exit 'printf "%T" now'"$(printf '%T\n' now) != $(date)"
+ behead()
+ {
+ 	read line
+diff -up ksh-20100924/src/cmd/ksh93/tests/locale.sh.fixregr ksh-20100924/src/cmd/ksh93/tests/locale.sh
+--- ksh-20100924/src/cmd/ksh93/tests/locale.sh.fixregr	2010-09-07 20:21:44.000000000 +0200
++++ ksh-20100924/src/cmd/ksh93/tests/locale.sh	2010-09-30 08:57:41.512270429 +0200
+@@ -103,6 +103,7 @@ if	(( $($SHELL -c $'export LC_ALL='$loca
+ then	LC_ALL=$locale $SHELL -c b1=$'"\342\202\254\342\202\254\342\202\254\342\202\254w\342\202\254\342\202\254\342\202\254\342\202\254"; [[ ${b1:4:1} == w ]]' || err_exit 'multibyte ${var:offset:len} not working correctly'
+ fi
+ 
++locale=en_US.UTF-8
+ #$SHELL -c 'export LANG='$locale'; printf "\u[20ac]\u[20ac]" > $tmp/two_euro_chars.txt'
+ printf $'\342\202\254\342\202\254' > $tmp/two_euro_chars.txt
+ exp="6 2 6"
+@@ -110,16 +111,16 @@ set -- $($SHELL -c "
+ 	unset LC_CTYPE
+ 	export LANG=$locale
+ 	export LC_ALL=C
+-	command wc -C < $tmp/two_euro_chars.txt
++	command wc -m < $tmp/two_euro_chars.txt
+ 	unset LC_ALL
+-	command wc -C < $tmp/two_euro_chars.txt
++	command wc -m < $tmp/two_euro_chars.txt
+ 	export LC_ALL=C
+-	command wc -C < $tmp/two_euro_chars.txt
++	command wc -m < $tmp/two_euro_chars.txt
+ ")
+ got=$*
+ [[ $got == $exp ]] || err_exit "command wc LC_ALL default failed -- expected '$exp', got '$got'"
+ set -- $($SHELL -c "
+-	if	builtin -f cmd wc 2>/dev/null
++	if	builtin wc 2>/dev/null
+ 	then	unset LC_CTYPE
+ 		export LANG=$locale
+ 		export LC_ALL=C
+@@ -133,6 +134,8 @@ set -- $($SHELL -c "
+ got=$*
+ [[ $got == $exp ]] || err_exit "builtin wc LC_ALL default failed -- expected '$exp', got '$got'"
+ 
++locale=C_EU.UTF-8
++
+ # multibyte char straddling buffer boundary
+ 
+ {
+@@ -189,6 +192,7 @@ do	exp=$1
+ done
+ 
+ # setocale(LC_ALL,"") after setlocale() initialization
++locale=en_US.UTF-8
+ 
+ printf 'f1\357\274\240f2\n' > input1
+ printf 't2\357\274\240f1\n' > input2
diff --git a/ksh.spec b/ksh.spec
index 98f4258..855fc48 100644
--- a/ksh.spec
+++ b/ksh.spec
@@ -1,20 +1,25 @@
-%global       releasedate 2010-08-11
+%global       releasedate 2010-09-24
 
 Name:         ksh
 Summary:      The Original ATT Korn Shell
 URL:          http://www.kornshell.com/
 Group:        System Environment/Shells
 License:      CPL
-Version:      20100811
-Release:      1%{?dist}
+Version:      20100924
+Release:      2%{?dist}
 Source0:      http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{releasedate}.tgz
 Source1:      http://www.research.att.com/~gsf/download/tgz/INIT.%{releasedate}.tgz
 Source3:      kshrc.rhs
 Source4:      dotkshrc
+#expected results of test suite
+Source5:      expectedresults.log
 
-#don't use not wanted/needed builtins - Fedora specific
+#don't use not wanted/needed builtins - Fedora/RHEL specific
 Patch1:       ksh-20070328-builtins.patch
 
+#fix regression test suite to be usable during packagebuild - Fedora/RHEL specific
+Patch2:       ksh-20100826-fixregr.patch
+
 BuildRoot:    %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Conflicts:    pdksh
 Requires: coreutils, glibc-common, diffutils
@@ -32,18 +37,20 @@ with "sh" (the Bourne Shell).
 %setup -q -c
 %setup -q -T -D -a 1
 %patch1 -p1 -b .builtins
+%patch2 -p1 -b .fixregr
 
 #/dev/fd test does not work because of mock
 sed -i 's|ls /dev/fd|ls /proc/self/fd|' src/cmd/ksh93/features/options
 
 %build
-./bin/package "read" ||:
+./bin/package
+./bin/package make mamake ||:
+./bin/package make mamake ||:
 export CCFLAGS="$RPM_OPT_FLAGS"
 export CC=gcc
 ./bin/package "make"
 
-#missing in 2010-06-21, chech later if added back
-#cp lib/package/LICENSES/ast LICENSE
+cp lib/package/LICENSES/ast LICENSE
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -55,6 +62,24 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/skel
 install -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/skel/.kshrc
 install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/kshrc
 
+%check
+export SHELL=$(ls $(pwd)/arch/*/bin/ksh)
+cd src/cmd/ksh93/tests/
+ulimit -c unlimited
+if [ ! -e /dev/fd ]
+then
+  echo "ERROR: /dev/fd does not exist, regression tests skipped"
+  exit 0
+fi
+$SHELL ./shtests 2>&1 | tee testresults.log
+sed -e '/begins at/d' -e '/ 0 error/d' -e 's/at [^\[]*\[/\[/' testresults.log -e '/tests skipped/d' >filteredresults.log
+if ! cmp filteredresults.log %{SOURCE5} >/dev/null || ls core.*
+then
+  echo "Regression tests failed"
+  diff -Naurp %{SOURCE5} filteredresults.log
+  exit -1
+fi
+
 %post
 if [ ! -f /etc/shells ]; then
         echo "/bin/ksh" > /etc/shells
@@ -80,8 +105,7 @@ fi
 
 %files 
 %defattr(-, root, root,-)
-#%doc README LICENSE
-%doc README
+%doc README LICENSE
 /bin/ksh
 /usr/bin/shcomp
 %{_mandir}/man1/*
@@ -92,6 +116,17 @@ fi
     rm -rf $RPM_BUILD_ROOT
 
 %changelog
+* Fri Oct 08 2010 Michal Hlavinka <mhlavink at redhat.com> - 20100924-2
+- disable only known to be broken builtins, let other enabled
+- skip regression tests if /dev/fd is missing
+
+* Tue Sep 28 2010 Michal Hlavinka <mhlavink at redhat.com> - 20100924-1
+- ksh updated to 2010-09-24
+
+* Mon Aug 30 2010 Michal Hlavinka <mhlavink at redhat.com> - 20100826-1
+- ksh updated to 2010-08-26
+- make regression test suite usable during package build
+
 * Fri Aug 13 2010 Michal Hlavinka <mhlavink at redhat.com> - 20100811-1
 - ksh updated to 2010-08-11
 
diff --git a/sources b/sources
index f35c1f9..e66dc4f 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-92aa05b5a1c0dd36a456314570d938e5  ast-ksh.2010-08-11.tgz
-d5d0888222e68ab88fc436f98ee29b3c  INIT.2010-08-11.tgz
+af1ff3e77c240d6caf43d4daf33277fa  ast-ksh.2010-09-24.tgz
+93b8a2560f313f67263c430311cc4031  INIT.2010-09-24.tgz


More information about the scm-commits mailing list