From: Colm MacCarthaigh Date: Mon, 23 Jan 2006 19:02:26 +0000 (+0000) Subject: Merge r125495 and r126224 from trunk: X-Git-Tag: 2.0.56~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=108a7e218d27536a3394ad83f41dcce0ca66c409;p=thirdparty%2Fapache%2Fhttpd.git Merge r125495 and r126224 from trunk: * support/check_forensic: Fix temp file usage Submitted By: Javier Fernandez-Sanguino Pen~a Reviewed By: Thom May * support/check_forensic: Fix script on platforms that do not have either mktemp or tempfile (such as Solaris). Also tested on Darwin & FreeBSD. Submitted by: jerenkrantz git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x@371622 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 0705a2dace8..d63e387b459 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.0.56 + *) support/check_forensic: Fix temp file usage + [Javier Fernandez-Sanguino Pen~a ] + *) Chunk filter: Fix chunk filter to create correct chunks in the case that a flush bucket is surrounded by data buckets. [Ruediger Pluem] diff --git a/STATUS b/STATUS index 8f7a4e1deea..e80a92e4b9f 100644 --- a/STATUS +++ b/STATUS @@ -128,19 +128,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK: nd: I'm going to reverse the default jerenkrantz, striker: I'm confused as to the status of this backport. - *) support/check_forensic: Fix tempfile usage - svn rev 125495, 126224 - jerenkrantz says: r126224 fixes brokenness with r125495 on Solaris. - +1: thommay, jerenkrantz, trawick - trawick: "which" isn't portable; I've suggested a work-around on dev@ - (not standing in way of backport) - jorton said: NetBSD's which isn't sufficient either. - jerenkrantz: Since it's not in the critical path (and depends on - mod_log_forensic), I think it's still worth it to backport - it as-is. For the one or two platforms that don't like - which, they can write their own version of the script. - (jorton agrees) - *) Win32: Move call to mpm_service_install to the rewrite_args hook from the post_config hook. http://svn.apache.org/viewcvs?view=rev&rev=154319 diff --git a/support/check_forensic b/support/check_forensic index a3b530917bd..3c8123fcbb7 100755 --- a/support/check_forensic +++ b/support/check_forensic @@ -7,9 +7,45 @@ F=$1 -cut -f 1 -d '|' $F > /tmp/fc-all.$$ -grep + < /tmp/fc-all.$$ | cut -c2- | sort > /tmp/fc-in.$$ -grep -- - < /tmp/fc-all.$$ | cut -c2- | sort > /tmp/fc-out.$$ +temp_create_method=file +if test -f `which mktemp`; then + temp_create_method=mktemp +elif test -f `which tempfile`; then + temp_create_method=tempfile +fi + +create_temp() +{ + prefix=$1 + case "$temp_create_method" in + file) + name="/tmp/$1.$$" + ;; + mktemp) + name=`mktemp -t $1.XXXXXX` + ;; + tempfile) + name=`tempfile --prefix=$1` + ;; + *) + echo "$0: Cannot create temporary file" + exit 1 + ;; + esac +} + +create_temp fcall +all=$name +create_temp fcin +in=$name +create_temp fcout +out=$name +trap "rm -f -- \"$all\" \"$in\" \"$out\";" 0 1 2 3 13 15 + +cut -f 1 -d '|' $F > $all +grep + < $all | cut -c2- | sort > $in +grep -- - < $all | cut -c2- | sort > $out + # use -i instead of -I for GNU xargs -join -v 1 /tmp/fc-in.$$ /tmp/fc-out.$$ | xargs -I xx egrep "^\\+xx" $F -rm /tmp/fc-all.$$ /tmp/fc-in.$$ /tmp/fc-out.$$ +join -v 1 $in $out | xargs -I xx egrep "^\\+xx" $F +exit 0