From 2732270edfa468fce9361dcdd7c08bec3925b381 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 9 Jun 2015 17:15:31 +0100 Subject: [PATCH] Fixed handling of delete-file diffs from git (bug #1226985). --- patchutils-bz1226985.patch | 51 ++++++++++++++++++++++++++++++++++++++ patchutils.spec | 12 ++++++++- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 patchutils-bz1226985.patch diff --git a/patchutils-bz1226985.patch b/patchutils-bz1226985.patch new file mode 100644 index 0000000..05cfd73 --- /dev/null +++ b/patchutils-bz1226985.patch @@ -0,0 +1,51 @@ +diff -up patchutils-0.3.4/Makefile.am.bz1226985 patchutils-0.3.4/Makefile.am +--- patchutils-0.3.4/Makefile.am.bz1226985 2015-04-14 17:32:18.000000000 +0100 ++++ patchutils-0.3.4/Makefile.am 2015-06-09 17:13:52.497904051 +0100 +@@ -216,7 +216,8 @@ TESTS = tests/newline1/run-test \ + tests/stdin/run-test \ + tests/splitdiffD/run-test \ + tests/fullheader1/run-test \ +- tests/fullheader2/run-test ++ tests/fullheader2/run-test \ ++ tests/fullheader3/run-test + + # These ones don't work yet. + # Feel free to send me patches. :-) +diff -up patchutils-0.3.4/src/filterdiff.c.bz1226985 patchutils-0.3.4/src/filterdiff.c +--- patchutils-0.3.4/src/filterdiff.c.bz1226985 2015-04-14 17:13:07.000000000 +0100 ++++ patchutils-0.3.4/src/filterdiff.c 2015-06-09 17:13:52.498904087 +0100 +@@ -910,7 +910,7 @@ out: + return ret; + } + +-#define MAX_HEADERS 5 ++#define MAX_HEADERS 6 + static int filterdiff (FILE *f, const char *patchname) + { + static unsigned long linenum = 1; +diff -up patchutils-0.3.4/tests/fullheader3/run-test.bz1226985 patchutils-0.3.4/tests/fullheader3/run-test +--- patchutils-0.3.4/tests/fullheader3/run-test.bz1226985 2015-06-09 17:13:52.498904087 +0100 ++++ patchutils-0.3.4/tests/fullheader3/run-test 2015-06-09 17:13:52.498904087 +0100 +@@ -0,0 +1,22 @@ ++#!/bin/sh ++ ++# This is a filterdiff(1) testcase. ++# Handle git format-patch output containing remove-file diffs. ++# From: https://bugzilla.redhat.com/show_bug.cgi?id=1226985 ++ ++. ${top_srcdir-.}/tests/common.sh ++ ++cat <<"EOF" > git-output ++diff --git a/a b/a ++deleted file mode 100644 ++index 7898192..0000000 ++--- a/a +++++ /dev/null ++@@ -1 +0,0 @@ ++-a ++EOF ++ ++${FILTERDIFF} git-output 2>errors >output || { cat errors; exit 1; } ++[ -s errors ] && { cat errors; exit 1; } ++cmp git-output output || exit 1 ++exit 0 diff --git a/patchutils.spec b/patchutils.spec index d4bfa6e..49ec10d 100644 --- a/patchutils.spec +++ b/patchutils.spec @@ -1,15 +1,17 @@ Summary: A collection of programs for manipulating patch files Name: patchutils Version: 0.3.4 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: Applications/System URL: http://cyberelk.net/tim/patchutils/ Source0: http://cyberelk.net/tim/data/patchutils/stable/%{name}-%{version}.tar.xz +Patch1: patchutils-bz1226985.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Obsoletes: interdiff <= 0.0.10 Provides: interdiff = 0.0.10 BuildRequires: xmlto +BuildRequires: automake, autoconf # We only need xmlto if we are patching the documentation. # BuildRequires: xmlto @@ -23,6 +25,11 @@ patches, and simply listing the files modified by a patch. %prep %setup -q +# Fixed handling of delete-file diffs from git (bug #1226985). +%patch1 -p1 -b .bz1226985 + +autoreconf + %build touch doc/patchutils.xml %configure @@ -45,6 +52,9 @@ rm -rf %{buildroot} %{_mandir}/*/* %changelog +* Tue Jun 9 2015 Tim Waugh - 0.3.4-2 +- Fixed handling of delete-file diffs from git (bug #1226985). + * Mon Apr 20 2015 Tim Waugh - 0.3.4-1 - 0.3.4.