Thu Feb 14 00:27:19 2008 UTC ()
Improved the wording of the explanation for empty PLISTs. Related to
PR 38022.


(rillig)
diff -r1.763 -r1.764 pkgsrc/pkgtools/pkglint/files/pkglint.pl

cvs diff -r1.763 -r1.764 pkgsrc/pkgtools/pkglint/files/Attic/pkglint.pl (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkglint/files/Attic/pkglint.pl 2008/02/13 20:14:49 1.763
+++ pkgsrc/pkgtools/pkglint/files/Attic/pkglint.pl 2008/02/14 00:27:19 1.764
@@ -1,15 +1,15 @@ @@ -1,15 +1,15 @@
1#! @PERL@ 1#! @PERL@
2# $NetBSD: pkglint.pl,v 1.763 2008/02/13 20:14:49 reed Exp $ 2# $NetBSD: pkglint.pl,v 1.764 2008/02/14 00:27:19 rillig Exp $
3# 3#
4 4
5# pkglint - static analyzer and checker for pkgsrc packages 5# pkglint - static analyzer and checker for pkgsrc packages
6# 6#
7# Written by: 7# Written by:
8# Roland Illig <rillig@NetBSD.org> 8# Roland Illig <rillig@NetBSD.org>
9# 9#
10# Based on work by: 10# Based on work by:
11# Hubert Feyrer <hubertf@NetBSD.org> 11# Hubert Feyrer <hubertf@NetBSD.org>
12# Thorsten Frueauf <frueauf@NetBSD.org> 12# Thorsten Frueauf <frueauf@NetBSD.org>
13# Thomas Klausner <wiz@NetBSD.org> 13# Thomas Klausner <wiz@NetBSD.org>
14# and others. 14# and others.
15# 15#
@@ -7533,34 +7533,35 @@ sub checkfile_PLIST($) { @@ -7533,34 +7533,35 @@ sub checkfile_PLIST($) {
7533 if (!($lines = load_file($fname))) { 7533 if (!($lines = load_file($fname))) {
7534 log_error($fname, NO_LINE_NUMBER, "Cannot be read."); 7534 log_error($fname, NO_LINE_NUMBER, "Cannot be read.");
7535 return; 7535 return;
7536 } 7536 }
7537 if (@{$lines} == 0) { 7537 if (@{$lines} == 0) {
7538 log_error($fname, NO_LINE_NUMBER, "Must not be empty."); 7538 log_error($fname, NO_LINE_NUMBER, "Must not be empty.");
7539 return; 7539 return;
7540 } 7540 }
7541 checkline_rcsid($lines->[0], "\@comment "); 7541 checkline_rcsid($lines->[0], "\@comment ");
7542 7542
7543 if (@$lines == 1) { 7543 if (@$lines == 1) {
7544 $lines->[0]->log_warning("PLIST files shouldn't be empty."); 7544 $lines->[0]->log_warning("PLIST files shouldn't be empty.");
7545 $lines->[0]->explain_warning( 7545 $lines->[0]->explain_warning(
7546 
7547"One reason for empty PLISTs is that this is a newly created package", 7546"One reason for empty PLISTs is that this is a newly created package",
7548"and that the author didn't run \"bmake print-PLIST\" after installing", 7547"and that the author didn't run \"bmake print-PLIST\" after installing",
7549"the files.", 7548"the files.",
7550"", 7549"",
7551"Another reason, common for Perl packages, is that the PLIST is", 7550"Another reason, common for Perl packages, is that the final PLIST is",
7552"automatically generated. Since there is no use of the empty PLIST file,", 7551"automatically generated. Since the source PLIST is not used at all,",
7553"it shouldn't be necessary. Also PLIST is not needed for meta packages."); 7552"you can remove it.",
 7553"",
 7554"Meta packages also don't need a PLIST file.");
7554 } 7555 }
7555 7556
7556 # Get the list of all files from the PLIST. 7557 # Get the list of all files from the PLIST.
7557 my $all_files = {}; 7558 my $all_files = {};
7558 my $all_dirs = {}; 7559 my $all_dirs = {};
7559 my $extra_lines = []; 7560 my $extra_lines = [];
7560 if (basename($fname) eq "PLIST.common_end") { 7561 if (basename($fname) eq "PLIST.common_end") {
7561 my $common_lines = load_file(dirname($fname) . "/PLIST.common"); 7562 my $common_lines = load_file(dirname($fname) . "/PLIST.common");
7562 if ($common_lines) { 7563 if ($common_lines) {
7563 $extra_lines = $common_lines; 7564 $extra_lines = $common_lines;
7564 } 7565 }
7565 } 7566 }
7566 7567