Sun Oct 11 07:27:13 2015 UTC ()
Fixed warning for using github.com in MASTER_SITES.


(rillig)
diff -r1.80 -r1.81 pkgsrc/pkgtools/pkglint/TODO
diff -r1.878 -r1.879 pkgsrc/pkgtools/pkglint/files/pkglint.pl

cvs diff -r1.80 -r1.81 pkgsrc/pkgtools/pkglint/Attic/TODO (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkglint/Attic/TODO 2015/03/07 15:33:21 1.80
+++ pkgsrc/pkgtools/pkglint/Attic/TODO 2015/10/11 07:27:12 1.81
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1$NetBSD: TODO,v 1.80 2015/03/07 15:33:21 tnn Exp $ 1$NetBSD: TODO,v 1.81 2015/10/11 07:27:12 rillig Exp $
2 2
3Please add your own entries at the bottom of this file. If possible, 3Please add your own entries at the bottom of this file. If possible,
4include the name of an example package where a warning should occur. 4include the name of an example package where a warning should occur.
5 5
6* When you understand some behavior of the code, document it by 6* When you understand some behavior of the code, document it by
7 adding automated tests to pkglint.t! 7 adding automated tests to pkglint.t!
8* warn about the use of ${WRKDIR:=...}, as this construct should only 8* warn about the use of ${WRKDIR:=...}, as this construct should only
9 be used with lists. 9 be used with lists.
10* Add checks for binary packages. See Debian/lintian for ideas. 10* Add checks for binary packages. See Debian/lintian for ideas.
11* Of the user-defined variables, some may be used at load-time and some 11* Of the user-defined variables, some may be used at load-time and some
12 don't. Find out how pkglint can distinguish them. 12 don't. Find out how pkglint can distinguish them.
13* Make sure that no variable is modified at load-time after it has been 13* Make sure that no variable is modified at load-time after it has been
14 used once. This should at least flag BUILD_DEFS in bsd.pkg.mk. 14 used once. This should at least flag BUILD_DEFS in bsd.pkg.mk.
@@ -27,15 +27,13 @@ include the name of an example package w @@ -27,15 +27,13 @@ include the name of an example package w
27* Complain about ${PKGSRC_COMPILER} == "sunpro", which should be 27* Complain about ${PKGSRC_COMPILER} == "sunpro", which should be
28 !empty(PKGSRC_COMPILER:Msunpro). 28 !empty(PKGSRC_COMPILER:Msunpro).
29* If USE_TOOLS has autoconf213, and the package does stuff like 29* If USE_TOOLS has autoconf213, and the package does stuff like
30 cd ${WRKSRC} && autoconf, then an incorrect warning is issued. 30 cd ${WRKSRC} && autoconf, then an incorrect warning is issued.
31* LOCALBASE should not be used in normal Makefiles 31* LOCALBASE should not be used in normal Makefiles
32* don't complain about "procedure calls", like for pkg-build-options in 32* don't complain about "procedure calls", like for pkg-build-options in
33 the various buildlink3.mk files. 33 the various buildlink3.mk files.
34* if package A conflicts with B, then B should also conflict with A. 34* if package A conflicts with B, then B should also conflict with A.
35* When pkglint runs on a case-insensitive filesystem, it should still 35* When pkglint runs on a case-insensitive filesystem, it should still
36 point out problems that only occur on case-sensitive filesystems. For 36 point out problems that only occur on case-sensitive filesystems. For
37 example, devel/p5-Net-LDAP and devel/p5-Net-ldap should be considered 37 example, devel/p5-Net-LDAP and devel/p5-Net-ldap should be considered
38 different paths. 38 different paths.
39* Warn about using REPLACE_PYTHON without including application.mk. 39* Warn about using REPLACE_PYTHON without including application.mk.
40* Warn about MASTER_SITES containing "github.com", point user to 
41 make help topic=github. Also don't complain about GH_* variables. 

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

--- pkgsrc/pkgtools/pkglint/files/Attic/pkglint.pl 2015/06/14 18:18:34 1.878
+++ pkgsrc/pkgtools/pkglint/files/Attic/pkglint.pl 2015/10/11 07:27:13 1.879
@@ -1,15 +1,15 @@ @@ -1,15 +1,15 @@
1#! @PERL@ 1#! @PERL@
2# $NetBSD: pkglint.pl,v 1.878 2015/06/14 18:18:34 wiz Exp $ 2# $NetBSD: pkglint.pl,v 1.879 2015/10/11 07:27:13 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#
@@ -4048,27 +4048,34 @@ sub checkline_mk_vartype_basic($$$$$$$$) @@ -4048,27 +4048,34 @@ sub checkline_mk_vartype_basic($$$$$$$$)
4048"is the hardware architecture.", 4048"is the hardware architecture.",
4049"", 4049"",
4050"Examples: linux-i386, irix-mipsel."); 4050"Examples: linux-i386, irix-mipsel.");
4051 } 4051 }
4052 }, 4052 },
4053 4053
4054 FetchURL => sub { 4054 FetchURL => sub {
4055 checkline_mk_vartype_basic($line, $varname, "URL", $op, $value, $comment, $list_context, $is_guessed); 4055 checkline_mk_vartype_basic($line, $varname, "URL", $op, $value, $comment, $list_context, $is_guessed);
4056 4056
4057 my $sites = get_dist_sites(); 4057 my $sites = get_dist_sites();
4058 foreach my $site (keys(%{$sites})) { 4058 foreach my $site (keys(%{$sites})) {
4059 if (index($value, $site) == 0) { 4059 if (index($value, $site) == 0) {
4060 my $subdir = substr($value, length($site)); 4060 my $subdir = substr($value, length($site));
 4061 my $is_github = $value =~ m"^https://github\.com/";
 4062 if ($is_github) {
 4063 $subdir =~ s|/.*|/|;
 4064 }
4061 $line->log_warning(sprintf("Please use \${%s:=%s} instead of \"%s\".", $sites->{$site}, $subdir, $value)); 4065 $line->log_warning(sprintf("Please use \${%s:=%s} instead of \"%s\".", $sites->{$site}, $subdir, $value));
 4066 if ($is_github) {
 4067 $line->log_warning("Run \"".conf_make." help topic=github\" for further tips.");
 4068 }
4062 last; 4069 last;
4063 } 4070 }
4064 } 4071 }
4065 }, 4072 },
4066 4073
4067 Filename => sub { 4074 Filename => sub {
4068 if ($value_novar =~ m"/") { 4075 if ($value_novar =~ m"/") {
4069 $line->log_warning("A filename should not contain a slash."); 4076 $line->log_warning("A filename should not contain a slash.");
4070 4077
4071 } elsif ($value_novar !~ m"^[-0-9\@A-Za-z.,_~+%]*$") { 4078 } elsif ($value_novar !~ m"^[-0-9\@A-Za-z.,_~+%]*$") {
4072 $line->log_warning("\"${value}\" is not a valid filename."); 4079 $line->log_warning("\"${value}\" is not a valid filename.");
4073 } 4080 }
4074 }, 4081 },