diff options
author | rillig <rillig@pkgsrc.org> | 2006-10-07 07:57:04 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2006-10-07 07:57:04 +0000 |
commit | 9e1e55709c732cdc183d072e184c9aba6733fec6 (patch) | |
tree | 13fb92988145b39eb41b7564757c911edf7b74f8 /pkgtools | |
parent | afd105e728cbcab0c4e57b55288492f45b6b22f4 (diff) | |
download | pkgsrc-9e1e55709c732cdc183d072e184c9aba6733fec6.tar.gz |
When patch files are registered in the distinfo file, but not added or
committed to CVS, a warning is printed.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 8e966649c6c..3319f48adb9 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -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_DESCR($) { 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 @@ sub checkfile_distinfo($) { $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 @@ sub checkfile_distinfo($) { } } - 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 @@ sub checkfile_distinfo($) { } 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'."); + } } } } |