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.diff -r1.64 -r1.65 pkgsrc/pkgtools/pkgdiff/Makefile
(apb)
@@ -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 | |||
4 | DISTNAME= pkgdiff-0.119 | 4 | DISTNAME= pkgdiff-0.120 | |
5 | PKGREVISION= 1 | |||
6 | CATEGORIES= pkgtools devel | 5 | CATEGORIES= pkgtools devel | |
7 | MASTER_SITES= # empty | 6 | MASTER_SITES= # empty | |
8 | DISTFILES= # empty | 7 | DISTFILES= # empty | |
9 | 8 | |||
10 | MAINTAINER= wiz@NetBSD.org | 9 | MAINTAINER= wiz@NetBSD.org | |
11 | HOMEPAGE= ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/doc/pkgsrc.html | 10 | HOMEPAGE= ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/doc/pkgsrc.html | |
12 | COMMENT= Tools to create, maintain and send back patches for pkgsrc | 11 | COMMENT= Tools to create, maintain and send back patches for pkgsrc | |
13 | 12 | |||
14 | PKG_INSTALLATION_TYPES= overwrite pkgviews | 13 | PKG_INSTALLATION_TYPES= overwrite pkgviews | |
15 | PKG_DESTDIR_SUPPORT= user-destdir | 14 | PKG_DESTDIR_SUPPORT= user-destdir | |
16 | 15 | |||
17 | EXTRACT_ONLY= # empty | 16 | EXTRACT_ONLY= # empty | |
18 | NO_CHECKSUM= yes | 17 | NO_CHECKSUM= yes |
@@ -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 | |||
151 | sub patch_name # filename | 152 | sub patch_name # filename | |
152 | { | 153 | { | |
153 | my $name = shift; | 154 | my $name = shift; |
@@ -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 | |||
12 | use Getopt::Std; | 12 | use Getopt::Std; | |
13 | use Cwd; | 13 | use Cwd; | |
14 | use File::Spec; | 14 | use File::Spec; | |
15 | 15 | |||
16 | my $oldpatchdir, $newpatchdir; | 16 | my $oldpatchdir, $newpatchdir; | |
17 | my $wrkdir, $thisdir; | 17 | my $wrkdir, $thisdir; | |
18 | my %orig, %new; | 18 | my %orig, %new; | |
19 | 19 | |||
20 | sub getfilename { | 20 | sub 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 | |||
36 | sub putinhash { | 37 | sub 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>) { |