| @@ -1,15 +1,15 @@ | | | @@ -1,15 +1,15 @@ |
1 | #! @PERL@ | | 1 | #! @PERL@ |
2 | # $NetBSD: pkglint.pl,v 1.849 2013/01/20 02:57:36 schmonz Exp $ | | 2 | # $NetBSD: pkglint.pl,v 1.850 2013/03/06 12:30:01 obache 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 | # |
| @@ -5033,27 +5033,27 @@ sub checkline_mk_vartype_basic($$$$$$$$) | | | @@ -5033,27 +5033,27 @@ sub checkline_mk_vartype_basic($$$$$$$$) |
5033 | " package>=3.41:../../category/package", | | 5033 | " package>=3.41:../../category/package", |
5034 | " package-2.718:../../category/package"); | | 5034 | " package-2.718:../../category/package"); |
5035 | } | | 5035 | } |
5036 | | | 5036 | |
5037 | } elsif ($type eq "DistSuffix") { | | 5037 | } elsif ($type eq "DistSuffix") { |
5038 | if ($value eq ".tar.gz") { | | 5038 | if ($value eq ".tar.gz") { |
5039 | $line->log_note("${varname} is \".tar.gz\" by default, so this definition may be redundant."); | | 5039 | $line->log_note("${varname} is \".tar.gz\" by default, so this definition may be redundant."); |
5040 | } | | 5040 | } |
5041 | | | 5041 | |
5042 | } elsif ($type eq "EmulPlatform") { | | 5042 | } elsif ($type eq "EmulPlatform") { |
5043 | if ($value =~ m"^(\w+)-(\w+)$") { | | 5043 | if ($value =~ m"^(\w+)-(\w+)$") { |
5044 | my ($opsys, $arch) = ($1, $2); | | 5044 | my ($opsys, $arch) = ($1, $2); |
5045 | | | 5045 | |
5046 | if ($opsys !~ m"^(?:bsdos|darwin|dragonfly|freebsd|hpux|interix|irix|linux|netbsd|openbsd|osf1|sunos)$") { | | 5046 | if ($opsys !~ m"^(?:bsdos|cygwin|darwin|dragonfly|freebsd|haiku|hpux|interix|irix|linux|netbsd|openbsd|osf1|sunos)$") { |
5047 | $line->log_warning("Unknown operating system: ${opsys}"); | | 5047 | $line->log_warning("Unknown operating system: ${opsys}"); |
5048 | } | | 5048 | } |
5049 | # no check for $os_version | | 5049 | # no check for $os_version |
5050 | if ($arch !~ m"^(?:i386|alpha|amd64|arc|arm|arm32|cobalt|convex|dreamcast|hpcmips|hpcsh|hppa|ia64|m68k|m88k|mips|mips64|mipsel|mipseb|mipsn32|ns32k|pc532|pmax|powerpc|rs6000|s390|sparc|sparc64|vax|x86_64)$") { | | 5050 | if ($arch !~ m"^(?:i386|alpha|amd64|arc|arm|arm32|cobalt|convex|dreamcast|hpcmips|hpcsh|hppa|ia64|m68k|m88k|mips|mips64|mipsel|mipseb|mipsn32|ns32k|pc532|pmax|powerpc|rs6000|s390|sparc|sparc64|vax|x86_64)$") { |
5051 | $line->log_warning("Unknown hardware architecture: ${arch}"); | | 5051 | $line->log_warning("Unknown hardware architecture: ${arch}"); |
5052 | } | | 5052 | } |
5053 | | | 5053 | |
5054 | } else { | | 5054 | } else { |
5055 | $line->log_warning("\"${value}\" is not a valid emulation platform."); | | 5055 | $line->log_warning("\"${value}\" is not a valid emulation platform."); |
5056 | $line->explain_warning( | | 5056 | $line->explain_warning( |
5057 | "An emulation platform has the form <OPSYS>-<MACHINE_ARCH>.", | | 5057 | "An emulation platform has the form <OPSYS>-<MACHINE_ARCH>.", |
5058 | "OPSYS is the lower-case name of the operating system, and MACHINE_ARCH", | | 5058 | "OPSYS is the lower-case name of the operating system, and MACHINE_ARCH", |
5059 | "is the hardware architecture.", | | 5059 | "is the hardware architecture.", |
| @@ -5273,27 +5273,27 @@ sub checkline_mk_vartype_basic($$$$$$$$) | | | @@ -5273,27 +5273,27 @@ sub checkline_mk_vartype_basic($$$$$$$$) |
5273 | $line->explain_error( | | 5273 | $line->explain_error( |
5274 | "Usually, different packages using the same Makefile.common have", | | 5274 | "Usually, different packages using the same Makefile.common have", |
5275 | "different dependencies and will be bumped at different times (e.g. for", | | 5275 | "different dependencies and will be bumped at different times (e.g. for", |
5276 | "shlib major bumps) and thus the PKGREVISIONs must be in the separate", | | 5276 | "shlib major bumps) and thus the PKGREVISIONs must be in the separate", |
5277 | "Makefiles. There is no practical way of having this information in a", | | 5277 | "Makefiles. There is no practical way of having this information in a", |
5278 | "commonly used Makefile."); | | 5278 | "commonly used Makefile."); |
5279 | } | | 5279 | } |
5280 | | | 5280 | |
5281 | } elsif ($type eq "PlatformTriple") { | | 5281 | } elsif ($type eq "PlatformTriple") { |
5282 | my $part = qr"(?:\[[^\]]+\]|[^-\[])+"; | | 5282 | my $part = qr"(?:\[[^\]]+\]|[^-\[])+"; |
5283 | if ($value =~ m"^(${part})-(${part})-(${part})$") { | | 5283 | if ($value =~ m"^(${part})-(${part})-(${part})$") { |
5284 | my ($opsys, $os_version, $arch) = ($1, $2, $3); | | 5284 | my ($opsys, $os_version, $arch) = ($1, $2, $3); |
5285 | | | 5285 | |
5286 | if ($opsys !~ m"^(?:\*|BSDOS|Darwin|DragonFly|FreeBSD|HPUX|Interix|IRIX|Linux|NetBSD|OpenBSD|OSF1|SunOS)$") { | | 5286 | if ($opsys !~ m"^(?:\*|BSDOS|Cygwin|Darwin|DragonFly|FreeBSD|Haiku|HPUX|Interix|IRIX|Linux|NetBSD|OpenBSD|OSF1|SunOS)$") { |
5287 | $line->log_warning("Unknown operating system: ${opsys}"); | | 5287 | $line->log_warning("Unknown operating system: ${opsys}"); |
5288 | } | | 5288 | } |
5289 | # no check for $os_version | | 5289 | # no check for $os_version |
5290 | if ($arch !~ m"^(?:\*|i386|alpha|amd64|arc|arm|arm32|cobalt|convex|dreamcast|hpcmips|hpcsh|hppa|ia64|m68k|m88k|mips|mips64|mipsel|mipseb|mipsn32|ns32k|pc532|pmax|powerpc|rs6000|s390|sparc|sparc64|vax|x86_64)$") { | | 5290 | if ($arch !~ m"^(?:\*|i386|alpha|amd64|arc|arm|arm32|cobalt|convex|dreamcast|hpcmips|hpcsh|hppa|ia64|m68k|m88k|mips|mips64|mipsel|mipseb|mipsn32|ns32k|pc532|pmax|powerpc|rs6000|s390|sparc|sparc64|vax|x86_64)$") { |
5291 | $line->log_warning("Unknown hardware architecture: ${arch}"); | | 5291 | $line->log_warning("Unknown hardware architecture: ${arch}"); |
5292 | } | | 5292 | } |
5293 | | | 5293 | |
5294 | } else { | | 5294 | } else { |
5295 | $line->log_warning("\"${value}\" is not a valid platform triple."); | | 5295 | $line->log_warning("\"${value}\" is not a valid platform triple."); |
5296 | $line->explain_warning( | | 5296 | $line->explain_warning( |
5297 | "A platform triple has the form <OPSYS>-<OS_VERSION>-<MACHINE_ARCH>.", | | 5297 | "A platform triple has the form <OPSYS>-<OS_VERSION>-<MACHINE_ARCH>.", |
5298 | "Each of these components may be a shell globbing expression.", | | 5298 | "Each of these components may be a shell globbing expression.", |
5299 | "Examples: NetBSD-*-i386, *-*-*, Linux-*-*."); | | 5299 | "Examples: NetBSD-*-i386, *-*-*, Linux-*-*."); |