twaugh / patchutils

Manipulate patch files
GNU General Public License v2.0
138 stars 22 forks source link

interdiff does not generate correct output #47

Closed Rhialto closed 3 years ago

Rhialto commented 3 years ago

long.1.txt long.2.txt

If I do interdiff long.1.txt long.2.txt I get this, which must be wrong (both patches to the CC= and CFLAG= lines are the same, so there is no additional patch:

$ interdiff long.1.txt long.2.txt 
reverted:
--- makefile    Thu Jan  5 05:07:23 1995
+++ makefile.old        Thu Aug  8 09:34:44 1991
@@ -18,13 +18,13 @@

 MAKE = make          # needed for some systems e.g. older BSD

+CC = cc
+CFLAGS =
-#CC = cc
-#CFLAGS =
 MODEL =
 EXTRA = -DBIG_MEM -DNDEBUG
 LINTFLAGS = -DLINT
+OPTIM = -O
+DESTDIR = /usr/local/bin
-OPTIM = $(CFLAGS)
-DESTDIR = $(PREFIX)/bin

 #List of all object files created for Zoo
 ZOOOBJS = addbfcrc.o addfname.o basename.o comment.o crcdefs.o \
@@ -67,7 +67,7 @@
        @echo "lint_turboc:  Run lint under **IX for checking Turbo C/MSDOS code"

 # install alpha zoo as "tzoo"
+install:
-inst_test:
        mv zoo $(DESTDIR)/tzoo

 # install beta zoo as "bzoo"
@@ -75,9 +75,8 @@
        mv zoo $(DESTDIR)/bzoo

 # install production zoo as "zoo"
+inst_prod:
+       mv zoo $(DESTDIR)/zoo
-install:
-       $(INSTALL) $(COPY) $(STRIP) -o $(BINOWN) -g $(BINGRP) -m $(BINMODE) $(TARGETS) $(DESTDIR)
-       $(INSTALL) -c -o $(BINOWN) -g $(BINGRP) -m 444 zoo.1 fiz.1 $(PREFIX)/man/man1

 # executable targets
 TARGETS = zoo fiz

short.1.txt short.2.txt

If I apply interdiff only to the makefile part of the patches, the result looks ok:

$ interdiff short.1.txt short.2.txt 
diff -u makefile makefile
--- makefile    Thu Jan  5 05:07:23 1995
+++ makefile    Sat Feb  7 18:20:15 1998
@@ -76,8 +76,8 @@

 # install production zoo as "zoo"
 install:
-       $(INSTALL) $(COPY) $(STRIP) -o $(BINOWN) -g $(BINGRP) -m $(BINMODE) $(TARGETS) $(DESTDIR)
-       $(INSTALL) -c -o $(BINOWN) -g $(BINGRP) -m 444 zoo.1 fiz.1 $(PREFIX)/man/man1
+       $(INSTALL_PROGRAM) $(TARGETS) $(DESTDIR)
+       $(INSTALL_DATA) zoo.1 fiz.1 $(PREFIX)/man/man1

 # executable targets
 TARGETS = zoo fiz
Rhialto commented 3 years ago

I was trying version 0.3.4 for this. 0.4.2 seems to have fixed that.