diff options
author | rillig <rillig@pkgsrc.org> | 2015-03-11 19:05:58 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2015-03-11 19:05:58 +0000 |
commit | a39a40be3a1985e06e6a58cfdb2e58e87496c0d0 (patch) | |
tree | eb899daef108f49979513466599442751623b6c8 /pkgtools | |
parent | f007e0fe680b6f3332e7045af0e152e304a8dff2 (diff) | |
download | pkgsrc-a39a40be3a1985e06e6a58cfdb2e58e87496c0d0.tar.gz |
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 (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/Makefile | 4 | ||||
-rw-r--r-- | pkgtools/pkglint/files/makevars.map | 68 | ||||
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 22 |
3 files changed, 48 insertions, 46 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile index e7d992cfbf6..afad3016694 100644 --- a/pkgtools/pkglint/Makefile +++ b/pkgtools/pkglint/Makefile @@ -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 diff --git a/pkgtools/pkglint/files/makevars.map b/pkgtools/pkglint/files/makevars.map index 6aea9c7e5f9..d9b4656e683 100644 --- a/pkgtools/pkglint/files/makevars.map +++ b/pkgtools/pkglint/files/makevars.map @@ -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 @@ MANCOMPRESSED_IF_MANZ Yes [m:s,c:ds] 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 @@ SHCOMMENT ShellCommand [$system] 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 --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 2eaee6463f7..efb6967ee85 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -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 @@ sub checkline_mk_vartype_basic($$$$$$$$) { } }, + 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 @@ sub checkline_mk_vartype_basic($$$$$$$$) { } 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); |