pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Introduced the emulation framew...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/fffee618797a
branches:  trunk
changeset: 394598:fffee618797a
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Jun 13 06:30:25 2009 +0000

description:
Introduced the emulation framework to pkglint.

diffstat:

 pkgtools/pkglint/files/makevars.map |  17 ++++++++++++++++-
 pkgtools/pkglint/files/pkglint.pl   |  26 +++++++++++++++++++++++++-
 2 files changed, 41 insertions(+), 2 deletions(-)

diffs (72 lines):

diff -r e8d0c629dbf1 -r fffee618797a pkgtools/pkglint/files/makevars.map
--- a/pkgtools/pkglint/files/makevars.map       Fri Jun 12 23:03:35 2009 +0000
+++ b/pkgtools/pkglint/files/makevars.map       Sat Jun 13 06:30:25 2009 +0000
@@ -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_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 -r e8d0c629dbf1 -r fffee618797a pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Fri Jun 12 23:03:35 2009 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Sat Jun 13 06:30:25 2009 +0000
@@ -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 @@
                        $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>-<MACHINE_ARCH>.",
+"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.");



Home | Main Index | Thread Index | Old Index