pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint Fixed a wrong warning for the HOMEPAG...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/81c94d2f358e
branches:  trunk
changeset: 648104:81c94d2f358e
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Wed Mar 11 19:05:58 2015 +0000

description:
Fixed a wrong warning for the HOMEPAGE variable

WARN: Makefile:9: Please use ${MASTER_SITE_GITHUB:=glmark2/glmark2}
      instead of "https://github.com/glmark2/glmark2";.

This warning is wrong because HOMEPAGE is neither a plural variable nor
does it contain a "fetch URL".

To fix this, there is a new data type FetchURL, which has one more check
than the existing data type URL, namely the MASTER_SITES abbreviation.
The existing definitions in makevars.map have been updated accordingly
to the appropriate data types.

Note: This patch is not perfect, since ideally only variables of type
"List of FetchURL" should be suggested to be replaced with MASTER_SITES,
but since currently all these variables are actually "List of FetchURL"
and not simply "FetchURL", this should be fine.

diffstat:

 pkgtools/pkglint/Makefile           |   4 +-
 pkgtools/pkglint/files/makevars.map |  68 ++++++++++++++++++------------------
 pkgtools/pkglint/files/pkglint.pl   |  24 +++++++-----
 3 files changed, 49 insertions(+), 47 deletions(-)

diffs (155 lines):

diff -r 074c034af171 -r 81c94d2f358e pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Wed Mar 11 15:19:34 2015 +0000
+++ b/pkgtools/pkglint/Makefile Wed Mar 11 19:05:58 2015 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.458 2015/03/09 06:24:09 wiz Exp $
+# $NetBSD: Makefile,v 1.459 2015/03/11 19:05:58 rillig Exp $
 
 # Note: if you update the version number, please have a look at the
 # changes between the CVS tag "pkglint_current" and HEAD.
 # After updating, please re-set the CVS tag to HEAD.
-PKGNAME=       pkglint-4.152
+PKGNAME=       pkglint-4.153
 CATEGORIES=    pkgtools
 
 OWNER=         wiz%NetBSD.org@localhost
diff -r 074c034af171 -r 81c94d2f358e pkgtools/pkglint/files/makevars.map
--- a/pkgtools/pkglint/files/makevars.map       Wed Mar 11 15:19:34 2015 +0000
+++ b/pkgtools/pkglint/files/makevars.map       Wed Mar 11 19:05:58 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: makevars.map,v 1.261 2015/03/09 06:24:10 wiz Exp $
+# $NetBSD: makevars.map,v 1.262 2015/03/11 19:05:58 rillig Exp $
 #
 
 # This file contains the guessed type of some variables, according to
@@ -461,38 +461,38 @@
 MANGRP                 UserGroupName [$system]
 MANMODE                        FileMode [$system]
 MANOWN                 UserGroupName [$system]
-MASTER_SITES           List of URL [$package_list]
-MASTER_SITE_APACHE     List of URL [$system]
-MASTER_SITE_BACKUP     List of URL [$system]
-MASTER_SITE_CYGWIN     List of URL [$system]
-MASTER_SITE_DEBIAN     List of URL [$system]
-MASTER_SITE_FREEBSD    List of URL [$system]
-MASTER_SITE_FREEBSD_LOCAL      List of URL [$system]
-MASTER_SITE_GENTOO     List of URL [$system]
-MASTER_SITE_GITHUB     List of URL [$system]
-MASTER_SITE_GNOME      List of URL [$system]
-MASTER_SITE_GNU                List of URL [$system]
-MASTER_SITE_GNUSTEP    List of URL [$system]
-MASTER_SITE_IFARCHIVE  List of URL [$system]
-MASTER_SITE_HASKELL_HACKAGE    List of URL [$system]
-MASTER_SITE_KDE                List of URL [$system]
-MASTER_SITE_LOCAL      List of URL [$system]
-MASTER_SITE_MOZILLA    List of URL [$system]
-MASTER_SITE_MOZILLA_ALL        List of URL [$system]
-MASTER_SITE_MOZILLA_ESR        List of URL [$system]
-MASTER_SITE_MYSQL      List of URL [$system]
-MASTER_SITE_NETLIB     List of URL [$system]
-MASTER_SITE_OPENOFFICE List of URL [$system]
-MASTER_SITE_PERL_CPAN  List of URL [$system]
-MASTER_SITE_R_CRAN     List of URL [$system]
-MASTER_SITE_RUBYGEMS   List of URL [$system]
-MASTER_SITE_SOURCEFORGE        List of URL [$system]
-MASTER_SITE_SOURCEFORGE_JP     List of URL [$system]
-MASTER_SITE_SUNSITE    List of URL [$system]
-MASTER_SITE_SUSE       List of URL [$system]
-MASTER_SITE_TEX_CTAN   List of URL [$system]
-MASTER_SITE_XCONTRIB   List of URL [$system]
-MASTER_SITE_XEMACS     List of URL [$system]
+MASTER_SITES           List of FetchURL [$package_list]
+MASTER_SITE_APACHE     List of FetchURL [$system]
+MASTER_SITE_BACKUP     List of FetchURL [$system]
+MASTER_SITE_CYGWIN     List of FetchURL [$system]
+MASTER_SITE_DEBIAN     List of FetchURL [$system]
+MASTER_SITE_FREEBSD    List of FetchURL [$system]
+MASTER_SITE_FREEBSD_LOCAL      List of FetchURL [$system]
+MASTER_SITE_GENTOO     List of FetchURL [$system]
+MASTER_SITE_GITHUB     List of FetchURL [$system]
+MASTER_SITE_GNOME      List of FetchURL [$system]
+MASTER_SITE_GNU                List of FetchURL [$system]
+MASTER_SITE_GNUSTEP    List of FetchURL [$system]
+MASTER_SITE_IFARCHIVE  List of FetchURL [$system]
+MASTER_SITE_HASKELL_HACKAGE    List of FetchURL [$system]
+MASTER_SITE_KDE                List of FetchURL [$system]
+MASTER_SITE_LOCAL      List of FetchURL [$system]
+MASTER_SITE_MOZILLA    List of FetchURL [$system]
+MASTER_SITE_MOZILLA_ALL        List of FetchURL [$system]
+MASTER_SITE_MOZILLA_ESR        List of FetchURL [$system]
+MASTER_SITE_MYSQL      List of FetchURL [$system]
+MASTER_SITE_NETLIB     List of FetchURL [$system]
+MASTER_SITE_OPENOFFICE List of FetchURL [$system]
+MASTER_SITE_PERL_CPAN  List of FetchURL [$system]
+MASTER_SITE_R_CRAN     List of FetchURL [$system]
+MASTER_SITE_RUBYGEMS   List of FetchURL [$system]
+MASTER_SITE_SOURCEFORGE        List of FetchURL [$system]
+MASTER_SITE_SOURCEFORGE_JP     List of FetchURL [$system]
+MASTER_SITE_SUNSITE    List of FetchURL [$system]
+MASTER_SITE_SUSE       List of FetchURL [$system]
+MASTER_SITE_TEX_CTAN   List of FetchURL [$system]
+MASTER_SITE_XCONTRIB   List of FetchURL [$system]
+MASTER_SITE_XEMACS     List of FetchURL [$system]
 MESSAGE_SRC            List of Pathname [$package_list]
 MESSAGE_SUBST          List of ShellWord [c:a,m:a,o:a]
 META_PACKAGE           Yes [$package]
