From 70153a79c69cf17324c347e69e215d88cf288f8e Mon Sep 17 00:00:00 2001 From: rillig Date: Sat, 13 Jun 2009 06:30:25 +0000 Subject: Introduced the emulation framework to pkglint. --- pkgtools/pkglint/files/makevars.map | 17 ++++++++++++++++- pkgtools/pkglint/files/pkglint.pl | 26 +++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) (limited to 'pkgtools') diff --git a/pkgtools/pkglint/files/makevars.map b/pkgtools/pkglint/files/makevars.map index 796e44720da..cdfa996993f 100644 --- a/pkgtools/pkglint/files/makevars.map +++ b/pkgtools/pkglint/files/makevars.map @@ -1,4 +1,4 @@ -# $NetBSD: makevars.map,v 1.194 2009/04/09 00:55:12 joerg Exp $ +# $NetBSD: makevars.map,v 1.195 2009/06/13 06:30:25 rillig Exp $ # # This file contains the guessed type of some variables, according to @@ -306,6 +306,21 @@ EMACS_VERSIONS_ACCEPTED List of { emacs22 emacs22nox emacs21 emacs21nox emacs20 EMACS_VERSION_MAJOR Integer [$system] EMACS_VERSION_MINOR Integer [$system] EMACS_VERSION_REQD List of { emacs22 emacs22nox emacs21 emacs21nox emacs20 xemacs215 xemacs214 } [m:as] +EMULDIR Pathname [$system] +EMULSUBDIR Pathname [$system] +OPSYS_EMULDIR Pathname [$system] +EMULSUBDIRSLASH Pathname [$system] +EMUL_ARCH { i386 none } [$system] +EMUL_DISTRO Identifier [$system] +EMUL_IS_NATIVE Yes [$system] +EMUL_MODULES.* List of Identifier [$package] +EMUL_OPSYS { linux } [$system] +EMUL_PKG_FMT { plain rpm } [$package] +EMUL_PLATFORM EmulPlatform [$user] +EMUL_PLATFORMS List of EmulPlatform [$package] +EMUL_PREFER List of EmulPlatform [$user] +EMUL_REQD InternalList of Dependency [$package] +EMUL_TYPE.* { native builtin suse suse-9.1 suse-9.x suse-10.0 suse-10.x } [$user] ERROR_CAT ShellCommand [$system] ERROR_MSG ShellCommand [$system] EVAL_PREFIX InternalList of ShellWord [m:a,c:a] diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index e5f2470690f..9deb79ed14c 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.812 2009/05/26 21:40:42 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.813 2009/06/13 06:30:25 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -4979,6 +4979,30 @@ sub checkline_mk_vartype_basic($$$$$$$$) { $line->log_note("${varname} is \".tar.gz\" by default, so this definition may be redundant."); } + } elsif ($type eq "EmulPlatform") { + if ($value =~ m"^(\w+)-(\w+)$") { + my ($opsys, $arch) = ($1, $2); + + if ($opsys !~ m"^(?:bsdos|darwin|dragonfly|freebsd|hpux|interix|irix|linux|netbsd|openbsd|osf1|sunos)$") { + $line->log_warning("Unknown operating system: ${opsys}"); + } + # no check for $os_version + 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)$") { + $line->log_warning("Unknown hardware architecture: ${arch}"); + } + + } else { + $line->log_warning("\"${value}\" is not a valid emulation platform."); + $line->explain_warning( +"An emulation platform has the form -.", +"OPSYS is the lower-case name of the operating system, and MACHINE_ARCH", +"is the hardware architecture.", +"", +"Examples: linux-i386, irix-mipsel."); + } + + + } elsif ($type eq "Filename") { if ($value_novar =~ m"/") { $line->log_warning("A filename should not contain a slash."); -- cgit v1.2.3