bogofilter 0.91.4 "make check" fails on Solaris 8

Matthias Andree matthias.andree at gmx.de
Wed Jun 23 01:37:03 CEST 2004


On Tue, 22 Jun 2004, Matt Christian wrote:

> Bogofilter 0.91.4 "make check" fails on Solaris 8 because of a failed
> trap command in src/tests/t.lock3.

> My current guess is that the issue stems from the combination of using
> /bin/sh in t.lock3 and /usr/xpg4/bin/sh elsewhere in the tests and the
> different traps of these sh versions.

Shell bug :-(

$ /usr/xpg4/bin/sh -c 'trap exit 0; save=$(trap); eval "$save"'
/usr/xpg4/bin/sh: --:  not found

This needs to be reported to Sun.

/usr/xpg4/bin/sh is documented as identical to ksh, and ksh is
documented to allow the exact algorithm shown above to restore traps;
unfortunately, the trap builtin does not strip the -- although it prints
it. Sun cannot ever have tried restoring traps. :-(

> I hacked on src/tests/t.lock3 and src/tests/t.frame for a while but
> couldn't find a solution.  Ideas?

Ditch Solaris for shell processing. :-/

More seriously, file a bug report with sun and hope they'll patch the
shell and let me know the patch numbers that fix the bug so we can list
it.

As a short-term solution, use this patch:

diff -u -c -r1.3 -r1.4
*** src/tests/t.lock3	20 Jun 2004 11:43:31 -0000	1.3
--- src/tests/t.lock3	22 Jun 2004 23:34:09 -0000	1.4
***************
*** 8,24 ****
  # IOPTS used for initialization
  OPTS="-C -d $TMPDIR -M"
  IOPTS=
! if [ "$verbose" ] ; then IOPTS="$IOPTS -v" ; fi
  
  rc=0
  
  $BOGOFILTER $OPTS $IOPTS -n -I ${srcdir}/inputs/good.mbx
  $BOGOFILTER $OPTS $IOPTS -s -I ${srcdir}/inputs/spam.mbx
  
! trap >$TMPDIR/oldtraps
  trap 'kill $pid' 1 2 3
  
! if [ "$verbose" ] ; then echo "#### Part 1 ####" ; fi
  for I in $seq ; do
      (   set +e
  	$BOGOFILTER $OPTS -u -I ${srcdir}/inputs/spam.mbx 
--- 8,27 ----
  # IOPTS used for initialization
  OPTS="-C -d $TMPDIR -M"
  IOPTS=
! if [ $verbose -gt 0 ] ; then IOPTS="$IOPTS -v" ; fi
  
  rc=0
  
  $BOGOFILTER $OPTS $IOPTS -n -I ${srcdir}/inputs/good.mbx
  $BOGOFILTER $OPTS $IOPTS -s -I ${srcdir}/inputs/spam.mbx
  
! oldtraps=`trap`
! case `uname -s` in
!     SunOS)	oldtraps=`echo $oldtraps | sed -e 's/^trap --/trap/g'` ;;
! esac
  trap 'kill $pid' 1 2 3
  
! if [ $verbose -gt 0 ] ; then echo "#### Part 1 ####" ; fi
  for I in $seq ; do
      (   set +e
  	$BOGOFILTER $OPTS -u -I ${srcdir}/inputs/spam.mbx 
***************
*** 30,36 ****
  wait
  pid=
  
! if [ "$verbose" ] ; then echo "#### Part 2 ####" ; fi
  for I in $seq ; do
      (   set +e
  	$BOGOFILTER $OPTS -u -p -I ${srcdir}/inputs/spam.mbx >> ${TMPDIR}.$I.out
--- 33,39 ----
  wait
  pid=
  
! if [ $verbose -gt 0 ] ; then echo "#### Part 2 ####" ; fi
  for I in $seq ; do
      (   set +e
  	$BOGOFILTER $OPTS -u -p -I ${srcdir}/inputs/spam.mbx >> ${TMPDIR}.$I.out
***************
*** 43,49 ****
  pid=
  
  trap - 1 2 3
! . $TMPDIR/oldtraps
  
  # check for program failures
  test "x`grep -v 0 $TMPDIR/exits`" = x
--- 46,52 ----
  pid=
  
  trap - 1 2 3
! eval "$oldtraps"
  
  # check for program failures
  test "x`grep -v 0 $TMPDIR/exits`" = x

-- 
Matthias Andree

Encrypted mail welcome: my GnuPG key ID is 0x052E7D95



More information about the Bogofilter mailing list