From c81913902bae3f6dd6918c77a868b210b91ce3d944c12258e56c243ea6171d3e Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Mon, 8 Mar 2010 16:20:52 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/shells/ksh?expand=0&rev=27 --- ksh.changes | 6 ++++++ ksh.spec | 55 ++++++++++++++++++++++++++++++----------------------- 2 files changed, 37 insertions(+), 24 deletions(-) diff --git a/ksh.changes b/ksh.changes index 4c4459e..18cccc6 100644 --- a/ksh.changes +++ b/ksh.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Mar 8 15:10:07 CET 2010 - werner@suse.de + +- Make it build for SLES10 and SLES9 +- Check if the shell used for build ignores SIGPIPE + ------------------------------------------------------------------- Fri Mar 5 20:07:06 UTC 2010 - guido+opensuse.org@berhoerster.name diff --git a/ksh.spec b/ksh.spec index 239d361..609dd41 100644 --- a/ksh.spec +++ b/ksh.spec @@ -19,13 +19,12 @@ Name: ksh -BuildRequires: bind-libs bind-utils bison flex gdbm-devel glibc-devel ncurses-devel procps psmisc pwdutils zlib-devel +BuildRequires: bind-utils bison flex gdbm-devel glibc-devel ncurses-devel procps psmisc pwdutils zlib-devel %if %suse_version > 1020 -BuildRequires: libbz2-devel +BuildRequires: bind-libs libbz2-devel %endif %if %suse_version > 1120 BuildRequires: update-alternatives -BuildRequires: gcc43 %endif Url: http://www.research.att.com/~gsf/download/ License: Common Public License Version 1.0 (CPL1.0) @@ -136,36 +135,39 @@ find share/ -type d -a -empty | xargs -r rm -vrf %endif %build + typeset -i IGNORED=0x$(ps --no-headers -o ignored $$) + typeset -i SIGPIPE=0x1000 + if ((IGNORED & SIGPIPE)) ; then + # Warn ans show signal state of this working shell + echo Warning: signal SIGPIPE is ignored by this shell 1>&2 + ps s $$ 1>&2 + fi # This package failed when testing with -Wl,-as-needed being default. - # So we disable it here, if you want to retest, just delete this comment and the line below. + # So we disable it here, if you want to retest, just delete this + # comment and the line below. export SUSE_ASNEEDED=0 test -n "${!LC_*}" && unset "${!LC_*}" -%if %suse_version > 1120 - CC=gcc-4.3 -%else CC=gcc -%endif cflags () { local flag=$1; shift - case "${RPM_OPT_FLAGS}" in + local var=$1; shift + test -n "${flag}" -a -n "${var}" || return + case "${!var}" in *${flag}*) return esac - test -z "$1" && return case "$flag" in -Wl,*) set -o noclobber echo 'int main () { return 0; }' > ldtest.c - if $CC -Werror $flag -o /dev/null -xc ldtest.c > /dev/null 2>&1 ; then - local var=$1; shift + if ${CC:-gcc} -Werror $flag -o /dev/null -xc ldtest.c > /dev/null 2>&1 ; then eval $var=\${$var:+\$$var\ }$flag fi set +o noclobber rm -f ldtest.c ;; *) - if $CC -Werror $flag -S -o /dev/null -xc /dev/null > /dev/null 2>&1 ; then - local var=$1; shift + if ${CC:-gcc} -Werror $flag -S -o /dev/null -xc /dev/null > /dev/null 2>&1 ; then eval $var=\${$var:+\$$var\ }$flag fi esac @@ -177,9 +179,14 @@ find share/ -type d -a -empty | xargs -r rm -vrf # 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" - IGNORE="$IGNORE -Wno-unused-value -Wno-unused-variable -Wno-type-limits" + cflags -Wno-missing-braces IGNORE + cflags -Wno-unknown-pragmas IGNORE + cflags -Wno-parentheses IGNORE + cflags -Wno-char-subscripts IGNORE + cflags -Wno-uninitialized IGNORE + cflags -Wno-implicit IGNORE + cflags -Wno-unused-value IGNORE + cflags -Wno-type-limits IGNORE # # Do not use -DSHOPT_SPAWN=1 and/or -DSHOPT_AMP=1 this would cause # errors due race conditions while executing the test suite. @@ -318,13 +325,13 @@ find share/ -type d -a -empty | xargs -r rm -vrf typeset -i failed=0 ln -sf ${root}/lib ${test}/../ ${root}/bin/ksh.test shtests + killall -q -s 9 ${root}/bin/ksh.test || true ${root}/bin/ksh.test %{S:10} ${root}/bin/ksh.test %{S:11} -%if %suse_version <= 1120 - # This fails in current factory (aka next 11.3) it - # seems not to be the gcc as gcc-4.3 also fails - ${root}/bin/ksh.test -c 'g="false"; trap "print -u2 PIPED; \$g && exit 0 ; g=true" PIPE ; while true ; do echo hello ; done' | head -n 10 -%endif + if test $((IGNORED & SIGPIPE)) -eq 0 ; then + # This may fail in current factory (aka next 11.3) + ${root}/bin/ksh.test -c 'g="false"; trap "print -u2 PIPED; \$g && exit 0 ; g=true" PIPE ; while true ; do echo hello ; done' | head -n 10 + fi killall -q -s 9 ${root}/bin/ksh.test || true popd pushd ${root}/bin @@ -445,8 +452,8 @@ fi %if %suse_version > 1120 %preun -if [ $1 -eq 0 ]; then - /usr/sbin/update-alternatives --remove ksh /%{_lib}/ast/bin/ksh +if test $1 -eq 0 ; then + %{_sbindir}/update-alternatives --remove ksh /%{_lib}/ast/bin/ksh fi %endif