Skip to content

Commit

Permalink
gdiff die, die, die
Browse files Browse the repository at this point in the history
from Jared Yanovich
  • Loading branch information
Nikolay Sturm committed Jun 20, 2004
1 parent a8722d7 commit 2302886
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions infrastructure/build/update-patches
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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," | {
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -109,7 +102,7 @@ do
esac
done

# Check for $Id: update-patches,v 1.8 2002/07/24 11:54:21 nino Exp $ and similar bugs in all those patch files.
# Check for $Id: update-patches,v 1.9 2003/07/30 11:10:34 jolan Exp $ and similar bugs in all those patch files.
for i in $accounted
do
if sed -e '/1,^---/ d' $i|grep '$(Id|OpenBSD'
Expand Down

0 comments on commit 2302886

Please sign in to comment.