pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Remove USE_DIRS handling.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/894d0245cbab
branches:  trunk
changeset: 562160:894d0245cbab
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Wed Jul 22 09:13:49 2009 +0000

description:
Remove USE_DIRS handling.
Warn about obsolete @dirrm.
Add an XXX for hicolor-icon-theme check.

diffstat:

 pkgtools/pkglint/files/makevars.map |  12 +-------
 pkgtools/pkglint/files/pkglint.pl   |  52 +++++-------------------------------
 2 files changed, 9 insertions(+), 55 deletions(-)

diffs (114 lines):

diff -r ca3aa0e84bb2 -r 894d0245cbab pkgtools/pkglint/files/makevars.map
--- a/pkgtools/pkglint/files/makevars.map       Wed Jul 22 09:05:23 2009 +0000
+++ b/pkgtools/pkglint/files/makevars.map       Wed Jul 22 09:13:49 2009 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: makevars.map,v 1.195 2009/06/13 06:30:25 rillig Exp $
+# $NetBSD: makevars.map,v 1.196 2009/07/22 09:13:49 wiz Exp $
 #
 
 # This file contains the guessed type of some variables, according to
@@ -701,16 +701,6 @@
 USE_BUILTIN.*          YesNo_Indirectly [builtin.mk:s]
 USE_CMAKE              Yes [$package]
 USE_CROSSBASE          Yes [m:s]
-USE_DIRS               List of {                                       \
-                               gnome1-1.0 gnome1-1.5                   \
-                               gnome2-1.3 gnome2-1.5 gnome2-1.6        \
-                               kde3-1.0 kde4-1.0                       \
-                               texmf-1.0 texmf-1.1 texmf-1.2           \
-                               texmf-1.3 texmf-1.4                     \
-                               theme-1.0 theme-1.1                     \
-                               xdg-1.1 xdg-1.2 xdg-1.3 xdg-1.4         \
-                               xorg-1.0                                \
-                       } [m:a,c:a]
 USE_FEATURES           List of Identifier [$package]
 USE_GNU_CONFIGURE_HOST YesNo [$package]
 USE_GNU_ICONV          Yes [m:s,c:s,o:s]
diff -r ca3aa0e84bb2 -r 894d0245cbab pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Wed Jul 22 09:05:23 2009 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Wed Jul 22 09:13:49 2009 +0000
@@ -1,5 +1,5 @@
 #! @PERL@
-# $NetBSD: pkglint.pl,v 1.815 2009/07/17 20:06:22 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.816 2009/07/22 09:13:49 wiz Exp $
 #
 
 # pkglint - static analyzer and checker for pkgsrc packages
@@ -2351,27 +2351,6 @@
        $load_shared_dirs_dir_to_id = $dir_to_id;
 }
 
-# Given a directory name, returns a list of possible identifiers to be
-# used in USE_DIRS.
-sub get_shared_dir_ids($$) {
-       my ($line, $dir) = @_;
-       my @ids;
-
-       $opt_debug_trace and $line->log_debug("get_shared_dir_ids(\"$dir\")");
-
-       load_shared_dirs();
-       my $varname = $load_shared_dirs_dir_to_varname->{$dir};
-       return () unless $varname;
-       #print "varname=$varname\n";
-       foreach my $dir2 (@{$load_shared_dirs_varname_to_dirs->{$varname}}) {
-               #print "dir2=$dir2\n";
-               my $id = $load_shared_dirs_dir_to_id->{$dir2};
-               #print "id=$id\n";
-               push(@ids, $id);
-       }
-       return @ids;
-}
-
 #
 # Miscellaneous functions
 #
@@ -4992,10 +4971,6 @@
                        } elsif ($pkg eq "gmake") {
                                $line->log_warning("Please use USE_TOOLS+=gmake instead of this dependency.");
 
-                       } elsif ($pkg =~ m"^([-a-zA-Z0-9]+)-dirs[-><=]+(.*)$") {
-                               my ($dirs, $version) = ($1, $2);
-
-                               $line->log_warning("Please use USE_DIRS+=${dirs}-${version} instead of this dependency.");
                        }
 
                } elsif ($value =~ m":\.\./[^/]+$") {
@@ -7692,23 +7667,13 @@
                                # nothing to do
 
                        } elsif ($cmd eq "dirrm") {
-                               my @ids = get_shared_dir_ids($line, $arg);
-                               if (@ids == 0) {
-                                       # Nothing to do
-                               } elsif (@ids == 1) {
-                                       $line->log_warning("Please add \"USE_DIRS+= $ids[0]\" to the package Makefile and remove this line.");
-                               } else {
-                                       my $s = join(" or ", map { "\"USE_DIRS+= $_\"" } @ids);
-                                       $line->log_warning("Please add $s to the package Makefile and remove this line.");
-                               }
-                               if (!exists($all_dirs->{$arg})) {
-                                       $line->log_warning("The PLIST does not contain files for \"$arg\".");
-                                       $line->explain_warning(
-"A package should only remove those directories that it created. When",
-"there are no files in the directory, it is unlikely that the package",
-"created the directory.");
-                               }
-
+                               $line->log_warning("\@dirrm is obsolete. Please remove this line.");
+                               $line->explain_warning(
+"Directories are removed automatically when empty.",
+"When a package needs an empty directory, it can use the \@pkgdir",
+"command in the PLIST");
+
+                               # XXX: this check should be made independent of dirrm
                                if ($pkgpath ne "graphics/hicolor-icon-theme" && $arg =~ m"^share/icons/hicolor(?:$|/)") {
                                        $line->log_error("Please .include \"../../graphics/hicolor-icon-theme/buildlink3.mk\" and remove this line.");
                                }
@@ -7862,7 +7827,6 @@
                                if (defined($pkgctx_included) && !exists($pkgctx_included->{$f})) {
                                        $line->log_warning("Packages that install a .desktop entry should .include \"$f\".");
                                }
-                               # TODO: check that USE_DIRS contains any xdg-*
 
                        } elsif ($dirname eq "share/aclocal" && $basename =~ m"\.m4$") {
                                # Fine.



Home | Main Index | Thread Index | Old Index