From f7a772c2f872ed1b5b4a69c9c55f1281cbee625a Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Mon, 23 Jan 2006 13:16:22 +0000 Subject: - configure.ac: Require GNU patch 2.4+. - quilt/import.in: Don't use diff -U-1. - Test suite: Recognize output of old versions of patch (from jayvdb@gmail.com). --- configure.ac | 45 ++++++++++++++++++++++----------------------- quilt.changes | 13 +++++++++++-- quilt/import.in | 4 ++-- test/conflicts.test | 2 +- test/example1.test | 2 +- test/new.test | 2 +- 6 files changed, 38 insertions(+), 30 deletions(-) diff --git a/configure.ac b/configure.ac index a3056c7..91addbf 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT([quilt],[0.42],[quilt-dev@nongnu.org]) AC_CONFIG_AUX_DIR(config) AC_PREREQ(2.53) -AC_REVISION ($Revision: 1.65 $) +AC_REVISION ($Revision: 1.66 $) PACKAGE_RELEASE=1 AC_SUBST(PACKAGE_RELEASE) @@ -205,29 +205,28 @@ fi QUILT_COMPAT_PROG_PATH(DIFF, diff) QUILT_COMPAT_PROG_PATH(PATCH, patch) -# Sun's patch is a mess, issue a warning. But we are going to continue with -# the build because you might just be lucky. -AC_MSG_CHECKING([whether $PATCH will work]) -if $PATCH -v 2>&1 | grep "Sun" >/dev/null; then - AC_MSG_RESULT(no) - AC_MSG_WARN([ -Sorry, you have a Sun version of patch which is notoriously buggy. $PACKAGE_NAME -may function correctly, or minor errors may occur due to Sun's patch tool. -Please consider upgrading to GNU patch, if you already have GNU patch then you -can supply its path with the '--with-patch=' option. -]) -elif $PATCH --version 2>&1 | grep "patch 2.0" >/dev/null; then - AC_MSG_RESULT(no) - AC_MSG_WARN([ -Sorry, the version of patch you are using can cause severe problems when a patch -creates a directory. $PACKAGE_NAME may well function correctly with this version -of patch or small problems could creep in. -Please consider upgrading your patch to a more recent version, if you already -have a more recent version of patch then you can supply its path with the -'--with-patch=' option. -]) +# Sun's patch, and others, do not work because GNU patch options are used. +AC_MSG_CHECKING([the version of $PATCH]) +if $PATCH --version 2> /dev/null | grep -q GNU ; then + set -- `$PATCH --version 2> /dev/null` + patch_version=$2 + AC_MSG_RESULT($patch_version) + saved_IFS=$IFS; IFS='.' + set -- $patch_version + IFS=$saved_IFS + set -- `echo $1 | tr -cd 0-9` `echo $2 | tr -cd 0-9` + if test 0$1 -lt 2 || test 0$1 -eq 2 -a 0$2 -lt 4 ; then + patch_version= + fi else - AC_MSG_RESULT(yes) + AC_MSG_RESULT(no GNU patch) +fi +if test -z "$patch_version" ; then + AC_MSG_ERROR([ +$PACKAGE_NAME requires at least version 2.4 of GNU patch. You can download a +current version of patch from ftp.gnu.org, or if you already have GNU patch +then you can supply its path with the '--with-patch=' option. +]) fi QUILT_COMPAT_PROG_PATH(FIND, find) diff --git a/quilt.changes b/quilt.changes index befcc8a..06bf3ee 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,8 +1,17 @@ +------------------------------------------------------------------- +Mon Jan 23 13:51:29 CET 2006 - agruen@suse.de + +- configure.ac: Require GNU patch 2.4+. +- quilt/import.in: Don't use diff -U-1. +- Test suite: Recognize output of old versions of patch (from + jayvdb@gmail.com). + ------------------------------------------------------------------- Mon Jan 23 13:05:48 CET 2006 - jayvdb@gmail.com -- Check if awk supports sub(). -- Syntax changes in patchfns for Solaris /usr/xpg4/bin/awk. +- configure.ac: Check if awk supports sub(). +- quilt/scripts/patchfns.in: Syntax changes for Solaris + /usr/xpg4/bin/awk. ------------------------------------------------------------------- Mon Jan 23 11:58:20 CET 2006 - agruen@suse.de diff --git a/quilt/import.in b/quilt/import.in index 82e390b..f9a06b0 100644 --- a/quilt/import.in +++ b/quilt/import.in @@ -59,8 +59,8 @@ merge_patches() if [ -z "$opt_desc" ] then - local diff=$(diff -U-1 <(echo "$old_desc") \ - <(echo "$new_desc") \ + local diff=$(diff -U 1024 <(echo "$old_desc") \ + <(echo "$new_desc") \ | sed -e '1,2d') if [ -n "$diff" ] then diff --git a/test/conflicts.test b/test/conflicts.test index f543678..6afa905 100644 --- a/test/conflicts.test +++ b/test/conflicts.test @@ -66,7 +66,7 @@ anymore, then the patch is fixed. $ quilt push -qf > Applying patch %{P}a.diff - >~ 1 out of 2 hunks FAILED -- saving rejects to file `?one.txt.rej'? + >~ 1 out of 2 hunks FAILED -- saving rejects to (file )?`?one.txt.rej'? > Applied patch %{P}a.diff (forced; needs refresh) $ mv one.txt one.x diff --git a/test/example1.test b/test/example1.test index 6212f89..fabb362 100644 --- a/test/example1.test +++ b/test/example1.test @@ -101,7 +101,7 @@ Or ``quilt edit Oberon.txt'' > Applying patch %{P}flower.diff >~ patching file `?Oberon.txt'? > Hunk #1 FAILED at 2. - >~ 1 out of 1 hunk FAILED -- saving rejects to file `?Oberon.txt.rej'? + >~ 1 out of 1 hunk FAILED -- saving rejects to (file )?`?Oberon.txt.rej'? > Applied patch %{P}flower.diff (forced; needs refresh) $ cat >> Oberon.txt diff --git a/test/new.test b/test/new.test index 31211dc..f71d4ed 100644 --- a/test/new.test +++ b/test/new.test @@ -28,7 +28,7 @@ > Applying patch %{P}p.diff >~ patching file `?f'? > Hunk #1 FAILED at 1. - >~ 1 out of 1 hunk FAILED -- saving rejects to file `?f.rej'? + >~ 1 out of 1 hunk FAILED -- saving rejects to (file )?`?f.rej'? >~ patching file `?g'? > Applied patch %{P}p.diff (forced; needs refresh) -- cgit