Thu Dec 4 18:07:52 2008 UTC ()
Added explicit checks for share/icons/hicolor directories in PLISTs, as
suggested by wiz.


(rillig)
diff -r1.792 -r1.793 pkgsrc/pkgtools/pkglint/files/pkglint.pl

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

--- pkgsrc/pkgtools/pkglint/files/Attic/pkglint.pl 2008/12/02 09:00:28 1.792
+++ pkgsrc/pkgtools/pkglint/files/Attic/pkglint.pl 2008/12/04 18:07:52 1.793
@@ -1,15 +1,15 @@ @@ -1,15 +1,15 @@
1#! @PERL@ 1#! @PERL@
2# $NetBSD: pkglint.pl,v 1.792 2008/12/02 09:00:28 rillig Exp $ 2# $NetBSD: pkglint.pl,v 1.793 2008/12/04 18:07:52 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#
@@ -7410,26 +7410,29 @@ sub checkfile_PLIST($) { @@ -7410,26 +7410,29 @@ sub checkfile_PLIST($) {
7410 $line->log_warning("Please add \"USE_DIRS+= $ids[0]\" to the package Makefile and remove this line."); 7410 $line->log_warning("Please add \"USE_DIRS+= $ids[0]\" to the package Makefile and remove this line.");
7411 } else { 7411 } else {
7412 my $s = join(" or ", map { "\"USE_DIRS+= $_\"" } @ids); 7412 my $s = join(" or ", map { "\"USE_DIRS+= $_\"" } @ids);
7413 $line->log_warning("Please add $s to the package Makefile and remove this line."); 7413 $line->log_warning("Please add $s to the package Makefile and remove this line.");
7414 } 7414 }
7415 if (!exists($all_dirs->{$arg})) { 7415 if (!exists($all_dirs->{$arg})) {
7416 $line->log_warning("The PLIST does not contain files for \"$arg\"."); 7416 $line->log_warning("The PLIST does not contain files for \"$arg\".");
7417 $line->explain_warning( 7417 $line->explain_warning(
7418"A package should only remove those directories that it created. When", 7418"A package should only remove those directories that it created. When",
7419"there are no files in the directory, it is unlikely that the package", 7419"there are no files in the directory, it is unlikely that the package",
7420"created the directory."); 7420"created the directory.");
7421 } 7421 }
7422 7422
 7423 if ($pkgpath ne "graphics/hicolor-icon-theme" && $arg =~ m"^share/icons/hicolor(?:$|/)") {
 7424 $line->log_warning("Please .include \"../../graphics/hicolor-icon-theme/buildlink3.mk\" and remove this line.");
 7425 }
7423 } elsif ($cmd eq "imake-man") { 7426 } elsif ($cmd eq "imake-man") {
7424 my (@args) = split(/\s+/, $arg); 7427 my (@args) = split(/\s+/, $arg);
7425 if (@args != 3) { 7428 if (@args != 3) {
7426 $line->log_warning("Invalid number of arguments for imake-man."); 7429 $line->log_warning("Invalid number of arguments for imake-man.");
7427 } else { 7430 } else {
7428 if ($args[2] eq "\${IMAKE_MANNEWSUFFIX}") { 7431 if ($args[2] eq "\${IMAKE_MANNEWSUFFIX}") {
7429 warn_about_PLIST_imake_mannewsuffix($line); 7432 warn_about_PLIST_imake_mannewsuffix($line);
7430 } 7433 }
7431 } 7434 }
7432 7435
7433 } else { 7436 } else {
7434 $line->log_warning("Unknown PLIST directive \"\@$cmd\"."); 7437 $line->log_warning("Unknown PLIST directive \"\@$cmd\".");
7435 } 7438 }
@@ -7557,26 +7560,29 @@ sub checkfile_PLIST($) { @@ -7557,26 +7560,29 @@ sub checkfile_PLIST($) {
7557 7560
7558 } elsif ($text =~ m"^share/doc/html/") { 7561 } elsif ($text =~ m"^share/doc/html/") {
7559 $opt_warn_plist_depr and $line->log_warning("Use of \"share/doc/html\" is deprecated. Use \"share/doc/\${PKGBASE}\" instead."); 7562 $opt_warn_plist_depr and $line->log_warning("Use of \"share/doc/html\" is deprecated. Use \"share/doc/\${PKGBASE}\" instead.");
7560 7563
7561 } elsif (defined($effective_pkgbase) && $text =~ m"^share/doc/\Q${effective_pkgbase}\E/") { 7564 } elsif (defined($effective_pkgbase) && $text =~ m"^share/doc/\Q${effective_pkgbase}\E/") {
7562 # Fine. 7565 # Fine.
7563 7566
7564 } elsif (defined($effective_pkgbase) && $text =~ m"^share/examples/\Q${effective_pkgbase}\E/") { 7567 } elsif (defined($effective_pkgbase) && $text =~ m"^share/examples/\Q${effective_pkgbase}\E/") {
7565 # Fine. 7568 # Fine.
7566 7569
7567 } elsif (defined($effective_pkgbase) && $text =~ m"^share/\Q${effective_pkgbase}\E/") { 7570 } elsif (defined($effective_pkgbase) && $text =~ m"^share/\Q${effective_pkgbase}\E/") {
7568 # Fine. 7571 # Fine.
7569 7572
 7573 } elsif ($pkgpath ne "graphics/hicolor-icon-theme" && $text =~ m"^share/icons/hicolor/icon-theme\.cache") {
 7574 $line->log_error("Please .include \"../../graphics/hicolor-icon-theme/buildlink3.mk\" and remove this line.");
 7575
7570 } elsif ($text =~ m"^share/info/") { 7576 } elsif ($text =~ m"^share/info/") {
7571 $line->log_warning("Info pages should be installed into info/, not share/info/."); 7577 $line->log_warning("Info pages should be installed into info/, not share/info/.");
7572 $line->explain_warning( 7578 $line->explain_warning(
7573"To fix this, you should add INFO_FILES=yes to the package Makefile."); 7579"To fix this, you should add INFO_FILES=yes to the package Makefile.");
7574 7580
7575 } elsif ($text =~ m"^share/locale/[\w\@_]+/LC_MESSAGES/[^/]+\.mo$") { 7581 } elsif ($text =~ m"^share/locale/[\w\@_]+/LC_MESSAGES/[^/]+\.mo$") {
7576 # Fine. 7582 # Fine.
7577 7583
7578 } elsif ($text =~ m"^share/man/") { 7584 } elsif ($text =~ m"^share/man/") {
7579 $line->log_warning("Man pages should be installed into man/, not share/man/."); 7585 $line->log_warning("Man pages should be installed into man/, not share/man/.");
7580 7586
7581 } else { 7587 } else {
7582 $opt_debug_unchecked and $line->log_debug("Unchecked pathname \"${text}\"."); 7588 $opt_debug_unchecked and $line->log_debug("Unchecked pathname \"${text}\".");