diff options
-rw-r--r-- | doc/CHANGES | 3 | ||||
-rw-r--r-- | pkgtools/pkglint/Makefile | 4 | ||||
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 40 |
3 files changed, 30 insertions, 17 deletions
diff --git a/doc/CHANGES b/doc/CHANGES index dfdfb39d721..ec4494bbbe1 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,4 +1,4 @@ -$NetBSD: CHANGES,v 1.11365 2005/10/07 17:17:21 joerg Exp $ +$NetBSD: CHANGES,v 1.11366 2005/10/07 17:34:45 rillig Exp $ Changes to the packages collection and infrastructure in 2005: @@ -4322,3 +4322,4 @@ Changes to the packages collection and infrastructure in 2005: Updated sysutils/gnome-vfs2 to 2.12.1.1 [drochner 2005-10-07] Updated devel/gail to 1.8.5 [drochner 2005-10-07] Updated archivers/dact to 0.8.3nb3 [joerg 2005-10-07] + Updated pkgtools/pkglint to 4.25 [rillig 2005-10-07] diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile index 2158303e7bd..cd0fbcc3bd6 100644 --- a/pkgtools/pkglint/Makefile +++ b/pkgtools/pkglint/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.260 2005/10/07 10:24:42 rillig Exp $ +# $NetBSD: Makefile,v 1.261 2005/10/07 17:34:11 rillig Exp $ # -DISTNAME= pkglint-4.24 +DISTNAME= pkglint-4.25 CATEGORIES= pkgtools devel MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index b42cc5aec7b..86cf92893aa 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -11,7 +11,7 @@ # Freely redistributable. Absolutely no warranty. # # From Id: portlint.pl,v 1.64 1998/02/28 02:34:05 itojun Exp -# $NetBSD: pkglint.pl,v 1.294 2005/10/07 10:24:43 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.295 2005/10/07 17:34:11 rillig Exp $ # # This version contains lots of changes necessary for NetBSD packages # done by: @@ -1147,8 +1147,14 @@ sub readmakefile($$$$) { } $seen_Makefile_include->{$includefile} = true; - if ($includefile =~ qr"Makefile\.common$") { - $seen_Makefile_common = true; + if ($includefile =~ qr"^\.\./[^./][^/]*/[^/]+") { + $line->log_warning("Relative directories should look like \"../../cat/pkg\", not \"../pkg\"."); + } + if ($includefile =~ qr"^(?:\.\./(?:\.\./[^/]+/)?[^/]+/)?([^/]+)$") { + my ($basename) = ($1); + if ($basename ne "buildlink3.mk") { + $seen_Makefile_common = true; + } } if ($includefile =~ /\/mk\/texinfo\.mk/) { $line->log_error("Do not include $includefile."); @@ -1514,9 +1520,24 @@ sub checklines_package_Makefile($) { } } + if ($varname eq "SVR4_PKGNAME") { + if ($value =~ $regex_unresolved) { + $line->log_error("SVR4_PKGNAME must not contain references to other variables."); + } elsif (length($value) > 5) { + $line->log_error("SVR4_PKGNAME must not be longer than 5 characters."); + } + } + if ($value eq "# defined" && $varname !~ qr".*(?:_MK|_COMMON)$") { $line->log_warning("Please use \"# empty\", \"# none\" or \"yes\" instead of \"# defined\"."); } + + if ($varname =~ qr"^NO_(.*)_ON_(.*)$") { + my ($what, $where) = ($1, $2); + if (($what ne "SRC" && $what ne "BIN") || ($where ne "FTP" && $where ne "CDROM")) { + $line->log_error("Misspelled variable: Valid names are USE_{BIN,SRC}_ON_{FTP,CDROM}."); + } + } } } @@ -1616,7 +1637,7 @@ sub load_package_Makefile($$$$$) { sub checkfile_package_Makefile($$$$$) { my ($dir, $fname, $rawwhole, $lines, $loglines) = @_; - my ($distname, $svr4_pkgname, $category, $distfiles, + my ($distname, $category, $distfiles, $extract_sufx, $wrksrc); my ($abspkgdir, $whole, $tmp, $idx, @sections, @varnames); @@ -1754,7 +1775,7 @@ sub checkfile_package_Makefile($$$$$) { # check the items that have to be there. $tmp = "\n" . $tmp; foreach my $i ('DISTNAME', 'CATEGORIES') { - if ($tmp !~ /\n$i=/) { + if (!$seen_Makefile_common && $tmp !~ /\n$i=/) { $opt_warn_vague && log_error(NO_FILE, NO_LINE_NUMBER, "$i has to be there."); } if ($tmp =~ /\n$i(\?=)/) { @@ -1801,7 +1822,6 @@ sub checkfile_package_Makefile($$$$$) { # check DISTFILES and related items. $distname = expand_variable($tmp, "DISTNAME"); $pkgname = expand_variable($tmp, "PKGNAME"); - $svr4_pkgname = expand_variable($tmp, "SVR4_PKGNAME"); $extract_sufx = expand_variable($tmp, "EXTRACT_SUFX"); $distfiles = expand_variable($tmp, "DISTFILES"); @@ -1823,14 +1843,6 @@ sub checkfile_package_Makefile($$$$$) { if ($opt_warn_vague && defined($pkgname) && defined($distname) && ($pkgname eq $distname || $pkgname eq "\${DISTNAME}")) { log_warning(NO_FILE, NO_LINE_NUMBER, "PKGNAME is \${DISTNAME} by default. You don't need to define PKGNAME."); } - if ($opt_warn_vague && defined($svr4_pkgname)) { - if ($svr4_pkgname =~ $regex_unresolved) { - log_warning(NO_FILE, NO_LINE_NUMBER, "SVR4_PKGNAME must not contain references to other variables."); - } elsif (length($svr4_pkgname) > 5) { - log_error(NO_FILE, NO_LINE_NUMBER, "SVR4_PKGNAME must not be longer than 5 characters."); - } - } - if ($opt_warn_vague && defined($pkgname) && $pkgname !~ $regex_unresolved && $pkgname !~ $regex_pkgname) { log_warning(NO_FILE, NO_LINE_NUMBER, "PKGNAME should have the form packagename-version, where version consists only of digits, letters and dots."); } |