diff --git a/infrastructure/build/update-patches b/infrastructure/build/update-patches index 852be0598a7..b94dded1e83 100644 --- a/infrastructure/build/update-patches +++ b/infrastructure/build/update-patches @@ -1,6 +1,6 @@ #!/bin/sh -# $OpenBSD: update-patches,v 1.9 2003/07/30 11:10:34 jolan Exp $ +# $OpenBSD: update-patches,v 1.10 2004/06/20 19:11:08 sturm Exp $ # Copyright (c) 2000 # Marc Espie. All rights reserved. # Redistribution and use in source and binary forms, with or without @@ -24,13 +24,6 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -# Require GNU diff for now -if [ ! -x "`which gdiff`" ]; then - echo 1>&2 "Fatal: GNU diff (gdiff) is required for 'update-patches'" - echo 1>&2 " It may be installed from the textproc/gdiff port." - exit 1 -fi - # Find out all $PATCHORIG files and strip the name to what diff will use cd $WRKDIST && find . -type f -name '*'${PATCHORIG} | fgrep -v $DISTORIG | \ sed -e "s,^./\(.*\)\.${PATCHORIG#.*}\$,\1," | { @@ -61,11 +54,11 @@ do # found it, splice before diff part with diff esc=`echo $file | sed -e 's,/,\\\\/,g'` { sed -e "/^--- $esc$PATCHORIG/,\$ d" <$i - (cd $WRKDIST && gdiff ${DIFF_ARGS} -u -p $file$PATCHORIG $file) } >$i.new + (cd $WRKDIST && diff ${DIFF_ARGS} -u -p $file$PATCHORIG $file) } >$i.new # did it change ? mark it as changed - if gdiff ${DIFF_ARGS} -u \ - --ignore-matching-lines="^--- $file$PATCHORIG .*" \ - --ignore-matching-lines="^+++ $file .*" $i $i.new 1>&2 + if diff ${DIFF_ARGS} -u \ + -I "^--- `echo $file$PATCHORIG | sed 's/[.+]/\\\\&/g'` " \ + -I "^\+\+\+ `echo $file | sed 's/[.+]/\\\\&/g'` " $i $i.new 1>&2 then rm $i.new else @@ -82,7 +75,7 @@ do patchname=patch-`echo $file|sed -e s,[/.],_,g` echo 1>&2 "No patch-* found for $file, creating $patchname" { echo "$"OpenBSD$; \ - (cd $WRKDIST && gdiff ${DIFF_ARGS} -u -p $file$PATCHORIG $file) }>$patchname + (cd $WRKDIST && diff ${DIFF_ARGS} -u -p $file$PATCHORIG $file) }>$patchname edit="$edit $patchname" accounted="$accounted $patchname" done @@ -109,7 +102,7 @@ do esac done -# Check for $Id: update-patches,v 1.9 2003/07/30 11:10:34 jolan Exp $ and similar bugs in all those patch files. +# Check for $Id: update-patches,v 1.10 2004/06/20 19:11:08 sturm Exp $ and similar bugs in all those patch files. for i in $accounted do if sed -e '/1,^---/ d' $i|grep '$(Id|OpenBSD'