summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkgtools/pkgdiff/Makefile5
-rwxr-xr-xpkgtools/pkgdiff/files/mkpatches.pl28
2 files changed, 19 insertions, 14 deletions
diff --git a/pkgtools/pkgdiff/Makefile b/pkgtools/pkgdiff/Makefile
index 5ac9ff508bd..e4f0350e05c 100644
--- a/pkgtools/pkgdiff/Makefile
+++ b/pkgtools/pkgdiff/Makefile
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.88 2015/09/08 18:47:01 joerg Exp $
+# $NetBSD: Makefile,v 1.89 2015/09/15 08:36:07 wiz Exp $
-PKGNAME= pkgdiff-1.6
-PKGREVISION= 1
+PKGNAME= pkgdiff-1.7
CATEGORIES= pkgtools devel
MAINTAINER= wiz@NetBSD.org
diff --git a/pkgtools/pkgdiff/files/mkpatches.pl b/pkgtools/pkgdiff/files/mkpatches.pl
index 65609eb42f2..c538c20fd97 100755
--- a/pkgtools/pkgdiff/files/mkpatches.pl
+++ b/pkgtools/pkgdiff/files/mkpatches.pl
@@ -1,6 +1,6 @@
#!@PERL5@
#
-# $NetBSD: mkpatches.pl,v 1.19 2015/02/03 22:50:27 abs Exp $
+# $NetBSD: mkpatches.pl,v 1.20 2015/09/15 08:36:07 wiz Exp $
#
# mkpatches: creates a set of patches patch-aa, patch-ab, ...
# in work/.newpatches by looking for *.orig files in and below
@@ -13,7 +13,7 @@
# It retains the naming and header (RCS Id and comment) from the
# patches directory.
#
-# Copyright (c) 2000, 2011 by Thomas Klausner <wiz@NetBSD.org>
+# Copyright (c) 2000, 2011, 2015 by Thomas Klausner <wiz@NetBSD.org>
# 2004 by Dieter Baron <dillo@NetBSD.org>
# All rights reserved.
#
@@ -61,6 +61,18 @@ sub create_patchdir {
}
}
+sub get_variable {
+ my ($variable) = shift;
+ my ($value);
+
+ $value = `@MAKE@ show-var VARNAME=$variable`;
+ if (${^CHILD_ERROR_NATIVE} == 0) {
+ chomp($value);
+ return $value;
+ }
+ die("error executing \"make show-var VARNAME=$variable\": returned with exit code " . (${^CHILD_ERROR_NATIVE} >> 8));
+}
+
# read command line arguments
undef($opt_c);
@@ -95,15 +107,9 @@ if ($opt_d && $opt_D) {
# get some pkgsrc variables
-$wrksrc=`@MAKE@ show-var VARNAME=WRKSRC` or
- die ("can't find WRKSRC -- wrong dir?");
-chomp($wrksrc);
-$wrkdir=`@MAKE@ show-var VARNAME=WRKDIR` or
- die ("can't find WRKDIR -- wrong dir?");
-chomp($wrkdir);
-$origpatchdir=`@MAKE@ show-var VARNAME=PATCHDIR` or
- die ("can't find PATCHDIR -- wrong dir?");
-chomp($origpatchdir);
+$wrksrc = get_variable("WRKSRC");
+$wrkdir = get_variable("WRKDIR");
+$origpatchdir = get_variable("PATCHDIR");
if ($opt_D) {
$patchdir = "$wrkdir/.newpatches";