diff --git a/ksh-1020.spec b/ksh-1020.spec new file mode 100644 index 0000000..b12466d --- /dev/null +++ b/ksh-1020.spec @@ -0,0 +1,442 @@ +# +# spec file for package ksh (Version 93s) +# +# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. +# This file and all modifications and additions to the pristine +# package are under the same license as the package itself. +# +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + +# norootforbuild + +Name: ksh +BuildRequires: bind-libs bind-utils bison flex gdbm-devel glibc-devel ncurses-devel procps psmisc pwdutils zlib-devel +Url: http://www.research.att.com/~gsf/download/ +License: Common Public License Version 1.0 (CPL1.0) +Group: System/Shells +PreReq: /bin/ln /bin/rm /etc/bash.bashrc /bin/true +AutoReqProv: on +Version: 93s +Release: 62 +Summary: Korn Shell +BuildRoot: %{_tmppath}/%{name}-%{version}-build +Source: INIT.2007-06-28.tar.bz2 +Source1: ast-ksh.2007-06-28.tar.bz2 +Source2: Agreement +Source3: Warning +Source30: rpmlintrc +Patch: ksh93.dif +Patch1: workaround-stupid-build-system.diff +Patch2: ksh-qemu.patch +Patch3: ksh93-shift_ijs.dif +Patch4: ksh93-gmt2utc.dif +Patch5: ksh93-uname.dif +Patch6: ksh93-vi.dif +Patch7: ksh93-profile.dif +Patch8: ksh93-test.dif +Patch9: ksh93-compat.dif +Patch10: ksh93-suid_exec.dif +Patch11: ksh93s-fix.dif +Patch12: ksh93-fs3d.dif +Patch13: ksh93-realloc.dif +Patch14: ksh93-keytrap-overflow.dif +Patch15: ksh93-sigint.dif + +%description +The original Korn Shell. The ksh is an sh-compatible command +interpreter that executes commands read from standard input or from a +file. + + + +Authors: +-------- + David Korn + Glenn Fowler + Phong Vo + +%package -n ksh-devel +Summary: Korn Shell development environment +Group: Development/Libraries/C and C++ +Requires: ksh = %{version}-%{release} +AutoReqProv: on + +%description -n ksh-devel +The package includes C header files and the static libraries together +with the shared libraries for linking with other projects. Please be +aware that the CPL licensed code can not be used within GPL licensed +project. + + + +Authors: +-------- + David Korn + Glenn Fowler + Phong Vo + +%prep +%setup -n ksh93 -c -a 0 -a 1 +%patch +%patch1 +%ifarch %arm +%patch2 +%endif +%patch3 +%patch4 +%patch5 +%patch6 +%patch7 +%patch8 +%patch9 +%patch10 +%patch11 +%patch12 +%patch13 +%patch14 +%patch15 + +%build + # + # If _you_ are knowing how to fix this in the autogenerated + # sources of ksh/ast without breaking them, then let me know. + # + IGNORE="-Wno-missing-braces -Wno-unknown-pragmas -Wno-parentheses" + IGNORE="$IGNORE -Wno-char-subscripts -Wno-uninitialized -Wno-implicit" + # + # Do not use -DSHOPT_SPAWN=1 and/or -DSHOPT_AMP=1 this would cause + # errors due race conditions while executing the test suite. + # + FEATURE="-DSHOPT_SYSRC=1 -DSHOPT_REMOTE=1 -DSHOPT_CMDLIB_BLTIN=1" + FEATURE="$FEATURE -DSH_CMDLIB_DIR=\\\"/%{_lib}/ast/bin\\\"" + FEATURE="$FEATURE -DDEFSHELL=\\\"/bin/ksh\\\"" + FEATURE="$FEATURE -DTHISPROG=\\\"/%{_lib}/ast/bin/suid_exec\\\"" + # + # + echo 'int main () { return !(sizeof(void*) >= 8); }' | gcc -x c -o test64 - + if ./test64 ; then + LARGEFILE="" + else + LARGEFILE="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" + fi + rm -f ./test64 + RPM_OPT_FLAGS=$(echo "${RPM_OPT_FLAGS}"|sed -r 's/ +-g[0-9]?//') + CCFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE $LARGEFILE -fPIC" + CCFLAGS="$CCFLAGS -fno-strict-aliasing -g -pipe $IGNORE $FEATURE" + LDFLAGS="-lm" + HOSTTYPE=${RPM_ARCH%%*-linux*} + CC=gcc + mam_cc_L=use + UNIVERSE=att + export CCFLAGS LDFLAGS CC mam_cc_L UNIVERSE + bin/package make CC=$CC cc=$CC + root=$(echo ${PWD}/arch/linux*) + test -d $root || exit 1 + log=${root}/lib/package/gen/make.out + test -s $log || exit 1 + for lib in libast libcmd libdll libshell ; do + obj=$(grep -E "ar *cr *${lib}.a" $log | sed "s@+ *ar *cr *${lib}.a@@") + test $? -eq 0 || exit 1 + case "$lib" in + libshell) + base=src/cmd/ksh93 + vers=$(grep ^VERSION ${base}/Makefile | sed "s@.*\([0-9]\+\.[0-9]\+\).*@\1@") + link="-L${root}/lib/ -Wl,-rpath-link,${root}/lib -Wl,-rpath,/%{_lib}/ast -ldll -lcmd -last -lm -ldl" + ;; + libdll) + base=src/lib/$lib + vers=$(grep :LIBRARY: ${base}/Makefile | sed "s@.*\([0-9]\+\.[0-9]\+\).*@\1@") + link="-L${root}/lib/ -Wl,-rpath-link,${root}/lib -Wl,-rpath,/%{_lib}/ast -ldl -last" + ;; + libcmd) + base=src/lib/$lib + vers=$(grep :LIBRARY: ${base}/Makefile | sed "s@.*\([0-9]\+\.[0-9]\+\).*@\1@") + link="-L${root}/lib/ -Wl,-rpath-link,${root}/lib -Wl,-rpath,/%{_lib}/ast -last" + ;; + libast) + base=src/lib/$lib + vers=$(grep :LIBRARY: ${base}/Makefile | sed "s@.*\([0-9]\+\.[0-9]\+\).*@\1@") + link="-L${root}/lib/ -Wl,-rpath-link,${root}/lib -Wl,-rpath,/%{_lib}/ast" + ;; + esac + soname="-Wl,-soname,${lib}.so.${vers%.*},-stats" + pushd ${root}/${base} + $CC -shared $soname -o ${root}/lib/${lib}.so.${vers} ${obj} $link + ln -sf ${lib}.so.${vers} ${root}/lib/${lib}.so.${vers%.*} + ln -sf ${lib}.so.${vers} ${root}/lib/${lib}.so + popd + done + base=src/cmd/ksh93 + test=${PWD}/${base}/tests + pushd ${root}/${base} + rm -f libshell.a + rm -f ${root}/bin/ksh + rm -f ${root}/bin/shcomp + ksh=$(grep -e '-o ksh' $log | tail -n 1 |\ + sed "s@+ g\?cc@gcc@;s@-o ksh@-o ${root}/bin/ksh@;s@[a-zA-Z0-9_/\.-]*lib\([a-z]\+\)\.a@-l\1@g;s@'@@g") + shcomp=$(grep -e '-o shcomp' $log | tail -n 1 |\ + sed "s@+ g\?cc@gcc@;s@-o shcomp@-o ${root}/bin/shcomp@;s@[a-zA-Z0-9_/\.-]*lib\([a-z]\+\)\.a@-l\1@g;s@'@@g") + suidex=$(grep -e '-o suid_exec' $log | tail -n 1 |\ + sed "s@+ g\?cc@gcc@;s@-o shcomp@-o ${root}/bin/suid_exec@;s@[a-zA-Z0-9_/\.-]*lib\([a-z]\+\)\.a@-l\1@g;s@'@@g") + ${ksh} -Wl,-rpath-link,${root}/lib -Wl,-rpath,/%{_lib}/ast + ${shcomp} -Wl,-rpath-link,${root}/lib -Wl,-rpath,/%{_lib}/ast + ${suidex} -Wl,-rpath-link,${root}/lib -Wl,-rpath,/%{_lib}/ast + pushd ${test} + sleep 5 + LD_LIBRARY_PATH=${root}/lib SHELL=${root}/bin/ksh ${root}/bin/ksh shtests + popd + pushd ${root}/bin + set -- $(LD_LIBRARY_PATH=${root}/lib PATH=$PATH:. shcomp --version 2>&1) + eval version=\${$#} + LD_LIBRARY_PATH=${root}/lib PATH=$PATH:. shcomp --nroff 2>&1 | \ + sed 's/\(\.TH .*\)/\1 "2003-03-02" "" "Korn shell utilities"/' > ../man/man1/shcomp.1 + popd + popd + +%install + root=$(echo ${PWD}/arch/linux*) + test -d $root || exit 1 + pushd $root || exit 1 + mkdir -p %{buildroot}/bin + mkdir -p %{buildroot}%{_bindir} + mkdir -p %{buildroot}/%{_lib}/ast/bin + mkdir -p %{buildroot}%{_includedir}/ast + mkdir -p %{buildroot}%{_libdir}/ast + mkdir -p %{buildroot}%{_mandir} + mkdir %{buildroot}%{_mandir}/man1 + mkdir %{buildroot}%{_mandir}/man3 + mkdir -p %{buildroot}%{_sysconfdir}/permissions.d + install bin/ksh %{buildroot}/%{_lib}/ast/bin/ + install bin/shcomp %{buildroot}/%{_lib}/ast/bin/ +# install bin/suid_exec %{buildroot}/%{_lib}/ast/bin/ + ln -sf /bin/true %{buildroot}/bin/ksh + ln -sf /bin/true %{buildroot}%{_bindir}/ksh + ln -sf /%{_lib}/ast/bin/ksh %{buildroot}%{_bindir}/rksh + ln -sf /%{_lib}/ast/bin/shcomp %{buildroot}%{_bindir}/shcomp + cp -a lib/*.so.* %{buildroot}/%{_lib}/ast/ + for so in %{buildroot}/%{_lib}/ast/*.so.*.* ; do + so=${so##*/} + ln -sf /%{_lib}/ast/$so %{buildroot}%{_libdir}/ast/${so%%%%.*}.so + done + rm -f %{buildroot}%{_libdir}/ast/*.so.* + install -m 0644 lib/*.a %{buildroot}%{_libdir}/ast/ + install -m 0644 man/man1/sh.1 %{buildroot}%{_mandir}/man1/ksh.1 + install -m 0644 man/man1/shcomp.1 %{buildroot}%{_mandir}/man1/shcomp.1 + for man in man/man3/*.3 ; do + man=${man##*/} + ast=${man}ast + install -m 0644 man/man3/${man} %{buildroot}%{_mandir}/man3/${ast} + done + install -m 0644 include/ast/* %{buildroot}%{_includedir}/ast/ + popd + cp lib/package/LICENSES/ast LICENSE + mv src/cmd/ksh93/OBSOLETE src/cmd/ksh93/OBSOLETE.mm + cat src/cmd/ksh93/builtins.mm | sed 's/\\f5/\\fB/g;s/^\.H/\.P\n\.H/g' | troff -Tascii8 -t -mm | grotty -bou > Builtins + cat src/cmd/ksh93/PROMO.mm | sed 's/\\f5/\\fB/g;s/^\.H/\.P\n\.H/g' | troff -Tascii8 -t -mm | grotty -bou > PROMO + cat src/cmd/ksh93/OBSOLETE.mm | sed 's/\\f5/\\fB/g;s/^\.H/\.P\n\.H/g' | troff -Tascii8 -t -mm | grotty -bou > OBSOLETE + cat src/cmd/ksh93/sh.memo | sed 's/\\f5/\\fB/g;s/^\.H/\.P\n\.H/g' | troff -Tascii8 -t -mm | grotty -bou > MEMORANDUM + cp %{SOURCE3} . +# +# (cat > %{buildroot}%{_sysconfdir}/permissions.d/ksh) <<-EOF +# /%{_lib}/ast/bin/suid_exec root:root 4711 +# EOF +# (cat > %{buildroot}%{_sysconfdir}/permissions.d/ksh.paranoid) <<-EOF +# /%{_lib}/ast/bin/suid_exec root:root 0711 +# EOF + +%post +test -e etc/bash.bashrc && ln -sf bash.bashrc etc/ksh.kshrc || true +if test -x %{_lib}/ast/bin/ksh ; then + rm -f bin/ksh + ln -sf /%{_lib}/ast/bin/ksh bin/ksh + rm -f usr/bin/ksh + ln -sf /%{_lib}/ast/bin/ksh usr/bin/ksh +fi + +%postun +if test ! -x %{_lib}/ast/ksh ; then + if test ! -x bin/pdksh ; then + rm -f etc/ksh.kshrc + fi + if test ! -e bin/ksh ; then + rm -f bin/ksh usr/bin/ksh + fi +fi + +%files +%defattr(-,root,root) +#%{_sysconfdir}/permissions.d/ksh +#%{_sysconfdir}/permissions.d/ksh.paranoid +%doc LICENSE src/cmd/ksh93/COMPATIBILITY src/cmd/ksh93/RELEASE* +%doc Builtins PROMO OBSOLETE MEMORANDUM +%doc %{_mandir}/man1/*.1.gz +%ghost %verify(not link) /bin/ksh +%ghost %verify(not link) %{_bindir}/ksh +%{_bindir}/rksh +%{_bindir}/shcomp +%dir /%{_lib}/ast +%dir /%{_lib}/ast/bin +/%{_lib}/ast/bin/ksh +/%{_lib}/ast/bin/shcomp +#%attr(4711,root,root) /%{_lib}/ast/bin/suid_exec +/%{_lib}/ast/*.so.* + +%files -n ksh-devel +%defattr(-,root,root) +%doc LICENSE Warning +%dir %{_libdir}/ast/ +%{_libdir}/ast/*.so +%{_libdir}/ast/*.a +%doc %{_mandir}/man3/* +%{_includedir}/ast/ +%changelog +* Fri Nov 16 2007 - werner@suse.de +- Fix the bug fix, that is decrement current size (bug #341594) +* Fri Nov 16 2007 - werner@suse.de +- Enable signal handling for non-interactive mode (bug #339875) +- Ignore signal QUIT always (bug #339875) +- Ignore signal INT in case of waiting on a job (bug #339875) +- Handle multibyte chars in variable expansion (bug #341594) +* Mon Oct 29 2007 - werner@suse.de +- Work around a double -g problem which breaks debugging builds +* Mon Sep 17 2007 - werner@suse.de +- Update to bugfix version 2007-06-28 of ksh93s+ (bug #263053) + * In vi insert mode, ksh no longer emits a backspace character + before the carriage return when the newline is entered + * A bug in which pipefail would cause a command to return 0 + when the pipeline was the last command and the failure + happened on a component other than the last has been fixed + * A bug in the expansion of ${var/pattern/rep} when pattern + or rep contained a left parenthesis in single quotes has + been fixed + * The braces for a subscripted variable with ${var[sub]} are + now optional when inside [[...]], ((...)) or as a subscript + * A bug in brace expansion in which single and double quotes + did not treat the comma as a literal character has been fixed + * The -p option of whence now disables -v + * Several bug fixes in compound variables and arrays of arrays + have been made + * A bug in which the %%B format of printf was affected by the + locale has been fixed + * A bug in which \ was not removed in the replacement pattern + with ${var/pattern/rep} when it was not followed by \ or a + digit has been fixed + * A bug in which ksh -R file core dumped if no script was + specified has been fixed, it now displays an error message + * Added additional Solaris signals to signal table + * A bug in which a pipeline with command substitution inside + a function could cause a pipeline that invokes this function + to hang when the pipefail option is on has been fixed + * Added -q to whence + * A small memory leak with each redirection of a non-builtin + has been fixed +- Fix many wrong detected limits for Linux like INT_MAX +- Adapt FS3D file system: mount(2) of Linux uses five arguments +- Fix bug in pointer arithmetic: after reallocation the addresses + of the old area of an pointer array are changed (bug #300653) +- Overflow in keytrap(): strncpy(3) does not append ASCII 0 if + buffer is fully used +- This updated version includes fix for bug #268488 +- Enable the AT&T UNIVERSE for ksh as pdksh does, see bug #249783 +* Wed Jun 20 2007 - werner@suse.de +- Fix pointer arithmetics within sh_trim() (bug #284611) +* Tue Jun 19 2007 - werner@suse.de +- Correct bug ID (bug #284580) +* Fri May 25 2007 - werner@suse.de +- Minor issuse like file permissions +* Thu May 03 2007 - werner@suse.de +- Fix string conversion for high unsigned numbers (bug #268488) +* Wed Apr 04 2007 - werner@suse.de +- Minor correction for builtin uname -i +* Mon Apr 02 2007 - werner@suse.de +- Update to ksh93s+ (bug #239215) +- Be sure that iffe can handle option -n even if bash is used +* Fri Mar 30 2007 - werner@suse.de +- Disable AT&T UNIVERSE change +* Wed Mar 28 2007 - werner@suse.de +- Reset exit status in case of catching SIGCONT (bug #254649) +- Use the AT&T UNIVERSE for ksh as pdksh does (bug #249783) +* Fri Jan 12 2007 - werner@suse.de +- Do not use binary OR instead of a logic OR (#233299) +- Help the compile time and run time linker (#233299) +* Mon Nov 20 2006 - werner@suse.de +- Avoid that a sub shell close required file descriptors (#222411) +* Fri Nov 10 2006 - werner@suse.de +- On ia64 a cast of an integer to a character pointer and back to + an long integer may results into an unaligned access, fix this + in the SIGWINCH handler (bug #209643) +* Tue Nov 07 2006 - ro@suse.de +- fix permissions for manpages +* Mon Jul 10 2006 - werner@suse.de +- Don't trim backslash part of a multibyte character away (#189239) +* Tue Jul 04 2006 - werner@suse.de +- Builtin cut: allow last line without newline (#189231) +- Utility shcomp: fix segfault and install it (#189778) +* Tue Jun 27 2006 - werner@suse.de +- No segmentation fault if ksh uses shared command libray (#188404) +* Tue Jun 20 2006 - werner@suse.de +- Make it build even on new beta with new glibc headers +* Wed May 31 2006 - werner@suse.de +- Fix segmentation fault in vi command line mode (bug #179917) +* Mon May 29 2006 - werner@suse.de +- Make -i and -p option of uname builtin work (bug #178962) +* Tue May 09 2006 - werner@suse.de +- Change PreRequire /bin/bash to /etc/bash.bashrc (bug #172633) +* Mon May 08 2006 - werner@suse.de +- Correct order of souring order of the users profile and the + system kshrc files (bug #172753) +* Wed Apr 19 2006 - werner@suse.de +- Do not source system rc files if ksh is not interactive +- Correct string from GMT to UTC for Universal Time Coordinates +* Wed Apr 19 2006 - werner@suse.de +- Fix the patch for the multi byte characters (bug #163665) +* Tue Apr 18 2006 - werner@suse.de +- Fix multi byte handling even for command line mode emacs/vi +* Thu Apr 06 2006 - werner@suse.de +- Handle multi byte characters within macro expansion (bug #163665) +* Mon Mar 27 2006 - werner@suse.de +- Update to ksh 93r +* Wed Jan 25 2006 - mls@suse.de +- converted neededforbuild to BuildRequires +* Tue Dec 20 2005 - werner@suse.de +- Move manual pages of libast to an own subsection 3ast (#140295) +* Fri Dec 16 2005 - werner@suse.de +- Make it build even with bash 3.1 and gcc 4.1.0 +* Thu Nov 17 2005 - uli@suse.de +- disabled some tests on ARM (occasionally hang QEMU) +* Mon Oct 24 2005 - werner@suse.de +- PreReqire the bash to get the system wide bash.bashrc +* Mon Sep 19 2005 - werner@suse.de +- Make it compatible with parallel installed pdksh (bug #105126) +* Mon Sep 19 2005 - werner@suse.de +- Avoid useless gcc warning of autogenerated sources +* Tue Aug 16 2005 - werner@suse.de +- Move to group System/Shells (bug #104920) +* Wed Apr 13 2005 - werner@suse.de +- Make it compile with gcc4 +* Thu Mar 24 2005 - werner@suse.de +- Correct initialization for got_sigwinch variable +* Wed Mar 23 2005 - werner@suse.de +- Update to release date 2005-02-02 (bug #18698, bug #74348) +* Wed Mar 09 2005 - werner@suse.de +- Fix dead link in documentation (bug #71733) +* Fri Feb 04 2005 - werner@suse.de +- More on winsize changes: now it works after a new prompt + just like in the pdksh. +* Fri Feb 04 2005 - schwab@suse.de +- Workaround broken build system and enable building shared libraries on + x86-64. +* Thu Feb 03 2005 - werner@suse.de +- Do not build shared version on x64_86 the ELF macro R_X64_86_32S + breaks that a local symbol +- Make it work on s390x +* Thu Feb 03 2005 - werner@suse.de +- Make winsize changes work +- Enable /etc/ksh.kshrc support +- lchmod is not implemented under Linux +- error_exit does never return +- Enable shared libraries instead of the static ones +- Add a warning about CPL versus GPL +* Wed Feb 02 2005 - werner@suse.de +- Initial version of the AT&T ksh now under CPL1.0 (bug #3698) diff --git a/ksh.changes b/ksh.changes index d49fd81..f0beec0 100644 --- a/ksh.changes +++ b/ksh.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Fri Nov 16 17:16:36 CET 2007 - werner@suse.de + +- Fix the bug fix, that is decrement current size (bug #341594) + +------------------------------------------------------------------- +Fri Nov 16 15:13:36 CET 2007 - werner@suse.de + +- Enable signal handling for non-interactive mode (bug #339875) +- Ignore signal QUIT always (bug #339875) +- Ignore signal INT in case of waiting on a job (bug #339875) +- Handle multibyte chars in variable expansion (bug #341594) + ------------------------------------------------------------------- Mon Oct 29 15:11:30 CET 2007 - werner@suse.de @@ -42,6 +55,8 @@ Mon Sep 17 13:16:53 CEST 2007 - werner@suse.de of the old area of an pointer array are changed (bug #300653) - Overflow in keytrap(): strncpy(3) does not append ASCII 0 if buffer is fully used +- This updated version includes fix for bug #268488 +- Enable the AT&T UNIVERSE for ksh as pdksh does, see bug #249783 ------------------------------------------------------------------- Wed Jun 20 15:15:28 CEST 2007 - werner@suse.de @@ -69,6 +84,16 @@ Mon Apr 2 17:46:01 CEST 2007 - werner@suse.de - Update to ksh93s+ (bug #239215) - Be sure that iffe can handle option -n even if bash is used +------------------------------------------------------------------- +Thu May 3 15:22:49 CEST 2007 - werner@suse.de + +- Fix string conversion for high unsigned numbers (bug #268488) + +------------------------------------------------------------------- +Fri Mar 30 13:27:27 CEST 2007 - werner@suse.de + +- Disable AT&T UNIVERSE change + ------------------------------------------------------------------- Wed Mar 28 14:15:25 CEST 2007 - werner@suse.de diff --git a/ksh.spec b/ksh.spec index 75aa231..f30a1b2 100644 --- a/ksh.spec +++ b/ksh.spec @@ -11,14 +11,17 @@ # norootforbuild Name: ksh -BuildRequires: bind-libs bind-utils bison flex gdbm-devel glibc-devel libbz2-devel ncurses-devel procps psmisc pwdutils zlib-devel +BuildRequires: bind-libs bind-utils bison flex gdbm-devel glibc-devel ncurses-devel procps psmisc pwdutils zlib-devel +%if %suse_version > 1020 +BuildRequires: libbz2-devel +%endif Url: http://www.research.att.com/~gsf/download/ License: Common Public License Version 1.0 (CPL1.0) Group: System/Shells -PreReq: /bin/ln /etc/bash.bashrc /bin/true +PreReq: /bin/ln /bin/rm /etc/bash.bashrc /bin/true AutoReqProv: on Version: 93s -Release: 57 +Release: 62 Summary: Korn Shell BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: INIT.2007-06-28.tar.bz2 @@ -41,6 +44,7 @@ Patch11: ksh93s-fix.dif Patch12: ksh93-fs3d.dif Patch13: ksh93-realloc.dif Patch14: ksh93-keytrap-overflow.dif +Patch15: ksh93-sigint.dif %description The original Korn Shell. The ksh is an sh-compatible command @@ -94,6 +98,7 @@ Authors: %patch12 %patch13 %patch14 +%patch15 %build # @@ -289,6 +294,13 @@ fi %doc %{_mandir}/man3/* %{_includedir}/ast/ %changelog +* Fri Nov 16 2007 - werner@suse.de +- Fix the bug fix, that is decrement current size (bug #341594) +* Fri Nov 16 2007 - werner@suse.de +- Enable signal handling for non-interactive mode (bug #339875) +- Ignore signal QUIT always (bug #339875) +- Ignore signal INT in case of waiting on a job (bug #339875) +- Handle multibyte chars in variable expansion (bug #341594) * Mon Oct 29 2007 - werner@suse.de - Work around a double -g problem which breaks debugging builds * Mon Sep 17 2007 - werner@suse.de @@ -328,17 +340,23 @@ fi of the old area of an pointer array are changed (bug #300653) - Overflow in keytrap(): strncpy(3) does not append ASCII 0 if buffer is fully used +- This updated version includes fix for bug #268488 +- Enable the AT&T UNIVERSE for ksh as pdksh does, see bug #249783 * Wed Jun 20 2007 - werner@suse.de - Fix pointer arithmetics within sh_trim() (bug #284611) * Tue Jun 19 2007 - werner@suse.de - Correct bug ID (bug #284580) * Fri May 25 2007 - werner@suse.de - Minor issuse like file permissions +* Thu May 03 2007 - werner@suse.de +- Fix string conversion for high unsigned numbers (bug #268488) * Wed Apr 04 2007 - werner@suse.de - Minor correction for builtin uname -i * Mon Apr 02 2007 - werner@suse.de - Update to ksh93s+ (bug #239215) - Be sure that iffe can handle option -n even if bash is used +* Fri Mar 30 2007 - werner@suse.de +- Disable AT&T UNIVERSE change * Wed Mar 28 2007 - werner@suse.de - Reset exit status in case of catching SIGCONT (bug #254649) - Use the AT&T UNIVERSE for ksh as pdksh does (bug #249783) diff --git a/ksh93-shift_ijs.dif b/ksh93-shift_ijs.dif index dec958a..3e7b161 100644 --- a/ksh93-shift_ijs.dif +++ b/ksh93-shift_ijs.dif @@ -105,6 +105,47 @@ # endif static int _isalph(int); static int _ismetach(int); +--- src/cmd/ksh93/sh/macro.c ++++ src/cmd/ksh93/sh/macro.c 2007-11-16 14:07:24.000000000 +0000 +@@ -1867,6 +1867,12 @@ static void comsubst(Mac_t *mp,int type) + return; + } + ++#if SHOPT_MULTIBYTE ++#define ismbdig(c) ((state[*(unsigned char*)(c)]==S_DIG)&&(!mbwide()||(mbsize(c)<2))) ++#else ++#define ismbdig(c) (state[*(unsigned char*)(c)]==S_DIG) ++#endif ++ + /* + * copy onto the stack + */ +@@ -1892,6 +1898,16 @@ static void mac_copy(register Mac_t *mp, + /* insert \ before file expansion characters */ + while(size-->0) + { ++#if SHOPT_MULTIBYTE ++ if(mbwide()) ++ { ssize_t len = mbsize(cp); ++ if (len > 1) ++ { cp += len; ++ size -= (len - 1); ++ continue; ++ } ++ } ++#endif /* SHOPT_MULTIBYTE */ + c = state[n= *(unsigned char*)cp++]; + if(nopat&&(c==S_PAT||c==S_ESC||c==S_BRACT||c==S_ENDCH) && mp->pattern!=3) + c=1; +@@ -1899,7 +1914,7 @@ static void mac_copy(register Mac_t *mp, + c=1; + else if(mp->pattern==2 && c==S_SLASH) + c=1; +- else if(mp->pattern==3 && c==S_ESC && (state[*(unsigned char*)cp]==S_DIG||(*cp==ESCAPE))) ++ else if(mp->pattern==3 && c==S_ESC && (ismbdig(cp)||(*cp==ESCAPE))) + { + if(!(c=mp->quote)) + cp++; --- src/cmd/ksh93/sh/string.c +++ src/cmd/ksh93/sh/string.c 2007-03-28 18:23:11.582410000 +0200 @@ -42,7 +42,7 @@ diff --git a/ksh93-sigint.dif b/ksh93-sigint.dif new file mode 100644 index 0000000..8f81b08 --- /dev/null +++ b/ksh93-sigint.dif @@ -0,0 +1,75 @@ +--- src/cmd/ksh93/sh/main.c ++++ src/cmd/ksh93/sh/main.c 2007-11-13 13:07:40.000000000 +0000 +@@ -418,6 +418,7 @@ static void exfile(register Shell_t *shp + sh_onoption(SH_TRACKALL); + sh_offoption(SH_MONITOR); + } ++ sh_sigdone(); + sh_offstate(SH_INTERACTIVE); + sh_offstate(SH_MONITOR); + sh_offstate(SH_HISTORY); +--- src/cmd/ksh93/sh/fault.c ++++ src/cmd/ksh93/sh/fault.c 2007-11-13 13:53:15.000000000 +0000 +@@ -98,12 +98,27 @@ void sh_fault(register int sig) + if(flag&SH_SIGDONE) + { + void *ptr=0; +- if((flag&SH_SIGINTERACTIVE) && sh_isstate(SH_INTERACTIVE) && !sh_isstate(SH_FORKED) && ! shp->subshell) ++ switch (sig) + { +- /* check for TERM signal between fork/exec */ +- if(sig==SIGTERM && job.in_critical) +- shp->trapnote |= SH_SIGTERM; +- return; ++ case SIGINT: ++ if(sh_isstate(SH_FORKED) || shp->subshell) ++ goto out; ++ if(!job.in_critical) ++ goto out; ++ return; ++ case SIGTERM: ++ if(sh_isstate(SH_FORKED) || shp->subshell) ++ break; ++ /* check for TERM signal between fork/exec */ ++ if(job.in_critical) ++ shp->trapnote |= SH_SIGTERM; ++ if((flag&SH_SIGINTERACTIVE) && sh_isstate(SH_INTERACTIVE)) ++ return; ++ break; ++ case SIGQUIT: ++ return; ++ default: ++ break; + } + shp->lastsig = sig; + sigrelease(sig); +@@ -136,6 +151,7 @@ void sh_fault(register int sig) + return; + } + } ++out: + errno = 0; + if(pp->mode==SH_JMPCMD) + shp->lastsig = sig; +--- src/cmd/ksh93/data/signals.c ++++ src/cmd/ksh93/data/signals.c 2007-11-13 13:55:49.000000000 +0000 +@@ -20,6 +20,7 @@ + #include + #include "shtable.h" + #include "fault.h" ++#include "jobs.h" + + #if defined(SIGCLD) && !defined(SIGCHLD) + # define SIGCHLD SIGCLD +@@ -95,9 +96,9 @@ const struct shtable2 shtab_signals[] = + "HUP", VAL(SIGHUP,SH_SIGDONE), S("Hangup"), + "ILL", VAL(SIGILL,SH_SIGDONE), S("Illegal instruction"), + #ifdef JOBS +- "INT", VAL(SIGINT,SH_SIGINTERACTIVE), S("Interrupt"), ++ "INT", VAL(SIGINT,SH_SIGDONE|SH_SIGINTERACTIVE), S("Interrupt"), + #else +- "INT", VAL(SIGINT,SH_SIGINTERACTIVE), "", ++ "INT", VAL(SIGINT,SH_SIGDONE|SH_SIGINTERACTIVE), "", + #endif /* JOBS */ + #ifdef SIGIO + "IO", VAL(SIGIO,SH_SIGIGNORE), S("IO signal"),