Sat Feb 16 22:21:35 2008 UTC ()
In both mkpatches.pl and patchdiff.pl, ignore a leading "./" when
parsing a file name from the "+++" line in an old patch file.  (New
patch files created by mkpatches do not have "./" in the file name in
the "+++" line, but some old patches currently in pkgsrc do have "./"
there.)

Bump version to 0.120.


(apb)
diff -r1.64 -r1.65 pkgsrc/pkgtools/pkgdiff/Makefile
diff -r1.12 -r1.13 pkgsrc/pkgtools/pkgdiff/files/mkpatches.pl
diff -r1.8 -r1.9 pkgsrc/pkgtools/pkgdiff/files/patchdiff.pl

cvs diff -r1.64 -r1.65 pkgsrc/pkgtools/pkgdiff/Makefile (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgdiff/Makefile 2007/10/01 09:54:32 1.64
+++ pkgsrc/pkgtools/pkgdiff/Makefile 2008/02/16 22:21:35 1.65
@@ -1,18 +1,17 @@ @@ -1,18 +1,17 @@
1# $NetBSD: Makefile,v 1.64 2007/10/01 09:54:32 rillig Exp $ 1# $NetBSD: Makefile,v 1.65 2008/02/16 22:21:35 apb Exp $
2# 2#
3 3
4DISTNAME= pkgdiff-0.119 4DISTNAME= pkgdiff-0.120
5PKGREVISION= 1 
6CATEGORIES= pkgtools devel 5CATEGORIES= pkgtools devel
7MASTER_SITES= # empty 6MASTER_SITES= # empty
8DISTFILES= # empty 7DISTFILES= # empty
9 8
10MAINTAINER= wiz@NetBSD.org 9MAINTAINER= wiz@NetBSD.org
11HOMEPAGE= ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/doc/pkgsrc.html 10HOMEPAGE= ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/doc/pkgsrc.html
12COMMENT= Tools to create, maintain and send back patches for pkgsrc 11COMMENT= Tools to create, maintain and send back patches for pkgsrc
13 12
14PKG_INSTALLATION_TYPES= overwrite pkgviews 13PKG_INSTALLATION_TYPES= overwrite pkgviews
15PKG_DESTDIR_SUPPORT= user-destdir 14PKG_DESTDIR_SUPPORT= user-destdir
16 15
17EXTRACT_ONLY= # empty 16EXTRACT_ONLY= # empty
18NO_CHECKSUM= yes 17NO_CHECKSUM= yes

cvs diff -r1.12 -r1.13 pkgsrc/pkgtools/pkgdiff/files/mkpatches.pl (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgdiff/files/mkpatches.pl 2005/12/13 12:05:08 1.12
+++ pkgsrc/pkgtools/pkgdiff/files/mkpatches.pl 2008/02/16 22:21:35 1.13
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1#!@PERL5@ 1#!@PERL5@
2# 2#
3# $NetBSD: mkpatches.pl,v 1.12 2005/12/13 12:05:08 wiz Exp $ 3# $NetBSD: mkpatches.pl,v 1.13 2008/02/16 22:21:35 apb Exp $
4# 4#
5# mkpatches: creates a set of patches patch-aa, patch-ab, ... 5# mkpatches: creates a set of patches patch-aa, patch-ab, ...
6# in work/.newpatches by looking for *.orig files in and below 6# in work/.newpatches by looking for *.orig files in and below
7# WRKDIR and comparing them to the corresponding changed file. All 7# WRKDIR and comparing them to the corresponding changed file. All
8# files are then referrenced relative to WRKSRC. 8# files are then referrenced relative to WRKSRC.
9# 9#
10# It should be called from the packages directory, 10# It should be called from the packages directory,
11# e.g. /usr/pkgsrc/example/test 11# e.g. /usr/pkgsrc/example/test
12# 12#
13# It retains the naming and header (RCS Id and comment) from the 13# It retains the naming and header (RCS Id and comment) from the
14# patches directory. 14# patches directory.
15# 15#
16# Copyright (c) 2000 by Thomas Klausner <wiz@NetBSD.org> 16# Copyright (c) 2000 by Thomas Klausner <wiz@NetBSD.org>
@@ -128,26 +128,27 @@ sub analyze_old_patches  @@ -128,26 +128,27 @@ sub analyze_old_patches
128 %old_header = (); 128 %old_header = ();
129 %old_filename = (); 129 %old_filename = ();
130 130
131 open(HANDLE, "ls $old_patchdir/patch-* 2>/dev/null |"); 131 open(HANDLE, "ls $old_patchdir/patch-* 2>/dev/null |");
132 132
133 while ($filename = <HANDLE>) { 133 while ($filename = <HANDLE>) {
134 chomp $filename; 134 chomp $filename;
135 $patch = `sed '/^\+\+\+/ q' $filename`; 135 $patch = `sed '/^\+\+\+/ q' $filename`;
136 if (!($patch =~ m/^\+\+\+ ([^\t\n]*)(\n$|\t)/m)) { 136 if (!($patch =~ m/^\+\+\+ ([^\t\n]*)(\n$|\t)/m)) {
137 warn "cannot extract filename from patch $filename"; 137 warn "cannot extract filename from patch $filename";
138 next; 138 next;
139 } 139 }
140 $name = $1; 140 $name = $1;
 141 $name =~ s/^\.\///; # ignore leading "./", if any.
141 $patch =~ s/\n--- .*/\n/s; 142 $patch =~ s/\n--- .*/\n/s;
142 $old_header{$name} = $patch; 143 $old_header{$name} = $patch;
143 $filename =~ s!.*/!!; 144 $filename =~ s!.*/!!;
144 $old_filename{$name} = $filename; 145 $old_filename{$name} = $filename;
145 } 146 }
146 147
147 close(HANDLE); 148 close(HANDLE);
148} 149}
149 150
150 151
151sub patch_name # filename 152sub patch_name # filename
152{ 153{
153 my $name = shift; 154 my $name = shift;

cvs diff -r1.8 -r1.9 pkgsrc/pkgtools/pkgdiff/files/patchdiff.pl (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgdiff/files/patchdiff.pl 2007/07/12 15:35:43 1.8
+++ pkgsrc/pkgtools/pkgdiff/files/patchdiff.pl 2008/02/16 22:21:35 1.9
@@ -1,42 +1,43 @@ @@ -1,42 +1,43 @@
1#!@PERL5@ 1#!@PERL5@
2# 2#
3# $NetBSD: patchdiff.pl,v 1.8 2007/07/12 15:35:43 joerg Exp $ 3# $NetBSD: patchdiff.pl,v 1.9 2008/02/16 22:21:35 apb Exp $
4# 4#
5# patchdiff: compares a set of patches patch-aa, patch-ab, ... in 5# patchdiff: compares a set of patches patch-aa, patch-ab, ... in
6# $WRKDIR/.newpatches in the with another set in patches. 6# $WRKDIR/.newpatches in the with another set in patches.
7# 7#
8# Copyright (c) 2000 by Dieter Baron <dillo@giga.or.at> and 8# Copyright (c) 2000 by Dieter Baron <dillo@giga.or.at> and
9# Thomas Klausner <wiz@NetBSD.org>  9# Thomas Klausner <wiz@NetBSD.org>
10# All Rights Reserved. Absolutely no warranty.  10# All Rights Reserved. Absolutely no warranty.
11 11
12use Getopt::Std; 12use Getopt::Std;
13use Cwd; 13use Cwd;
14use File::Spec; 14use File::Spec;
15 15
16my $oldpatchdir, $newpatchdir; 16my $oldpatchdir, $newpatchdir;
17my $wrkdir, $thisdir; 17my $wrkdir, $thisdir;
18my %orig, %new; 18my %orig, %new;
19 19
20sub getfilename { 20sub getfilename {
21 my $fname=shift; 21 my $fname=shift;
22 local $_; 22 local $_;
23 local *handle; 23 local *handle;
24 open(handle, $fname); 24 open(handle, $fname);
25 while (<handle>) { 25 while (<handle>) {
26 next unless m/^\+\+\+[ ]([^ ]*)/; 26 next unless m/^\+\+\+[ ]([^ ]*)/;
27 close(handle); 27 close(handle);
28 $_ = $1; 28 $_ = $1;
29 chomp(); 29 chomp();
 30 s/^\.\///; # ignore leading "./", if any.
30 return $_; 31 return $_;
31 } 32 }
32 close(handle); 33 close(handle);
33 return undef; 34 return undef;
34} 35}
35 36
36sub putinhash { 37sub putinhash {
37 my $hash=shift; 38 my $hash=shift;
38 my $files=shift; 39 my $files=shift;
39 my $temp; 40 my $temp;
40 local *handle; 41 local *handle;
41 open(handle, "ls $files|"); 42 open(handle, "ls $files|");
42 while(<handle>) { 43 while(<handle>) {