pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files When patch files are registered...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6e864f7973ae
branches:  trunk
changeset: 519657:6e864f7973ae
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Oct 07 07:57:04 2006 +0000

description:
When patch files are registered in the distinfo file, but not added or
committed to CVS, a warning is printed.

diffstat:

 pkgtools/pkglint/files/pkglint.pl |  30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)

diffs (66 lines):

diff -r 9a5204dfd0fc -r 6e864f7973ae pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Sat Oct 07 07:50:59 2006 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Sat Oct 07 07:57:04 2006 +0000
@@ -1,5 +1,5 @@
 #! @PERL@
-# $NetBSD: pkglint.pl,v 1.679 2006/10/06 18:58:55 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.680 2006/10/07 07:57:04 rillig Exp $
 #
 
 # pkglint - static analyzer and checker for pkgsrc packages
@@ -6296,7 +6296,7 @@
 
 sub checkfile_distinfo($) {
        my ($fname) = @_;
-       my ($lines, %in_distinfo, $current_fname, $state);
+       my ($lines, %in_distinfo, $current_fname, $state, $patches_dir);
 
        use constant DIS_start  => 0;
        use constant DIS_SHA1   => 0;   # same as DIS_start
@@ -6322,6 +6322,13 @@
                $lines->[1]->explain_note("This is merely for aesthetical purposes.");
        }
 
+       $patches_dir = $patchdir;
+       if (!defined($patches_dir) && -d "${current_dir}/patches") {
+               $patches_dir = "patches";
+       } else {
+               # it stays undefined.
+       }
+
        $current_fname = undef;
        $state = DIS_start;
        foreach my $line (@{$lines}[2..$#{$lines}]) {
@@ -6396,8 +6403,13 @@
                        }
                }
 
-               if ($is_patch) {
-                       if (open(PATCH, "< ${current_dir}/${patchdir}/${chksum_fname}")) {
+               if ($is_patch && defined($patches_dir)) {
+                       my $fname = "${current_dir}/${patches_dir}/${chksum_fname}";
+                       if (!is_committed($fname)) {
+                               $line->log_warning("${patches_dir}/${chksum_fname} is registered in distinfo but not added to CVS.");
+                       }
+
+                       if (open(PATCH, "<", $fname)) {
                                my $data = "";
                                foreach my $patchline (<PATCH>) {
                                        $data .= $patchline unless $patchline =~ qr"\$NetBSD";
@@ -6418,10 +6430,12 @@
        }
        checklines_trailing_empty_lines($lines);
 
-       foreach my $patch (<${current_dir}/$patchdir/patch-*>) {
-               $patch = basename($patch);
-               if (!exists($in_distinfo{$patch})) {
-                       log_error($fname, NO_LINE_NUMBER, "$patch is not recorded. Rerun '".conf_make." makepatchsum'.");
+       if (defined($patches_dir)) {
+               foreach my $patch (<${current_dir}/${patches_dir}/patch-*>) {
+                       $patch = basename($patch);
+                       if (!exists($in_distinfo{$patch})) {
+                               log_error($fname, NO_LINE_NUMBER, "$patch is not recorded. Rerun '".conf_make." makepatchsum'.");
+                       }
                }
        }
 }



Home | Main Index | Thread Index | Old Index