pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/pkgtools/pkgdiff
Module Name: pkgsrc
Committed By: hauke
Date: Wed Aug 21 13:00:06 UTC 2019
Modified Files:
pkgsrc/pkgtools/pkgdiff: Makefile
pkgsrc/pkgtools/pkgdiff/files: mkpatches.pl
Log Message:
Properly preserve patch comments when working with a readonly pkgsrc tree.
Do not prefix an absolute path argument with $cwd.
Declare a handful of variables, and 'use warnings'.
Fixes PR pkg/54485
To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 pkgsrc/pkgtools/pkgdiff/Makefile
cvs rdiff -u -r1.21 -r1.22 pkgsrc/pkgtools/pkgdiff/files/mkpatches.pl
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/pkgtools/pkgdiff/Makefile
diff -u pkgsrc/pkgtools/pkgdiff/Makefile:1.94 pkgsrc/pkgtools/pkgdiff/Makefile:1.95
--- pkgsrc/pkgtools/pkgdiff/Makefile:1.94 Sun Aug 11 13:22:36 2019
+++ pkgsrc/pkgtools/pkgdiff/Makefile Wed Aug 21 13:00:06 2019
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.94 2019/08/11 13:22:36 wiz Exp $
+# $NetBSD: Makefile,v 1.95 2019/08/21 13:00:06 hauke Exp $
PKGNAME= pkgdiff-1.8
-PKGREVISION= 4
+PKGREVISION= 5
CATEGORIES= pkgtools devel
MAINTAINER= wiz%NetBSD.org@localhost
Index: pkgsrc/pkgtools/pkgdiff/files/mkpatches.pl
diff -u pkgsrc/pkgtools/pkgdiff/files/mkpatches.pl:1.21 pkgsrc/pkgtools/pkgdiff/files/mkpatches.pl:1.22
--- pkgsrc/pkgtools/pkgdiff/files/mkpatches.pl:1.21 Wed Feb 10 16:00:10 2016
+++ pkgsrc/pkgtools/pkgdiff/files/mkpatches.pl Wed Aug 21 13:00:06 2019
@@ -1,6 +1,6 @@
#!@PERL5@
#
-# $NetBSD: mkpatches.pl,v 1.21 2016/02/10 16:00:10 wiz Exp $
+# $NetBSD: mkpatches.pl,v 1.22 2019/08/21 13:00:06 hauke Exp $
#
# mkpatches: creates a set of patches patch-aa, patch-ab, ...
# in work/.newpatches by looking for *.orig files in and below
@@ -39,24 +39,29 @@
# POSSIBILITY OF SUCH DAMAGE.
#
+use warnings;
+
use Getopt::Std;
use Cwd;
use File::Spec;
+my $prog;
+my $patchfile;
my $patchdir;
+my $origpatchdir;
my $old_patchdir;
my $wrkdir;
my $wrksrc;
my %old_filename;
my %old_header;
-# create patchdir, or empty it if already existing
+# create patchdir, and populate with existing patches
sub create_patchdir {
if (! -d $patchdir) {
mkdir($patchdir, 0755);
- if (-d $origpatchdir && "$origpatchdir" != "$patchdir") {
- system("cp", "$origpatchdir/p*", "$patchdir");
+ if (-d $origpatchdir && "$origpatchdir" ne "$patchdir") {
+ system("cp $origpatchdir/p* $patchdir");
}
}
}
@@ -114,7 +119,8 @@ $origpatchdir = get_variable("PATCHDIR")
if ($opt_D) {
$patchdir = "$wrkdir/.newpatches";
} elsif ($opt_d) {
- if (-d "/$opt_d") {
+ if ($opt_d =~ /^\//) {
+ # Do not prefix an absolute path
$patchdir = $opt_d;
} else {
my $pwd = cwd();
@@ -168,6 +174,7 @@ if ($opt_w) {
# create patches
foreach (sort <HANDLE>) {
+ my $diff;
my ($path, $complete);
my ($new, $old);
chomp();
@@ -231,6 +238,8 @@ sub analyze_old_patches
sub move_away_old_patches
{
+ my $filename;
+
open(HANDLE, "ls $patchdir/patch-* 2>/dev/null |");
while ($filename = <HANDLE>) {
Home |
Main Index |
Thread Index |
Old Index