summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkgdiff/Makefile4
-rwxr-xr-xpkgtools/pkgdiff/files/mkpatches.pl44
2 files changed, 24 insertions, 24 deletions
diff --git a/pkgtools/pkgdiff/Makefile b/pkgtools/pkgdiff/Makefile
index cf712326d32..bafe227b4d6 100644
--- a/pkgtools/pkgdiff/Makefile
+++ b/pkgtools/pkgdiff/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.10 2001/03/16 13:11:41 wiz Exp $
+# $NetBSD: Makefile,v 1.11 2001/03/31 17:24:03 skrll Exp $
#
-DISTNAME= pkgdiff-0.97
+DISTNAME= pkgdiff-0.98
CATEGORIES= pkgtools devel
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/pkgtools/pkgdiff/files/mkpatches.pl b/pkgtools/pkgdiff/files/mkpatches.pl
index 82aae5a43f5..2e9dfda2a64 100755
--- a/pkgtools/pkgdiff/files/mkpatches.pl
+++ b/pkgtools/pkgdiff/files/mkpatches.pl
@@ -1,11 +1,13 @@
#!@PREFIX@/bin/perl
#
-# $NetBSD: mkpatches.pl,v 1.3 2000/08/15 14:43:42 abs Exp $
+# $NetBSD: mkpatches.pl,v 1.4 2001/03/31 17:24:03 skrll Exp $
#
# mkpatches: creates a set of patches patch-aa, patch-ab, ...
# in work/.newpatches by looking for *.orig files in and below
-# WRKSRC and comparing them to the corresponding changed file. It
-# should be called from the packages directory,
+# WRKDIR and comparing them to the corresponding changed file. All
+# files are then referrenced relative to WRKSRC.
+#
+# It should be called from the packages directory,
# e.g. /usr/pkgsrc/example/test
#
# Copyright (c) 2000 by Thomas Klausner <wiz@netbsd.org>
@@ -14,23 +16,12 @@
use Getopt::Std;
use Cwd;
+use File::Spec;
my $patchdir;
my $wrkdir;
my $l=0;
-# change to WRKSRC
-
-sub goto_wrksrcdir {
- my $wrksrc;
-
- $wrksrc=`make show-var VARNAME=WRKSRC` or
- die ("can't find WRKSRC -- wrong dir?");
- chomp($wrksrc);
-
- chdir $wrksrc or die ("can't cd to WRKSRC ($wrksrc)");
-}
-
# create patchdir, or empty it if already existing
sub create_patchdir {
@@ -68,33 +59,42 @@ else {
$patchdir="$wrkdir"."/.newpatches";
}
-goto_wrksrcdir();
create_patchdir();
+# get WRKSRC
+
+$wrksrc=`make show-var VARNAME=WRKSRC` or
+ die ("can't find WRKSRC -- wrong dir?");
+chomp($wrksrc);
+
+chdir $wrksrc or die ("can't cd to WRKSRC ($wrksrc)");
+
# find files
-open(handle, "find . -type f -name \\\*.orig |");
+open(handle, "find ${wrkdir} -type f -name \\\*.orig |");
# create patches
foreach (sort <handle>) {
my $path, $complete;
+ my $new, $old;
chomp();
$path = $_;
- $path =~ s/^..//;
$complete = $path;
$complete =~ s/.orig$//;
+ $new = File::Spec->abs2rel( $complete, $wrksrc );
+ $old = File::Spec->abs2rel( $path, $wrksrc );
if ( -f $complete ) {
$patchfile = ("aa".."zz")[$l];
$patchfile =~ s/^/patch-/;
- $diff=`pkgdiff $path $complete`;
+ $diff=`pkgdiff $old $new`;
if ( "$diff" eq "" ) {
- print ("$complete and $path don't differ\n");
+ print ("$new and $old don't differ\n");
} else {
- system("pkgdiff $path $complete > $patchdir/$patchfile");
+ system("pkgdiff $old $new > $patchdir/$patchfile");
}
} else {
- print ("$complete doesn't exist, though $path does");
+ print ("$new doesn't exist, though $old does");
}
$l++;
}