@@ -700,7 +700,7 @@
 SHLIB_HANDLING         { YES NO no }
 SHLIBTOOL              ShellCommand []
 SHLIBTOOL_OVERRIDE     List of Pathmask [m:as,c:a]
-SITES.*                        List of URL [m:asu,c:asu,o:asu]
+SITES.*                        List of FetchURL [m:asu,c:asu,o:asu]
 SPECIAL_PERMS          List of ShellWord [$package_list]
 STEP_MSG               ShellCommand [$system]
 SUBDIR                 List of Filename [Makefile:a,*:]
diff -r 074c034af171 -r 81c94d2f358e pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Wed Mar 11 15:19:34 2015 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Wed Mar 11 19:05:58 2015 +0000
@@ -1,5 +1,5 @@
 #! @PERL@
-# $NetBSD: pkglint.pl,v 1.876 2015/02/01 18:33:27 wiz Exp $
+# $NetBSD: pkglint.pl,v 1.877 2015/03/11 19:05:58 rillig Exp $
 #
 
 # pkglint - static analyzer and checker for pkgsrc packages
@@ -4051,7 +4051,18 @@
                        }
                },
 
-
+               FetchURL => sub {
+                       checkline_mk_vartype_basic($line, $varname, "URL", $op, $value, $comment, $list_context, $is_guessed);
+
+                       my $sites = get_dist_sites();
+                       foreach my $site (keys(%{$sites})) {
+                               if (index($value, $site) == 0) {
+                                       my $subdir = substr($value, length($site));
+                                       $line->log_warning(sprintf("Please use \${%s:=%s} instead of \"%s\".", $sites->{$site}, $subdir, $value));
+                                       last;
+                               }
+                       }
+               },
 
                Filename => sub {
                        if ($value_novar =~ m"/") {
@@ -4470,20 +4481,11 @@
 
                        } elsif ($value =~ m"^(https?|ftp|gopher)://([-0-9A-Za-z.]+)(?::(\d+))?/([-%&+,./0-9:=?\@A-Z_a-z~]|#)*$") {
                                my ($proto, $host, $port, $path) = ($1, $2, $3, $4);
-                               my $sites = get_dist_sites();
 
                                if ($host =~ m"\.NetBSD\.org$"i && $host !~ m"\.NetBSD\.org$") {
                                        $line->log_warning("Please write NetBSD.org instead of ${host}.");
                                }
 
-                               foreach my $site (keys(%{$sites})) {
-                                       if (index($value, $site) == 0) {
-                                               my $subdir = substr($value, length($site));
-                                               $line->log_warning(sprintf("Please use \${%s:=%s} instead of \"%s\".", $sites->{$site}, $subdir, $value));
-                                               last;
-                                       }
-                               }
-
                        } elsif ($value =~ m"^([0-9A-Za-z]+)://([^/]+)(.*)$") {
                                my ($scheme, $host, $abs_path) = ($1, $2, $3);
 



Home | Main Index | Thread Index | Old Index