diff options
author | dillo <dillo@pkgsrc.org> | 2004-08-15 16:49:49 +0000 |
---|---|---|
committer | dillo <dillo@pkgsrc.org> | 2004-08-15 16:49:49 +0000 |
commit | fc9e44fcdd8eea53f6d8447d7b87354fe528f2c0 (patch) | |
tree | 4fa793ce6cda8f03792059a03fb923c692ff5d41 /pkgtools | |
parent | f83a0d1295d8ddea632e8f5059930e7568981f4d (diff) | |
download | pkgsrc-fc9e44fcdd8eea53f6d8447d7b87354fe528f2c0.tar.gz |
mkpatches: if a patch for a file exists, give the new patch the same name
bump version to 0.114
okayed by wiz
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkgdiff/Makefile | 4 | ||||
-rwxr-xr-x | pkgtools/pkgdiff/files/mkpatches.pl | 30 |
2 files changed, 28 insertions, 6 deletions
diff --git a/pkgtools/pkgdiff/Makefile b/pkgtools/pkgdiff/Makefile index bf0002e9a65..12cd96d5660 100644 --- a/pkgtools/pkgdiff/Makefile +++ b/pkgtools/pkgdiff/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.48 2004/04/11 21:35:21 jschauma Exp $ +# $NetBSD: Makefile,v 1.49 2004/08/15 16:49:49 dillo Exp $ # -DISTNAME= pkgdiff-0.113 +DISTNAME= pkgdiff-0.114 CATEGORIES= pkgtools devel MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/pkgdiff/files/mkpatches.pl b/pkgtools/pkgdiff/files/mkpatches.pl index b72342aafa5..dda53c2f435 100755 --- a/pkgtools/pkgdiff/files/mkpatches.pl +++ b/pkgtools/pkgdiff/files/mkpatches.pl @@ -1,6 +1,6 @@ #!@PERL5@ # -# $NetBSD: mkpatches.pl,v 1.9 2004/01/10 05:40:40 jlam Exp $ +# $NetBSD: mkpatches.pl,v 1.10 2004/08/15 16:49:49 dillo Exp $ # # mkpatches: creates a set of patches patch-aa, patch-ab, ... # in work/.newpatches by looking for *.orig files in and below @@ -19,6 +19,7 @@ use Cwd; use File::Spec; my $patchdir; +my $old_patchdir; my $wrkdir; my $l=0; @@ -52,6 +53,9 @@ EOF $wrkdir=`@MAKE@ show-var VARNAME=WRKDIR` or die ("can't find WRKDIR -- wrong dir?"); chomp($wrkdir); +$old_patchdir=`@MAKE@ show-var VARNAME=PATCHDIR` or + die ("can't find PATCHDIR -- wrong dir?"); +chomp($old_patchdir); if ($opt_d) { $patchdir = cwd()."/$opt_d"; @@ -86,8 +90,7 @@ foreach (sort <handle>) { $new = File::Spec->abs2rel( $complete, $wrksrc ); $old = File::Spec->abs2rel( $path, $wrksrc ); if ( -f $complete ) { - $patchfile = ("aa".."zz")[$l]; - $patchfile =~ s/^/patch-/; + $patchfile = patch_name($new); if ($opt_v) { print "$patchfile -> $complete\n"; } @@ -103,5 +106,24 @@ foreach (sort <handle>) { } else { print ("$new doesn't exist, though $old does\n"); } - $l++; +} + +sub patch_name # filename +{ + my $name = shift; + my $pname, $l; + + $pname = `grep -l -- '^\+\+\+ $name\$' $old_patchdir/patch-*`; + chomp($pname); + if ($pname) { + $pname =~ s!.*/!!; + return $pname; + } + + for ($l=0; ; $l++) { + $pname = 'patch-' . ("aa" .. "zz")[$l]; + if (! -f "$old_patchdir/$pname" and ! -f "$patchdir/$pname") { + return $pname; + } + } } |