pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/pkglint



Module Name:    pkgsrc
Committed By:   rillig
Date:           Sun Jul 10 21:24:47 UTC 2016

Modified Files:
        pkgsrc/pkgtools/pkglint: Makefile
        pkgsrc/pkgtools/pkglint/files: globaldata.go globaldata_test.go
            licenses.go licenses_test.go main.go mkline.go mkline_test.go
            mklines.go mkparser.go mkparser_test.go mkshparser_test.go
            mkshtypes.go mktypes.go mktypes_test.go package.go pkglint.go
            shell.go shell.y shell_test.go shtokenizer.go shtypes.go
            shtypes_test.go vardefs.go vartype.go vartype_test.go
            vartypecheck.go vartypecheck_test.go
Added Files:
        pkgsrc/pkgtools/pkglint/files: license.y mkshtypes_test.go

Log Message:
Updated pkglint to 5.4.7.

Changes since 5.4.6:

* Allow conditionals of the form "${var1}" == "${var2}"
* Check for indentation of .include directives
* Check arbitrarily complex license conditions
* General code cleanup


To generate a diff of this commit:
cvs rdiff -u -r1.491 -r1.492 pkgsrc/pkgtools/pkglint/Makefile
cvs rdiff -u -r1.12 -r1.13 pkgsrc/pkgtools/pkglint/files/globaldata.go
cvs rdiff -u -r1.6 -r1.7 pkgsrc/pkgtools/pkglint/files/globaldata_test.go
cvs rdiff -u -r0 -r1.1 pkgsrc/pkgtools/pkglint/files/license.y \
    pkgsrc/pkgtools/pkglint/files/mkshtypes_test.go
cvs rdiff -u -r1.5 -r1.6 pkgsrc/pkgtools/pkglint/files/licenses.go
cvs rdiff -u -r1.4 -r1.5 pkgsrc/pkgtools/pkglint/files/licenses_test.go
cvs rdiff -u -r1.7 -r1.8 pkgsrc/pkgtools/pkglint/files/main.go \
    pkgsrc/pkgtools/pkglint/files/mklines.go
cvs rdiff -u -r1.14 -r1.15 pkgsrc/pkgtools/pkglint/files/mkline.go
cvs rdiff -u -r1.15 -r1.16 pkgsrc/pkgtools/pkglint/files/mkline_test.go
cvs rdiff -u -r1.3 -r1.4 pkgsrc/pkgtools/pkglint/files/mkparser.go \
    pkgsrc/pkgtools/pkglint/files/mkshparser_test.go \
    pkgsrc/pkgtools/pkglint/files/mkshtypes.go \
    pkgsrc/pkgtools/pkglint/files/shtokenizer.go \
    pkgsrc/pkgtools/pkglint/files/shtypes.go \
    pkgsrc/pkgtools/pkglint/files/vartype_test.go
cvs rdiff -u -r1.2 -r1.3 pkgsrc/pkgtools/pkglint/files/mkparser_test.go \
    pkgsrc/pkgtools/pkglint/files/mktypes_test.go
cvs rdiff -u -r1.1 -r1.2 pkgsrc/pkgtools/pkglint/files/mktypes.go \
    pkgsrc/pkgtools/pkglint/files/shell.y \
    pkgsrc/pkgtools/pkglint/files/shtypes_test.go
cvs rdiff -u -r1.10 -r1.11 pkgsrc/pkgtools/pkglint/files/package.go \
    pkgsrc/pkgtools/pkglint/files/pkglint.go
cvs rdiff -u -r1.11 -r1.12 pkgsrc/pkgtools/pkglint/files/shell.go \
    pkgsrc/pkgtools/pkglint/files/shell_test.go
cvs rdiff -u -r1.13 -r1.14 pkgsrc/pkgtools/pkglint/files/vardefs.go \
    pkgsrc/pkgtools/pkglint/files/vartypecheck_test.go
cvs rdiff -u -r1.9 -r1.10 pkgsrc/pkgtools/pkglint/files/vartype.go
cvs rdiff -u -r1.17 -r1.18 pkgsrc/pkgtools/pkglint/files/vartypecheck.go

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/pkgtools/pkglint/Makefile
diff -u pkgsrc/pkgtools/pkglint/Makefile:1.491 pkgsrc/pkgtools/pkglint/Makefile:1.492
--- pkgsrc/pkgtools/pkglint/Makefile:1.491      Sun Jul 10 11:37:27 2016
+++ pkgsrc/pkgtools/pkglint/Makefile    Sun Jul 10 21:24:47 2016
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.491 2016/07/10 11:37:27 rillig Exp $
+# $NetBSD: Makefile,v 1.492 2016/07/10 21:24:47 rillig Exp $
 
-PKGNAME=       pkglint-5.4.6
+PKGNAME=       pkglint-5.4.7
 DISTFILES=     # none
 CATEGORIES=    pkgtools
 

Index: pkgsrc/pkgtools/pkglint/files/globaldata.go
diff -u pkgsrc/pkgtools/pkglint/files/globaldata.go:1.12 pkgsrc/pkgtools/pkglint/files/globaldata.go:1.13
--- pkgsrc/pkgtools/pkglint/files/globaldata.go:1.12    Sat Jul  9 09:43:48 2016
+++ pkgsrc/pkgtools/pkglint/files/globaldata.go Sun Jul 10 21:24:47 2016
@@ -114,7 +114,7 @@ func (gd *GlobalData) loadTools() {
                fname := G.globalData.Pkgsrcdir + "/mk/tools/bsd.tools.mk"
                lines := LoadExistingLines(fname, true)
                for _, line := range lines {
-                       if m, _, includefile := match2(line.Text, reMkInclude); m {
+                       if m, _, _, includefile := match3(line.Text, reMkInclude); m {
                                if !contains(includefile, "/") {
                                        toolFiles = append(toolFiles, includefile)
                                }

Index: pkgsrc/pkgtools/pkglint/files/globaldata_test.go
diff -u pkgsrc/pkgtools/pkglint/files/globaldata_test.go:1.6 pkgsrc/pkgtools/pkglint/files/globaldata_test.go:1.7
--- pkgsrc/pkgtools/pkglint/files/globaldata_test.go:1.6        Sat Jul  9 09:43:48 2016
+++ pkgsrc/pkgtools/pkglint/files/globaldata_test.go    Sun Jul 10 21:24:47 2016
@@ -7,8 +7,8 @@ import (
 func (s *Suite) Test_GlobalData_InitVartypes(c *check.C) {
        G.globalData.InitVartypes()
 
-       c.Check(G.globalData.vartypes["BSD_MAKE_ENV"].checker.name, equals, "ShellWord")
-       c.Check(G.globalData.vartypes["USE_BUILTIN.*"].checker.name, equals, "YesNoIndirectly")
+       c.Check(G.globalData.vartypes["BSD_MAKE_ENV"].basicType.name, equals, "ShellWord")
+       c.Check(G.globalData.vartypes["USE_BUILTIN.*"].basicType.name, equals, "YesNoIndirectly")
 }
 
 func (s *Suite) Test_parselinesSuggestedUpdates(c *check.C) {

Index: pkgsrc/pkgtools/pkglint/files/licenses.go
diff -u pkgsrc/pkgtools/pkglint/files/licenses.go:1.5 pkgsrc/pkgtools/pkglint/files/licenses.go:1.6
--- pkgsrc/pkgtools/pkglint/files/licenses.go:1.5       Thu Jul  7 12:09:27 2016
+++ pkgsrc/pkgtools/pkglint/files/licenses.go   Sun Jul 10 21:24:47 2016
@@ -2,16 +2,78 @@ package main
 
 import (
        "io/ioutil"
-       "strings"
 )
 
-func parseLicenses(licenses string) []string {
-       noPerl := strings.Replace(licenses, "${PERL5_LICENSE}", "gnu-gpl-v2 OR artistic", -1)
-       noOps := regcomp(`[()]|AND|OR`).ReplaceAllString(noPerl, "") // cheated
-       return splitOnSpace(strings.TrimSpace(noOps))
+//go:generate go tool yacc -p liyy -o licenseyacc.go -v licenseyacc.log license.y
+
+// LicenseCondition describes a complex license condition.
+// It has either `Name` or `Main` set.
+type LicenseCondition struct {
+       Name string
+       Main *LicenseCondition
+       And  []*LicenseCondition
+       Or   []*LicenseCondition
+}
+
+func (lc *LicenseCondition) Walk(callback func(*LicenseCondition)) {
+       callback(lc)
+       if lc.Main != nil {
+               lc.Main.Walk(callback)
+       }
+       for _, and := range lc.And {
+               and.Walk(callback)
+       }
+       for _, or := range lc.Or {
+               or.Walk(callback)
+       }
+}
+
+type licenseLexer struct {
+       repl   *PrefixReplacer
+       result *LicenseCondition
+       error  string
 }
 
-func checktoplevelUnusedLicenses() {
+func (lexer *licenseLexer) Lex(llval *liyySymType) int {
+       repl := lexer.repl
+       repl.AdvanceHspace()
+       switch {
+       case repl.rest == "":
+               return 0
+       case repl.AdvanceStr("("):
+               return ltOPEN
+       case repl.AdvanceStr(")"):
+               return ltCLOSE
+       case repl.AdvanceRegexp(`^[\w-.]+`):
+               word := repl.m[0]
+               switch word {
+               case "AND":
+                       return ltAND
+               case "OR":
+                       return ltOR
+               default:
+                       llval.Node = &LicenseCondition{Name: word}
+                       return ltNAME
+               }
+       }
+       return -1
+}
+
+func (lexer *licenseLexer) Error(s string) {
+       lexer.error = s
+}
+
+func parseLicenses(licenses string) *LicenseCondition {
+       expanded := resolveVariableRefs(licenses) // For ${PERL5_LICENSE}
+       lexer := &licenseLexer{repl: NewPrefixReplacer(expanded)}
+       result := liyyNewParser().Parse(lexer)
+       if result == 0 {
+               return lexer.result
+       }
+       return nil
+}
+
+func checkToplevelUnusedLicenses() {
        if G.UsedLicenses == nil {
                return
        }
@@ -29,38 +91,68 @@ func checktoplevelUnusedLicenses() {
        }
 }
 
-func checklineLicense(line *MkLine, value string) {
-       licenses := parseLicenses(value)
-       for _, license := range licenses {
-               var licenseFile string
-               if G.Pkg != nil {
-                       if licenseFileValue, ok := G.Pkg.varValue("LICENSE_FILE"); ok {
-                               licenseFile = G.CurrentDir + "/" + resolveVarsInRelativePath(licenseFileValue, false)
-                       }
-               }
-               if licenseFile == "" {
-                       licenseFile = G.globalData.Pkgsrcdir + "/licenses/" + license
-                       if G.UsedLicenses != nil {
-                               G.UsedLicenses[license] = true
-                       }
-               }
+type LicenseChecker struct {
+       MkLine *MkLine
+}
 
-               if !fileExists(licenseFile) {
-                       line.Warn1("License file %s does not exist.", cleanpath(licenseFile))
+func (lc *LicenseChecker) Check(value string, op MkOperator) {
+       licenses := parseLicenses(ifelseStr(op == opAssignAppend, "append-placeholder ", "") + value)
+
+       if licenses == nil {
+               if op == opAssign {
+                       lc.MkLine.Line.Error1("Parse error for license condition %q.", value)
+               } else {
+                       lc.MkLine.Line.Error1("Parse error for appended license condition %q.", value)
                }
+               return
+       }
+
+       licenses.Walk(lc.checkNode)
+}
 
-               switch license {
-               case "fee-based-commercial-use",
-                       "no-commercial-use",
-                       "no-profit",
-                       "no-redistribution",
-                       "shareware":
-                       line.Warn1("License %q is deprecated.", license)
-                       Explain(
-                               "Instead of using these deprecated licenses, extract the actual",
-                               "license from the package into the pkgsrc/licenses/ directory",
-                               "and define LICENSE to that file name.  See the pkgsrc guide,",
-                               "keyword LICENSE, for more information.")
+func (lc *LicenseChecker) checkNode(cond *LicenseCondition) {
+       license := cond.Name
+       if license == "" || license == "append-placeholder" {
+               return
+       }
+
+       var licenseFile string
+       if G.Pkg != nil {
+               if licenseFileValue, ok := G.Pkg.varValue("LICENSE_FILE"); ok {
+                       licenseFile = G.CurrentDir + "/" + resolveVarsInRelativePath(licenseFileValue, false)
+               }
+       }
+       if licenseFile == "" {
+               licenseFile = G.globalData.Pkgsrcdir + "/licenses/" + license
+               if G.UsedLicenses != nil {
+                       G.UsedLicenses[license] = true
                }
        }
+
+       if !fileExists(licenseFile) {
+               lc.MkLine.Warn1("License file %s does not exist.", cleanpath(licenseFile))
+       }
+
+       switch license {
+       case "fee-based-commercial-use",
+               "no-commercial-use",
+               "no-profit",
+               "no-redistribution",
+               "shareware":
+               lc.MkLine.Error1("License %q must not be used.", license)
+               Explain(
+                       "Instead of using these deprecated licenses, extract the actual",
+                       "license from the package into the pkgsrc/licenses/ directory",
+                       "and define LICENSE to that file name.  See the pkgsrc guide,",
+                       "keyword LICENSE, for more information.")
+       }
+
+       if len(cond.And) > 0 && len(cond.Or) > 0 {
+               lc.MkLine.Line.Error0("AND and OR operators in license conditions can only be combined using parentheses.")
+               Explain(
+                       "Examples for valid license conditions are:",
+                       "",
+                       "\tlicense1 AND license2 AND (license3 OR license4)",
+                       "\t(((license1 OR license2) AND (license3 OR license4)))")
+       }
 }

Index: pkgsrc/pkgtools/pkglint/files/licenses_test.go
diff -u pkgsrc/pkgtools/pkglint/files/licenses_test.go:1.4 pkgsrc/pkgtools/pkglint/files/licenses_test.go:1.5
--- pkgsrc/pkgtools/pkglint/files/licenses_test.go:1.4  Sat Jul  9 09:43:48 2016
+++ pkgsrc/pkgtools/pkglint/files/licenses_test.go      Sun Jul 10 21:24:47 2016
@@ -5,8 +5,8 @@ import (
 )
 
 func (s *Suite) Test_parseLicenses(c *check.C) {
-       c.Check(parseLicenses("gnu-gpl-v2"), check.DeepEquals, []string{"gnu-gpl-v2"})
-       c.Check(parseLicenses("AND artistic"), check.DeepEquals, []string{"artistic"})
+       c.Check(parseLicenses("gnu-gpl-v2"), check.DeepEquals, &LicenseCondition{Name: "gnu-gpl-v2"})
+       c.Check(parseLicenses("AND artistic"), check.IsNil)
 }
 
 func (s *Suite) Test_checklineLicense(c *check.C) {
@@ -15,19 +15,32 @@ func (s *Suite) Test_checklineLicense(c 
        G.globalData.Pkgsrcdir = s.tmpdir
        G.CurrentDir = s.tmpdir
 
-       checklineLicense(mkline, "gpl-v2")
+       licenseChecker := &LicenseChecker{mkline}
+       licenseChecker.Check("gpl-v2", opAssign)
 
        c.Check(s.Output(), equals, "WARN: Makefile:7: License file ~/licenses/gpl-v2 does not exist.\n")
 
-       checklineLicense(mkline, "no-profit shareware")
+       licenseChecker.Check("no-profit shareware", opAssign)
+
+       c.Check(s.Output(), equals, "ERROR: Makefile:7: Parse error for license condition \"no-profit shareware\".\n")
+
+       licenseChecker.Check("no-profit AND shareware", opAssign)
 
        c.Check(s.Output(), equals, ""+
                "WARN: Makefile:7: License file ~/licenses/no-profit does not exist.\n"+
-               "WARN: Makefile:7: License \"no-profit\" is deprecated.\n"+
+               "ERROR: Makefile:7: License \"no-profit\" must not be used.\n"+
                "WARN: Makefile:7: License file ~/licenses/shareware does not exist.\n"+
-               "WARN: Makefile:7: License \"shareware\" is deprecated.\n")
+               "ERROR: Makefile:7: License \"shareware\" must not be used.\n")
+
+       licenseChecker.Check("gnu-gpl-v2", opAssign)
+
+       c.Check(s.Output(), equals, "")
+
+       licenseChecker.Check("gnu-gpl-v2 AND gnu-gpl-v2 OR gnu-gpl-v2", opAssign)
+
+       c.Check(s.Output(), equals, "ERROR: Makefile:7: AND and OR operators in license conditions can only be combined using parentheses.\n")
 
-       checklineLicense(mkline, "gnu-gpl-v2")
+       licenseChecker.Check("(gnu-gpl-v2 OR gnu-gpl-v2) AND gnu-gpl-v2", opAssign)
 
        c.Check(s.Output(), equals, "")
 }

Index: pkgsrc/pkgtools/pkglint/files/main.go
diff -u pkgsrc/pkgtools/pkglint/files/main.go:1.7 pkgsrc/pkgtools/pkglint/files/main.go:1.8
--- pkgsrc/pkgtools/pkglint/files/main.go:1.7   Sun Jun  5 11:24:32 2016
+++ pkgsrc/pkgtools/pkglint/files/main.go       Sun Jul 10 21:24:47 2016
@@ -67,7 +67,7 @@ func (pkglint *Pkglint) Main(args ...str
                CheckDirent(item)
        }
 
-       checktoplevelUnusedLicenses()
+       checkToplevelUnusedLicenses()
        pkglint.PrintSummary()
        if G.opts.Profiling {
                G.loghisto.PrintStats("loghisto", G.logOut, 0)
Index: pkgsrc/pkgtools/pkglint/files/mklines.go
diff -u pkgsrc/pkgtools/pkglint/files/mklines.go:1.7 pkgsrc/pkgtools/pkglint/files/mklines.go:1.8
--- pkgsrc/pkgtools/pkglint/files/mklines.go:1.7        Sat Jul  9 09:43:48 2016
+++ pkgsrc/pkgtools/pkglint/files/mklines.go    Sun Jul 10 21:24:47 2016
@@ -291,7 +291,7 @@ func (va *VaralignBlock) Finish() {
 }
 
 func (va *VaralignBlock) fixalign(mkline *MkLine, prefix, oldalign string) {
-       if mkline.Value() == "" && mkline.Comment() == "" {
+       if mkline.Value() == "" && mkline.VarassignComment() == "" {
                return
        }
 

Index: pkgsrc/pkgtools/pkglint/files/mkline.go
diff -u pkgsrc/pkgtools/pkglint/files/mkline.go:1.14 pkgsrc/pkgtools/pkglint/files/mkline.go:1.15
--- pkgsrc/pkgtools/pkglint/files/mkline.go:1.14        Sat Jul  9 09:43:48 2016
+++ pkgsrc/pkgtools/pkglint/files/mkline.go     Sun Jul 10 21:24:47 2016
@@ -13,15 +13,34 @@ import (
 type MkLine struct {
        Line *Line
 
-       xtype      uint8
-       xmustexist bool
-       xop        MkOperator
-       xvalign    string
-       xs1        string
-       xs2        string
-       xs3        string
-       xvalue     string
-       xcomment   string
+       xtype uint8
+       data  interface{} // One of the following mkLine* types
+}
+type mkLineAssign struct {
+       varname    string
+       varcanon   string
+       varparam   string
+       op         MkOperator
+       valueAlign string
+       value      string
+       comment    string
+}
+type mkLineShell struct {
+       command string
+}
+type mkLineConditional struct {
+       indent    string
+       directive string
+       args      string
+}
+type mkLineInclude struct {
+       mustexist   bool
+       indent      string
+       includeFile string
+}
+type mkLineDependency struct {
+       targets string
+       sources string
 }
 
 func (mkline *MkLine) Error1(format, arg1 string)      { mkline.Line.Error1(format, arg1) }
@@ -62,27 +81,28 @@ func NewMkLine(line *Line) (mkline *MkLi
                varparam := varnameParam(varname)
 
                mkline.xtype = 1
-               mkline.xs1 = varname
-               mkline.xs2 = varnameCanon(varname)
-               mkline.xs3 = varparam
-               mkline.xop = NewMkOperator(op)
-               mkline.xvalign = valueAlign
-               mkline.xvalue = value
-               mkline.xcomment = comment
+               mkline.data = mkLineAssign{
+                       varname,
+                       varnameCanon(varname),
+                       varparam,
+                       NewMkOperator(op),
+                       valueAlign,
+                       value,
+                       comment}
                mkline.Tokenize(value)
                return
        }
 
        if hasPrefix(text, "\t") {
+               shellcmd := text[1:]
                mkline.xtype = 2
-               mkline.xs1 = text[1:]
-               mkline.Tokenize(mkline.xs1)
+               mkline.data = mkLineShell{shellcmd}
+               mkline.Tokenize(shellcmd)
                return
        }
 
        if index := strings.IndexByte(text, '#'); index != -1 && strings.TrimSpace(text[:index]) == "" {
                mkline.xtype = 3
-               mkline.xcomment = text[index+1:]
                return
        }
 
@@ -93,30 +113,25 @@ func NewMkLine(line *Line) (mkline *MkLi
 
        if m, indent, directive, args := matchMkCond(text); m {
                mkline.xtype = 5
-               mkline.xs1 = indent
-               mkline.xs2 = directive
-               mkline.xs3 = args
+               mkline.data = mkLineConditional{indent, directive, args}
                return
        }
 
-       if m, directive, includefile := match2(text, reMkInclude); m {
+       if m, indent, directive, includefile := match3(text, reMkInclude); m {
                mkline.xtype = 6
-               mkline.xmustexist = directive == "include"
-               mkline.xs1 = includefile
+               mkline.data = mkLineInclude{directive == "include", indent, includefile}
                return
        }
 
-       if m, directive, includefile := match2(text, `^\.\s*(s?include)\s+<([^>]+)>\s*(?:#.*)?$`); m {
+       if m, indent, directive, includefile := match3(text, `^\.(\s*)(s?include)\s+<([^>]+)>\s*(?:#.*)?$`); m {
                mkline.xtype = 7
-               mkline.xmustexist = directive == "include"
-               mkline.xs1 = includefile
+               mkline.data = mkLineInclude{directive == "include", indent, includefile}
                return
        }
 
        if m, targets, whitespace, sources := match3(text, `^([^\s:]+(?:\s*[^\s:]+)*)(\s*):\s*([^#]*?)(?:\s*#.*)?$`); m {
                mkline.xtype = 8
-               mkline.xs1 = targets
-               mkline.xs2 = sources
+               mkline.data = mkLineDependency{targets, sources}
                if whitespace != "" {
                        line.Warn0("Space before colon in dependency line.")
                }
@@ -134,29 +149,35 @@ func NewMkLine(line *Line) (mkline *MkLi
 func (mkline *MkLine) String() string {
        return fmt.Sprintf("%s:%s", mkline.Line.Fname, mkline.Line.linenos())
 }
-func (mkline *MkLine) IsVarassign() bool   { return mkline.xtype == 1 }
-func (mkline *MkLine) Varname() string     { return mkline.xs1 }
-func (mkline *MkLine) Varcanon() string    { return mkline.xs2 }
-func (mkline *MkLine) Varparam() string    { return mkline.xs3 }
-func (mkline *MkLine) Op() MkOperator      { return mkline.xop }
-func (mkline *MkLine) ValueAlign() string  { return mkline.xvalign }
-func (mkline *MkLine) Value() string       { return mkline.xvalue }
-func (mkline *MkLine) Comment() string     { return mkline.xcomment }
-func (mkline *MkLine) IsShellcmd() bool    { return mkline.xtype == 2 }
-func (mkline *MkLine) Shellcmd() string    { return mkline.xs1 }
-func (mkline *MkLine) IsComment() bool     { return mkline.xtype == 3 }
-func (mkline *MkLine) IsEmpty() bool       { return mkline.xtype == 4 }
-func (mkline *MkLine) IsCond() bool        { return mkline.xtype == 5 }
-func (mkline *MkLine) Indent() string      { return mkline.xs1 }
-func (mkline *MkLine) Directive() string   { return mkline.xs2 }
-func (mkline *MkLine) Args() string        { return mkline.xs3 }
-func (mkline *MkLine) IsInclude() bool     { return mkline.xtype == 6 }
-func (mkline *MkLine) MustExist() bool     { return mkline.xmustexist }
-func (mkline *MkLine) Includefile() string { return mkline.xs1 }
-func (mkline *MkLine) IsSysinclude() bool  { return mkline.xtype == 7 }
-func (mkline *MkLine) IsDependency() bool  { return mkline.xtype == 8 }
-func (mkline *MkLine) Targets() string     { return mkline.xs1 }
-func (mkline *MkLine) Sources() string     { return mkline.xs2 }
+func (mkline *MkLine) IsVarassign() bool        { return mkline.xtype == 1 }
+func (mkline *MkLine) IsShellcmd() bool         { return mkline.xtype == 2 }
+func (mkline *MkLine) IsComment() bool          { return mkline.xtype == 3 }
+func (mkline *MkLine) IsEmpty() bool            { return mkline.xtype == 4 }
+func (mkline *MkLine) IsCond() bool             { return mkline.xtype == 5 }
+func (mkline *MkLine) IsInclude() bool          { return mkline.xtype == 6 }
+func (mkline *MkLine) IsSysinclude() bool       { return mkline.xtype == 7 }
+func (mkline *MkLine) IsDependency() bool       { return mkline.xtype == 8 }
+func (mkline *MkLine) Varname() string          { return mkline.data.(mkLineAssign).varname }
+func (mkline *MkLine) Varcanon() string         { return mkline.data.(mkLineAssign).varcanon }
+func (mkline *MkLine) Varparam() string         { return mkline.data.(mkLineAssign).varparam }
+func (mkline *MkLine) Op() MkOperator           { return mkline.data.(mkLineAssign).op }
+func (mkline *MkLine) ValueAlign() string       { return mkline.data.(mkLineAssign).valueAlign }
+func (mkline *MkLine) Value() string            { return mkline.data.(mkLineAssign).value }
+func (mkline *MkLine) VarassignComment() string { return mkline.data.(mkLineAssign).comment }
+func (mkline *MkLine) Shellcmd() string         { return mkline.data.(mkLineShell).command }
+func (mkline *MkLine) Indent() string {
+       if mkline.IsCond() {
+               return mkline.data.(mkLineConditional).indent
+       } else {
+               return mkline.data.(mkLineInclude).indent
+       }
+}
+func (mkline *MkLine) Directive() string   { return mkline.data.(mkLineConditional).directive }
+func (mkline *MkLine) Args() string        { return mkline.data.(mkLineConditional).args }
+func (mkline *MkLine) MustExist() bool     { return mkline.data.(mkLineInclude).mustexist }
+func (mkline *MkLine) Includefile() string { return mkline.data.(mkLineInclude).includeFile }
+func (mkline *MkLine) Targets() string     { return mkline.data.(mkLineDependency).targets }
+func (mkline *MkLine) Sources() string     { return mkline.data.(mkLineDependency).sources }
 
 func (mkline *MkLine) Check() {
        mkline.Line.CheckTrailingWhitespace()
@@ -186,6 +207,10 @@ func (mkline *MkLine) checkInclude() {
                defer tracecall0()()
        }
 
+       if mkline.Indent() != "" {
+               mkline.checkDirectiveIndentation()
+       }
+
        includefile := mkline.Includefile()
        mustExist := mkline.MustExist()
        if G.opts.Debug {
@@ -230,7 +255,8 @@ func (mkline *MkLine) checkInclude() {
 }
 
 func (mkline *MkLine) checkCond(forVars map[string]bool) {
-       indent, directive, args := mkline.Indent(), mkline.Directive(), mkline.Args()
+       directive := mkline.Directive()
+       args := mkline.Args()
        indentation := &G.Mk.indentation
 
        switch directive {
@@ -242,12 +268,7 @@ func (mkline *MkLine) checkCond(forVars 
                }
        }
 
-       // Check the indentation
-       if expected := strings.Repeat(" ", indentation.Depth()); indent != expected {
-               if G.opts.WarnSpace && !mkline.Line.AutofixReplace("."+indent, "."+expected) {
-                       mkline.Line.Notef("This directive should be indented by %d spaces.", indentation.Depth())
-               }
-       }
+       mkline.checkDirectiveIndentation()
 
        if directive == "if" && matches(args, `^!defined\([\w]+_MK\)$`) {
                indentation.Push(indentation.Depth())
@@ -256,27 +277,23 @@ func (mkline *MkLine) checkCond(forVars 
                indentation.Push(indentation.Depth() + 2)
        }
 
-       const reDirectivesWithArgs = `^(?:if|ifdef|ifndef|elif|for|undef)$`
-       if matches(directive, reDirectivesWithArgs) && args == "" {
-               mkline.Error1("\".%s\" requires arguments.", directive)
-
-       } else if !matches(directive, reDirectivesWithArgs) && args != "" {
-               mkline.Error1("\".%s\" does not take arguments.", directive)
-
-               if directive == "else" {
-                       mkline.Note0("If you meant \"else if\", use \".elif\".")
+       needsArgument := matches(directive, `^(?:if|ifdef|ifndef|elif|for|undef)$`)
+       if needsArgument != (args != "") {
+               if needsArgument {
+                       mkline.Error1("\".%s\" requires arguments.", directive)
+               } else {
+                       mkline.Error1("\".%s\" does not take arguments.", directive)
+                       if directive == "else" {
+                               mkline.Note0("If you meant \"else if\", use \".elif\".")
+                       }
                }
 
        } else if directive == "if" || directive == "elif" {
                mkline.CheckCond()
 
        } else if directive == "ifdef" || directive == "ifndef" {
-               if matches(args, `\s`) {
-                       mkline.Error1("The \".%s\" directive can only handle _one_ argument.", directive)
-               } else {
-                       mkline.Line.Warnf("The \".%s\" directive is deprecated. Please use \".if %sdefined(%s)\" instead.",
-                               directive, ifelseStr(directive == "ifdef", "", "!"), args)
-               }
+               mkline.Line.Warnf("The \".%s\" directive is deprecated. Please use \".if %sdefined(%s)\" instead.",
+                       directive, ifelseStr(directive == "ifdef", "", "!"), args)
 
        } else if directive == "for" {
                if m, vars, values := match2(args, `^(\S+(?:\s*\S+)*?)\s+in\s+(.*)$`); m {
@@ -307,7 +324,7 @@ func (mkline *MkLine) checkCond(forVars 
                                }
                        }
 
-                       forLoopType := &Vartype{lkSpace, CheckvarUnchecked, []AclEntry{{"*", aclpAllRead}}, guessed}
+                       forLoopType := &Vartype{lkSpace, BtUnknown, []AclEntry{{"*", aclpAllRead}}, guessed}
                        forLoopContext := &VarUseContext{forLoopType, vucTimeParse, vucQuotFor, false}
                        for _, forLoopVar := range mkline.extractUsedVariables(values) {
                                mkline.CheckVaruse(&MkVarUse{forLoopVar, nil}, forLoopContext)
@@ -323,6 +340,19 @@ func (mkline *MkLine) checkCond(forVars 
        }
 }
 
+func (mkline *MkLine) checkDirectiveIndentation() {
+       if G.Mk == nil {
+               return
+       }
+       indent := mkline.Indent()
+       indentation := G.Mk.indentation
+       if expected := strings.Repeat(" ", indentation.Depth()); indent != expected {
+               if G.opts.WarnSpace && !mkline.Line.AutofixReplace("."+indent, "."+expected) {
+                       mkline.Line.Notef("This directive should be indented by %d spaces.", indentation.Depth())
+               }
+       }
+}
+
 func (mkline *MkLine) checkDependencyRule(allowedTargets map[string]bool) {
        targets := splitOnSpace(mkline.Targets())
        sources := splitOnSpace(mkline.Sources())
@@ -757,7 +787,7 @@ func (mkline *MkLine) checkVarassign() {
        varname := mkline.Varname()
        op := mkline.Op()
        value := mkline.Value()
-       comment := mkline.Comment()
+       comment := mkline.VarassignComment()
        varcanon := varnameCanon(varname)
 
        if G.opts.Debug {
@@ -928,7 +958,7 @@ func (mkline *MkLine) checkVarassignSpec
                mkline.checkVarassignPythonVersions(varname, value)
        }
 
-       if mkline.Comment() == "# defined" && !hasSuffix(varname, "_MK") && !hasSuffix(varname, "_COMMON") {
+       if mkline.VarassignComment() == "# defined" && !hasSuffix(varname, "_MK") && !hasSuffix(varname, "_COMMON") {
                mkline.Note0("Please use \"# empty\", \"# none\" or \"yes\" instead of \"# defined\".")
                Explain(
                        "The value #defined says something about the state of the variable,",
@@ -1031,27 +1061,27 @@ func (mkline *MkLine) CheckVartype(varna
                }
 
        case vartype.kindOfList == lkNone:
-               mkline.CheckVartypePrimitive(varname, vartype.checker, op, value, comment, vartype.guessed)
+               mkline.CheckVartypePrimitive(varname, vartype.basicType, op, value, comment, vartype.guessed)
 
        case value == "":
                break
 
        case vartype.kindOfList == lkSpace:
                for _, word := range splitOnSpace(value) {
-                       mkline.CheckVartypePrimitive(varname, vartype.checker, op, word, comment, vartype.guessed)
+                       mkline.CheckVartypePrimitive(varname, vartype.basicType, op, word, comment, vartype.guessed)
                }
 
        case vartype.kindOfList == lkShell:
                words, _ := splitIntoMkWords(mkline.Line, value)
                for _, word := range words {
-                       mkline.CheckVartypePrimitive(varname, vartype.checker, op, word, comment, vartype.guessed)
+                       mkline.CheckVartypePrimitive(varname, vartype.basicType, op, word, comment, vartype.guessed)
                }
        }
 }
 
 // For some variables (like `BuildlinkDepth`), `op` influences the valid values.
 // The `comment` parameter comes from a variable assignment, when a part of the line is commented out.
-func (mkline *MkLine) CheckVartypePrimitive(varname string, checker *VarChecker, op MkOperator, value, comment string, guessed bool) {
+func (mkline *MkLine) CheckVartypePrimitive(varname string, checker *BasicType, op MkOperator, value, comment string, guessed bool) {
        if G.opts.Debug {
                defer tracecall(varname, checker.name, op, value, comment, guessed)()
        }
@@ -1330,7 +1360,7 @@ func (mkline *MkLine) variableNeedsQuoti
                return nqDontKnow
        }
 
-       if vartype.checker.IsEnum() || vartype.IsBasicSafe() {
+       if vartype.basicType.IsEnum() || vartype.IsBasicSafe() {
                if vartype.kindOfList == lkNone {
                        return nqDoesntMatter
                }
@@ -1355,7 +1385,7 @@ func (mkline *MkLine) variableNeedsQuoti
 
        // A shell word may appear as part of a shell word, for example COMPILER_RPATH_FLAG.
        if vuc.IsWordPart && vuc.quoting == vucQuotPlain {
-               if vartype.kindOfList == lkNone && vartype.checker == CheckvarShellWord {
+               if vartype.kindOfList == lkNone && vartype.basicType == BtShellWord {
                        return nqNo
                }
        }
@@ -1406,10 +1436,10 @@ func (mkline *MkLine) variableNeedsQuoti
 
        if wantList != haveList {
                if vuc.vartype != nil && vartype != nil {
-                       if vuc.vartype.checker == CheckvarFetchURL && vartype.checker == CheckvarHomepage {
+                       if vuc.vartype.basicType == BtFetchURL && vartype.basicType == BtHomepage {
                                return nqNo
                        }
-                       if vuc.vartype.checker == CheckvarHomepage && vartype.checker == CheckvarFetchURL {
+                       if vuc.vartype.basicType == BtHomepage && vartype.basicType == BtFetchURL {
                                return nqNo // Just for HOMEPAGE=${MASTER_SITE_*:=subdir/}.
                        }
                }
@@ -1452,11 +1482,11 @@ func (mkline *MkLine) getVariableType(va
                                perms |= aclpUseLoadtime
                        }
                }
-               return &Vartype{lkNone, CheckvarShellCommand, []AclEntry{{"*", perms}}, false}
+               return &Vartype{lkNone, BtShellCommand, []AclEntry{{"*", perms}}, false}
        }
 
        if m, toolvarname := match1(varname, `^TOOLS_(.*)`); m && G.globalData.Tools.byVarname[toolvarname] != nil {
-               return &Vartype{lkNone, CheckvarPathname, []AclEntry{{"*", aclpUse}}, false}
+               return &Vartype{lkNone, BtPathname, []AclEntry{{"*", aclpUse}}, false}
        }
 
        allowAll := []AclEntry{{"*", aclpAll}}
@@ -1467,35 +1497,35 @@ func (mkline *MkLine) getVariableType(va
        var gtype *Vartype
        switch {
        case hasSuffix(varbase, "DIRS"):
-               gtype = &Vartype{lkShell, CheckvarPathmask, allowRuntime, true}
+               gtype = &Vartype{lkShell, BtPathmask, allowRuntime, true}
        case hasSuffix(varbase, "DIR") && !hasSuffix(varbase, "DESTDIR"), hasSuffix(varname, "_HOME"):
-               gtype = &Vartype{lkNone, CheckvarPathname, allowRuntime, true}
+               gtype = &Vartype{lkNone, BtPathname, allowRuntime, true}
        case hasSuffix(varbase, "FILES"):
-               gtype = &Vartype{lkShell, CheckvarPathmask, allowRuntime, true}
+               gtype = &Vartype{lkShell, BtPathmask, allowRuntime, true}
        case hasSuffix(varbase, "FILE"):
-               gtype = &Vartype{lkNone, CheckvarPathname, allowRuntime, true}
+               gtype = &Vartype{lkNone, BtPathname, allowRuntime, true}
        case hasSuffix(varbase, "PATH"):
-               gtype = &Vartype{lkNone, CheckvarPathlist, allowRuntime, true}
+               gtype = &Vartype{lkNone, BtPathlist, allowRuntime, true}
        case hasSuffix(varbase, "PATHS"):
-               gtype = &Vartype{lkShell, CheckvarPathname, allowRuntime, true}
+               gtype = &Vartype{lkShell, BtPathname, allowRuntime, true}
        case hasSuffix(varbase, "_USER"):
-               gtype = &Vartype{lkNone, CheckvarUserGroupName, allowAll, true}
+               gtype = &Vartype{lkNone, BtUserGroupName, allowAll, true}
        case hasSuffix(varbase, "_GROUP"):
-               gtype = &Vartype{lkNone, CheckvarUserGroupName, allowAll, true}
+               gtype = &Vartype{lkNone, BtUserGroupName, allowAll, true}
        case hasSuffix(varbase, "_ENV"):
-               gtype = &Vartype{lkShell, CheckvarShellWord, allowRuntime, true}
+               gtype = &Vartype{lkShell, BtShellWord, allowRuntime, true}
        case hasSuffix(varbase, "_CMD"):
-               gtype = &Vartype{lkNone, CheckvarShellCommand, allowRuntime, true}
+               gtype = &Vartype{lkNone, BtShellCommand, allowRuntime, true}
        case hasSuffix(varbase, "_ARGS"):
-               gtype = &Vartype{lkShell, CheckvarShellWord, allowRuntime, true}
+               gtype = &Vartype{lkShell, BtShellWord, allowRuntime, true}
        case hasSuffix(varbase, "_CFLAGS"), hasSuffix(varname, "_CPPFLAGS"), hasSuffix(varname, "_CXXFLAGS"):
-               gtype = &Vartype{lkShell, CheckvarCFlag, allowRuntime, true}
+               gtype = &Vartype{lkShell, BtCFlag, allowRuntime, true}
        case hasSuffix(varname, "_LDFLAGS"):
-               gtype = &Vartype{lkShell, CheckvarLdFlag, allowRuntime, true}
+               gtype = &Vartype{lkShell, BtLdFlag, allowRuntime, true}
        case hasSuffix(varbase, "_MK"):
-               gtype = &Vartype{lkNone, CheckvarUnchecked, allowAll, true}
+               gtype = &Vartype{lkNone, BtUnknown, allowAll, true}
        case hasPrefix(varbase, "PLIST."):
-               gtype = &Vartype{lkNone, CheckvarYes, allowAll, true}
+               gtype = &Vartype{lkNone, BtYes, allowAll, true}
        }
 
        if G.opts.Debug {

Index: pkgsrc/pkgtools/pkglint/files/mkline_test.go
diff -u pkgsrc/pkgtools/pkglint/files/mkline_test.go:1.15 pkgsrc/pkgtools/pkglint/files/mkline_test.go:1.16
--- pkgsrc/pkgtools/pkglint/files/mkline_test.go:1.15   Sat Jul  9 13:16:43 2016
+++ pkgsrc/pkgtools/pkglint/files/mkline_test.go        Sun Jul 10 21:24:47 2016
@@ -16,7 +16,7 @@ func (s *Suite) Test_MkLine_CheckVartype
        vartype := mkline.getVariableType("COMMENT")
 
        c.Assert(vartype, check.NotNil)
-       c.Check(vartype.checker.name, equals, "Comment")
+       c.Check(vartype.basicType.name, equals, "Comment")
        c.Check(vartype.guessed, equals, false)
        c.Check(vartype.kindOfList, equals, lkNone)
 
@@ -157,8 +157,8 @@ func (s *Suite) Test_NewMkLine(c *check.
                "# whole line comment",
                "",
                ".  if !empty(PKGNAME:M*-*) # cond comment",
-               ".include \"../../mk/bsd.prefs.mk\" # include comment",
-               ".include <subdir.mk> # sysinclude comment",
+               ".    include \"../../mk/bsd.prefs.mk\" # include comment",
+               ".    include <subdir.mk> # sysinclude comment",
                "target1 target2: source1 source2",
                "target : source",
                "VARNAME+=value"))
@@ -170,13 +170,12 @@ func (s *Suite) Test_NewMkLine(c *check.
        c.Check(ln[0].Varparam(), equals, "param")
        c.Check(ln[0].Op(), equals, opAssignDefault)
        c.Check(ln[0].Value(), equals, "value")
-       c.Check(ln[0].Comment(), equals, "# varassign comment")
+       c.Check(ln[0].VarassignComment(), equals, "# varassign comment")
 
        c.Check(ln[1].IsShellcmd(), equals, true)
        c.Check(ln[1].Shellcmd(), equals, "shell command # shell comment")
 
        c.Check(ln[2].IsComment(), equals, true)
-       c.Check(ln[2].Comment(), equals, " whole line comment")
 
        c.Check(ln[3].IsEmpty(), equals, true)
 
@@ -184,22 +183,20 @@ func (s *Suite) Test_NewMkLine(c *check.
        c.Check(ln[4].Indent(), equals, "  ")
        c.Check(ln[4].Directive(), equals, "if")
        c.Check(ln[4].Args(), equals, "!empty(PKGNAME:M*-*)")
-       c.Check(ln[4].Comment(), equals, "") // Not needed
 
        c.Check(ln[5].IsInclude(), equals, true)
+       c.Check(ln[5].Indent(), equals, "    ")
        c.Check(ln[5].MustExist(), equals, true)
        c.Check(ln[5].Includefile(), equals, "../../mk/bsd.prefs.mk")
-       c.Check(ln[5].Comment(), equals, "") // Not needed
 
        c.Check(ln[6].IsSysinclude(), equals, true)
+       c.Check(ln[6].Indent(), equals, "    ")
        c.Check(ln[6].MustExist(), equals, true)
        c.Check(ln[6].Includefile(), equals, "subdir.mk")
-       c.Check(ln[6].Comment(), equals, "") // Not needed
 
        c.Check(ln[7].IsDependency(), equals, true)
        c.Check(ln[7].Targets(), equals, "target1 target2")
        c.Check(ln[7].Sources(), equals, "source1 source2")
-       c.Check(ln[7].Comment(), equals, "") // Not needed
 
        c.Check(ln[9].IsVarassign(), equals, true)
        c.Check(ln[9].Varname(), equals, "VARNAME")
@@ -766,7 +763,7 @@ func (s *Suite) Test_MkLine_CheckCond_co
        c.Check(s.Output(), equals, "") // Don’t warn about unknown shell command "cc".
 }
 
-func (s *Suite) disabled_Test_MkLine_Pkgmandir(c *check.C) {
+func (s *Suite) Test_MkLine_Pkgmandir(c *check.C) {
        s.UseCommandLine(c, "-Wall")
        G.globalData.InitVartypes()
        G.Mk = s.NewMkLines("chat/ircII/Makefile",

Index: pkgsrc/pkgtools/pkglint/files/mkparser.go
diff -u pkgsrc/pkgtools/pkglint/files/mkparser.go:1.3 pkgsrc/pkgtools/pkglint/files/mkparser.go:1.4
--- pkgsrc/pkgtools/pkglint/files/mkparser.go:1.3       Sat Jul  9 09:43:48 2016
+++ pkgsrc/pkgtools/pkglint/files/mkparser.go   Sun Jul 10 21:24:47 2016
@@ -314,6 +314,16 @@ func (p *MkParser) mkCondAtom() *Tree {
                                        return NewTree("compareVarStr", *lhs, op, repl.m[0])
                                } else if rhs := p.VarUse(); rhs != nil {
                                        return NewTree("compareVarVar", *lhs, op, *rhs)
+                               } else if repl.PeekByte() == '"' {
+                                       mark := repl.Mark()
+                                       if repl.AdvanceStr("\"") {
+                                               if quotedRHS := p.VarUse(); quotedRHS != nil {
+                                                       if repl.AdvanceStr("\"") {
+                                                               return NewTree("compareVarVar", *lhs, op, *quotedRHS)
+                                                       }
+                                               }
+                                       }
+                                       repl.Reset(mark)
                                }
                        } else {
                                return NewTree("not", NewTree("empty", *lhs)) // See devel/bmake/files/cond.c:/\* For \.if \$/
Index: pkgsrc/pkgtools/pkglint/files/mkshparser_test.go
diff -u pkgsrc/pkgtools/pkglint/files/mkshparser_test.go:1.3 pkgsrc/pkgtools/pkglint/files/mkshparser_test.go:1.4
--- pkgsrc/pkgtools/pkglint/files/mkshparser_test.go:1.3        Sun Jul 10 11:37:27 2016
+++ pkgsrc/pkgtools/pkglint/files/mkshparser_test.go    Sun Jul 10 21:24:47 2016
@@ -19,7 +19,7 @@ func (s *ShSuite) Test_ShellParser_progr
                b.List())
 
        s.test("echo ;",
-               b.List().AddCommand(b.SimpleCommand("echo")).AddSeparator(";"))
+               b.List().AddCommand(b.SimpleCommand("echo")).AddSemicolon())
 
        s.test("echo",
                b.List().AddCommand(b.SimpleCommand("echo")))
@@ -37,48 +37,48 @@ func (s *ShSuite) Test_ShellParser_progr
                b.List().AddAndOr(b.AndOr(b.Pipeline(false,
                        b.SimpleCommand("${CAT}", "${PKGDIR}/PLIST"),
                        b.While(
-                               b.List().AddCommand(b.SimpleCommand("read", "entry")).AddSeparator(";"),
-                               b.List().AddCommand(b.SimpleCommand(":")).AddSeparator(";"))))))
+                               b.List().AddCommand(b.SimpleCommand("read", "entry")).AddSemicolon(),
+                               b.List().AddCommand(b.SimpleCommand(":")).AddSemicolon())))))
 
        s.test("while read entry ; do case \"$$entry\" in include/c-client/* ) ${INSTALL_DATA} $$src $$dest ; esac ; done",
                b.List().AddCommand(b.While(
-                       b.List().AddCommand(b.SimpleCommand("read", "entry")).AddSeparator(";"),
+                       b.List().AddCommand(b.SimpleCommand("read", "entry")).AddSemicolon(),
                        b.List().AddCommand(b.Case(
                                b.Token("\"$$entry\""),
                                b.CaseItem(
                                        b.Words("include/c-client/*"),
                                        b.List().AddCommand(b.SimpleCommand("${INSTALL_DATA}", "$$src", "$$dest")),
-                                       &SEP_SEMI))).AddSeparator(";"))))
+                                       sepSemicolon))).AddSemicolon())))
 
        s.test("command | while condition ; do case selector in pattern ) : ; esac ; done",
                b.List().AddAndOr(b.AndOr(b.Pipeline(false,
                        b.SimpleCommand("command"),
                        b.While(
-                               b.List().AddCommand(b.SimpleCommand("condition")).AddSeparator(";"),
+                               b.List().AddCommand(b.SimpleCommand("condition")).AddSemicolon(),
                                b.List().AddCommand(b.Case(
                                        b.Token("selector"),
                                        b.CaseItem(
                                                b.Words("pattern"),
                                                b.List().AddCommand(b.SimpleCommand(":")),
-                                               &SEP_SEMI))).AddSeparator(";"))))))
+                                               sepSemicolon))).AddSemicolon())))))
 
        s.test("command1 \n command2 \n command3",
                b.List().
                        AddCommand(b.SimpleCommand("command1")).
-                       AddSeparator(SEP_NEWLINE).
+                       AddNewline().
                        AddCommand(b.SimpleCommand("command2")).
-                       AddSeparator(SEP_NEWLINE).
+                       AddNewline().
                        AddCommand(b.SimpleCommand("command3")))
 
        s.test("if condition; then action; else case selector in pattern) case-item-action ;; esac; fi",
                b.List().AddCommand(b.If(
-                       b.List().AddCommand(b.SimpleCommand("condition")).AddSeparator(";"),
-                       b.List().AddCommand(b.SimpleCommand("action")).AddSeparator(";"),
+                       b.List().AddCommand(b.SimpleCommand("condition")).AddSemicolon(),
+                       b.List().AddCommand(b.SimpleCommand("action")).AddSemicolon(),
                        b.List().AddCommand(b.Case(
                                b.Token("selector"),
                                b.CaseItem(
                                        b.Words("pattern"),
-                                       b.List().AddCommand(b.SimpleCommand("case-item-action")), nil))).AddSeparator(";"))))
+                                       b.List().AddCommand(b.SimpleCommand("case-item-action")), sepNone))).AddSemicolon())))
 }
 
 func (s *ShSuite) Test_ShellParser_list(c *check.C) {
@@ -92,15 +92,15 @@ func (s *ShSuite) Test_ShellParser_list(
        s.test("echo1 ; echo2",
                b.List().
                        AddCommand(b.SimpleCommand("echo1")).
-                       AddSeparator(";").
+                       AddSemicolon().
                        AddCommand(b.SimpleCommand("echo2")))
 
        s.test("echo1 ; echo2 &",
                b.List().
                        AddCommand(b.SimpleCommand("echo1")).
-                       AddSeparator(";").
+                       AddSemicolon().
                        AddCommand(b.SimpleCommand("echo2")).
-                       AddSeparator("&"))
+                       AddBackground())
 }
 
 func (s *ShSuite) Test_ShellParser_and_or(c *check.C) {
@@ -153,8 +153,8 @@ func (s *ShSuite) Test_ShellParser_pipe_
                b.List().AddAndOr(b.AndOr(b.Pipeline(false,
                        b.SimpleCommand("command1"),
                        b.If(
-                               b.List().AddCommand(b.SimpleCommand("true")).AddSeparator(";"),
-                               b.List().AddCommand(b.SimpleCommand(":")).AddSeparator(";"))))))
+                               b.List().AddCommand(b.SimpleCommand("true")).AddSemicolon(),
+                               b.List().AddCommand(b.SimpleCommand(":")).AddSemicolon())))))
 }
 
 func (s *ShSuite) Test_ShellParser_command(c *check.C) {
@@ -166,20 +166,20 @@ func (s *ShSuite) Test_ShellParser_comma
        s.test("while 1; do 2; done",
                b.List().AddAndOr(b.AndOr(b.Pipeline(false,
                        b.While(
-                               b.List().AddCommand(b.SimpleCommand("1")).AddSeparator(";"),
-                               b.List().AddCommand(b.SimpleCommand("2")).AddSeparator(";"))))))
+                               b.List().AddCommand(b.SimpleCommand("1")).AddSemicolon(),
+                               b.List().AddCommand(b.SimpleCommand("2")).AddSemicolon())))))
 
        s.test("while 1; do 2; done 1>&2",
                b.List().AddAndOr(b.AndOr(b.Pipeline(false,
                        b.While(
-                               b.List().AddCommand(b.SimpleCommand("1")).AddSeparator(";"),
-                               b.List().AddCommand(b.SimpleCommand("2")).AddSeparator(";"),
+                               b.List().AddCommand(b.SimpleCommand("1")).AddSemicolon(),
+                               b.List().AddCommand(b.SimpleCommand("2")).AddSemicolon(),
                                b.Redirection(1, ">&", "2"))))))
 
        s.test("func(){ echo hello;} 2>&1",
                b.List().AddCommand(b.Function(
                        "func",
-                       b.Brace(b.List().AddCommand(b.SimpleCommand("echo", "hello")).AddSeparator(";")).Compound,
+                       b.Brace(b.List().AddCommand(b.SimpleCommand("echo", "hello")).AddSemicolon()).Compound,
                        b.Redirection(2, ">&", "1"))))
 }
 
@@ -188,7 +188,7 @@ func (s *ShSuite) Test_ShellParser_compo
 
        s.test("{ brace ; }",
                b.List().AddCommand(b.Brace(
-                       b.List().AddCommand(b.SimpleCommand("brace")).AddSeparator(";"))))
+                       b.List().AddCommand(b.SimpleCommand("brace")).AddSemicolon())))
 
        s.test("( subshell )",
                b.List().AddCommand(b.Subshell(
@@ -198,7 +198,7 @@ func (s *ShSuite) Test_ShellParser_compo
                b.List().AddCommand(b.For(
                        "i",
                        b.Words("*"),
-                       b.List().AddCommand(b.SimpleCommand("echo", "$i")).AddSeparator(";"))))
+                       b.List().AddCommand(b.SimpleCommand("echo", "$i")).AddSemicolon())))
 
        s.test("case $i in esac",
                b.List().AddCommand(b.Case(
@@ -210,8 +210,8 @@ func (s *ShSuite) Test_ShellParser_subsh
        b := s.init(c)
 
        sub3 := b.Subshell(b.List().AddCommand(b.SimpleCommand("sub3")))
-       sub2 := b.Subshell(b.List().AddCommand(sub3).AddSeparator(";").AddCommand(b.SimpleCommand("sub2")))
-       sub1 := b.Subshell(b.List().AddCommand(sub2).AddSeparator(";").AddCommand(b.SimpleCommand("sub1")))
+       sub2 := b.Subshell(b.List().AddCommand(sub3).AddSemicolon().AddCommand(b.SimpleCommand("sub2")))
+       sub1 := b.Subshell(b.List().AddCommand(sub2).AddSemicolon().AddCommand(b.SimpleCommand("sub1")))
        s.test("( ( ( sub3 ) ; sub2 ) ; sub1 )", b.List().AddCommand(sub1))
 }
 
@@ -236,32 +236,32 @@ func (s *ShSuite) Test_ShellParser_for_c
                b.List().AddCommand(b.For(
                        "var",
                        b.Words("\"$$@\""),
-                       b.List().AddCommand(b.SimpleCommand("echo", "$var")).AddSeparator(";"))))
+                       b.List().AddCommand(b.SimpleCommand("echo", "$var")).AddSemicolon())))
 
        // Only linebreak is allowed, but not semicolon.
        s.test("for var \n do echo $var ; done",
                b.List().AddCommand(b.For(
                        "var",
                        b.Words("\"$$@\""),
-                       b.List().AddCommand(b.SimpleCommand("echo", "$var")).AddSeparator(";"))))
+                       b.List().AddCommand(b.SimpleCommand("echo", "$var")).AddSemicolon())))
 
        s.test("for var in a b c ; do echo $var ; done",
                b.List().AddCommand(b.For(
                        "var",
                        b.Words("a", "b", "c"),
-                       b.List().AddCommand(b.SimpleCommand("echo", "$var")).AddSeparator(";"))))
+                       b.List().AddCommand(b.SimpleCommand("echo", "$var")).AddSemicolon())))
 
        s.test("for var \n \n \n in a b c ; do echo $var ; done",
                b.List().AddCommand(b.For(
                        "var",
                        b.Words("a", "b", "c"),
-                       b.List().AddCommand(b.SimpleCommand("echo", "$var")).AddSeparator(";"))))
+                       b.List().AddCommand(b.SimpleCommand("echo", "$var")).AddSemicolon())))
 
        s.test("for var in in esac ; do echo $var ; done",
                b.List().AddCommand(b.For(
                        "var",
                        b.Words("in", "esac"),
-                       b.List().AddCommand(b.SimpleCommand("echo", "$var")).AddSeparator(";"))))
+                       b.List().AddCommand(b.SimpleCommand("echo", "$var")).AddSemicolon())))
 
        // No semicolon necessary between the two “done”.
        s.test("for i in 1; do for j in 1; do echo $$i$$j; done done",
@@ -271,7 +271,7 @@ func (s *ShSuite) Test_ShellParser_for_c
                        b.List().AddCommand(b.For(
                                "j",
                                b.Words("1"),
-                               b.List().AddCommand(b.SimpleCommand("echo", "$$i$$j")).AddSeparator(";"))))))
+                               b.List().AddCommand(b.SimpleCommand("echo", "$$i$$j")).AddSemicolon())))))
 }
 
 func (s *ShSuite) Test_ShellParser_case_clause(c *check.C) {
@@ -283,33 +283,33 @@ func (s *ShSuite) Test_ShellParser_case_
        s.test("case selector in pattern) ;; pattern) esac",
                b.List().AddCommand(b.Case(
                        b.Token("selector"),
-                       b.CaseItem(b.Words("pattern"), b.List(), nil),
-                       b.CaseItem(b.Words("pattern"), b.List(), nil))))
+                       b.CaseItem(b.Words("pattern"), b.List(), sepNone),
+                       b.CaseItem(b.Words("pattern"), b.List(), sepNone))))
 
        s.test("case $$i in *.c | *.h ) echo C ;; * ) echo Other ; esac",
                b.List().AddCommand(b.Case(
                        b.Token("$$i"),
-                       b.CaseItem(b.Words("*.c", "*.h"), b.List().AddCommand(b.SimpleCommand("echo", "C")), nil),
-                       b.CaseItem(b.Words("*"), b.List().AddCommand(b.SimpleCommand("echo", "Other")), &SEP_SEMI))))
+                       b.CaseItem(b.Words("*.c", "*.h"), b.List().AddCommand(b.SimpleCommand("echo", "C")), sepNone),
+                       b.CaseItem(b.Words("*"), b.List().AddCommand(b.SimpleCommand("echo", "Other")), sepSemicolon))))
 
        s.test("case $$i in *.c ) echo ; esac",
                b.List().AddCommand(b.Case(
                        b.Token("$$i"),
-                       b.CaseItem(b.Words("*.c"), b.List().AddCommand(b.SimpleCommand("echo")), &SEP_SEMI))))
+                       b.CaseItem(b.Words("*.c"), b.List().AddCommand(b.SimpleCommand("echo")), sepSemicolon))))
 
        s.test("case selector in pattern) case-item-action ; esac",
                b.List().AddCommand(b.Case(
                        b.Token("selector"),
                        b.CaseItem(
                                b.Words("pattern"),
-                               b.List().AddCommand(b.SimpleCommand("case-item-action")), &SEP_SEMI))))
+                               b.List().AddCommand(b.SimpleCommand("case-item-action")), sepSemicolon))))
 
        s.test("case selector in pattern) case-item-action ;; esac",
                b.List().AddCommand(b.Case(
                        b.Token("selector"),
                        b.CaseItem(
                                b.Words("pattern"),
-                               b.List().AddCommand(b.SimpleCommand("case-item-action")), nil))))
+                               b.List().AddCommand(b.SimpleCommand("case-item-action")), sepNone))))
 
 }
 
@@ -319,17 +319,17 @@ func (s *ShSuite) Test_ShellParser_if_cl
        s.test(
                "if true ; then echo yes ; else echo no ; fi",
                b.List().AddCommand(b.If(
-                       b.List().AddCommand(b.SimpleCommand("true")).AddSeparator(";"),
-                       b.List().AddCommand(b.SimpleCommand("echo", "yes")).AddSeparator(";"),
-                       b.List().AddCommand(b.SimpleCommand("echo", "no")).AddSeparator(";"))))
+                       b.List().AddCommand(b.SimpleCommand("true")).AddSemicolon(),
+                       b.List().AddCommand(b.SimpleCommand("echo", "yes")).AddSemicolon(),
+                       b.List().AddCommand(b.SimpleCommand("echo", "no")).AddSemicolon())))
 
        // No semicolon necessary between the two “fi”.
        s.test("if cond1; then if cond2; then action; fi fi",
                b.List().AddCommand(b.If(
-                       b.List().AddCommand(b.SimpleCommand("cond1")).AddSeparator(";"),
+                       b.List().AddCommand(b.SimpleCommand("cond1")).AddSemicolon(),
                        b.List().AddCommand(b.If(
-                               b.List().AddCommand(b.SimpleCommand("cond2")).AddSeparator(";"),
-                               b.List().AddCommand(b.SimpleCommand("action")).AddSeparator(";"))))))
+                               b.List().AddCommand(b.SimpleCommand("cond2")).AddSemicolon(),
+                               b.List().AddCommand(b.SimpleCommand("action")).AddSemicolon())))))
 }
 
 func (s *ShSuite) Test_ShellParser_while_clause(c *check.C) {
@@ -337,8 +337,8 @@ func (s *ShSuite) Test_ShellParser_while
 
        s.test("while condition ; do action ; done",
                b.List().AddCommand(b.While(
-                       b.List().AddCommand(b.SimpleCommand("condition")).AddSeparator(";"),
-                       b.List().AddCommand(b.SimpleCommand("action")).AddSeparator(";"))))
+                       b.List().AddCommand(b.SimpleCommand("condition")).AddSemicolon(),
+                       b.List().AddCommand(b.SimpleCommand("action")).AddSemicolon())))
 }
 
 func (s *ShSuite) Test_ShellParser_until_clause(c *check.C) {
@@ -346,8 +346,8 @@ func (s *ShSuite) Test_ShellParser_until
 
        s.test("until condition ; do action ; done",
                b.List().AddCommand(b.Until(
-                       b.List().AddCommand(b.SimpleCommand("condition")).AddSeparator(";"),
-                       b.List().AddCommand(b.SimpleCommand("action")).AddSeparator(";"))))
+                       b.List().AddCommand(b.SimpleCommand("condition")).AddSemicolon(),
+                       b.List().AddCommand(b.SimpleCommand("action")).AddSemicolon())))
 }
 
 func (s *ShSuite) Test_ShellParser_function_definition(c *check.C) {
@@ -362,9 +362,9 @@ func (s *ShSuite) Test_ShellParser_brace
        // No semicolon necessary after the closing brace.
        s.test("if true; then { echo yes; } fi",
                b.List().AddCommand(b.If(
-                       b.List().AddCommand(b.SimpleCommand("true")).AddSeparator(";"),
+                       b.List().AddCommand(b.SimpleCommand("true")).AddSemicolon(),
                        b.List().AddCommand(b.Brace(
-                               b.List().AddCommand(b.SimpleCommand("echo", "yes")).AddSeparator(";"))))))
+                               b.List().AddCommand(b.SimpleCommand("echo", "yes")).AddSemicolon())))))
 }
 
 func (s *ShSuite) Test_ShellParser_simple_command(c *check.C) {
@@ -477,10 +477,10 @@ func (s *ShSuite) test(program string, e
 
        if ok1, ok2 := c.Check(succeeded, equals, 0), c.Check(lexer.error, equals, ""); ok1 && ok2 {
                if !c.Check(lexer.result, deepEquals, expected) {
-                       actualJson, actualErr := json.MarshalIndent(lexer.result, "", "  ")
-                       expectedJson, expectedErr := json.MarshalIndent(expected, "", "  ")
+                       actualJSON, actualErr := json.MarshalIndent(lexer.result, "", "  ")
+                       expectedJSON, expectedErr := json.MarshalIndent(expected, "", "  ")
                        if c.Check(actualErr, check.IsNil) && c.Check(expectedErr, check.IsNil) {
-                               c.Check(string(actualJson), deepEquals, string(expectedJson))
+                               c.Check(string(actualJSON), deepEquals, string(expectedJSON))
                        }
                }
        } else {
@@ -584,7 +584,7 @@ func (b *MkShBuilder) Case(selector *ShT
        return &MkShCommand{Compound: &MkShCompoundCommand{Case: &MkShCaseClause{selector, items}}}
 }
 
-func (b *MkShBuilder) CaseItem(patterns []*ShToken, action *MkShList, separator *MkShSeparator) *MkShCaseItem {
+func (b *MkShBuilder) CaseItem(patterns []*ShToken, action *MkShList, separator MkShSeparator) *MkShCaseItem {
        return &MkShCaseItem{patterns, action, separator}
 }
 
Index: pkgsrc/pkgtools/pkglint/files/mkshtypes.go
diff -u pkgsrc/pkgtools/pkglint/files/mkshtypes.go:1.3 pkgsrc/pkgtools/pkglint/files/mkshtypes.go:1.4
--- pkgsrc/pkgtools/pkglint/files/mkshtypes.go:1.3      Sat Jul  9 09:43:48 2016
+++ pkgsrc/pkgtools/pkglint/files/mkshtypes.go  Sun Jul 10 21:24:47 2016
@@ -80,7 +80,7 @@ type MkShCaseClause struct {
 type MkShCaseItem struct {
        Patterns  []*ShToken
        Action    *MkShList
-       Separator *MkShSeparator
+       Separator MkShSeparator
 }
 
 type MkShIfClause struct {
@@ -163,11 +163,11 @@ type MkShRedirection struct {
        Target *ShToken
 }
 
-// One of ";", "&", "\n"
-type MkShSeparator string
+type MkShSeparator uint8
 
-var (
-       SEP_SEMI       MkShSeparator = ";"
-       SEP_BACKGROUND MkShSeparator = "&"
-       SEP_NEWLINE    MkShSeparator = "\n"
+const (
+       sepNone       MkShSeparator = iota
+       sepSemicolon                // ;
+       sepBackground               // &
+       sepNewline                  // \n
 )
Index: pkgsrc/pkgtools/pkglint/files/shtokenizer.go
diff -u pkgsrc/pkgtools/pkglint/files/shtokenizer.go:1.3 pkgsrc/pkgtools/pkglint/files/shtokenizer.go:1.4
--- pkgsrc/pkgtools/pkglint/files/shtokenizer.go:1.3    Sat Jul  9 09:43:48 2016
+++ pkgsrc/pkgtools/pkglint/files/shtokenizer.go        Sun Jul 10 21:24:47 2016
@@ -137,7 +137,7 @@ func (p *ShTokenizer) shAtomSub() *ShAto
        repl := p.parser.repl
        mark := repl.Mark()
        atom := func(typ ShAtomType) *ShAtom {
-               return NewShAtom(typ, repl.Since(mark), shqSubsh)
+               return &ShAtom{typ, repl.Since(mark), shqSubsh, nil}
        }
        switch {
        case repl.AdvanceHspace():
@@ -151,7 +151,7 @@ func (p *ShTokenizer) shAtomSub() *ShAto
        case repl.AdvanceRegexp(`^#.*`):
                return &ShAtom{shtComment, repl.m[0], q, nil}
        case repl.AdvanceStr(")"):
-               return NewShAtom(shtWord, repl.s, shqPlain)
+               return &ShAtom{shtWord, repl.s, shqPlain, nil}
        case repl.AdvanceRegexp(`^(?:[!#%*+,\-./0-9:=?@A-Z\[\]^_a-z{}~]+|\\[^$]|` + reShDollar + `)+`):
                return &ShAtom{shtWord, repl.m[0], q, nil}
        }
Index: pkgsrc/pkgtools/pkglint/files/shtypes.go
diff -u pkgsrc/pkgtools/pkglint/files/shtypes.go:1.3 pkgsrc/pkgtools/pkglint/files/shtypes.go:1.4
--- pkgsrc/pkgtools/pkglint/files/shtypes.go:1.3        Sat Jul  9 09:43:48 2016
+++ pkgsrc/pkgtools/pkglint/files/shtypes.go    Sun Jul 10 21:24:47 2016
@@ -44,14 +44,6 @@ type ShAtom struct {
        Data    interface{}
 }
 
-func NewShAtom(typ ShAtomType, text string, quoting ShQuoting) *ShAtom {
-       return &ShAtom{typ, text, quoting, nil}
-}
-
-func NewShAtomVaruse(text string, quoting ShQuoting, varname string, modifiers ...string) *ShAtom {
-       return &ShAtom{shtVaruse, text, quoting, NewMkVarUse(varname, modifiers...)}
-}
-
 func (token *ShAtom) String() string {
        if token.Type == shtWord && token.Quoting == shqPlain && token.Data == nil {
                return fmt.Sprintf("%q", token.MkText)
@@ -79,7 +71,6 @@ const (
        shqSubshSquot
        shqDquotBacktDquot
        shqDquotBacktSquot
-       shqUnknown
 )
 
 func (q ShQuoting) String() string {
@@ -88,7 +79,6 @@ func (q ShQuoting) String() string {
                "d", "s", "b", "S",
                "db", "bd", "bs", "Ss",
                "dbd", "dbs",
-               "unknown",
        }[q]
 }
 
Index: pkgsrc/pkgtools/pkglint/files/vartype_test.go
diff -u pkgsrc/pkgtools/pkglint/files/vartype_test.go:1.3 pkgsrc/pkgtools/pkglint/files/vartype_test.go:1.4
--- pkgsrc/pkgtools/pkglint/files/vartype_test.go:1.3   Sat Jul  9 09:43:48 2016
+++ pkgsrc/pkgtools/pkglint/files/vartype_test.go       Sun Jul 10 21:24:47 2016
@@ -8,13 +8,13 @@ func (s *Suite) Test_Vartype_EffectivePe
        G.globalData.InitVartypes()
 
        if t := G.globalData.vartypes["PREFIX"]; c.Check(t, check.NotNil) {
-               c.Check(t.checker.name, equals, "Pathname")
+               c.Check(t.basicType.name, equals, "Pathname")
                c.Check(t.aclEntries, check.DeepEquals, []AclEntry{{glob: "*", permissions: aclpUse}})
                c.Check(t.EffectivePermissions("Makefile"), equals, aclpUse)
        }
 
        if t := G.globalData.vartypes["EXTRACT_OPTS"]; c.Check(t, check.NotNil) {
-               c.Check(t.checker.name, equals, "ShellWord")
+               c.Check(t.basicType.name, equals, "ShellWord")
                c.Check(t.EffectivePermissions("Makefile"), equals, aclpAppend|aclpSet)
                c.Check(t.EffectivePermissions("../Makefile"), equals, aclpAppend|aclpSet)
                c.Check(t.EffectivePermissions("options.mk"), equals, aclpUnknown)

Index: pkgsrc/pkgtools/pkglint/files/mkparser_test.go
diff -u pkgsrc/pkgtools/pkglint/files/mkparser_test.go:1.2 pkgsrc/pkgtools/pkglint/files/mkparser_test.go:1.3
--- pkgsrc/pkgtools/pkglint/files/mkparser_test.go:1.2  Thu Jul  7 12:09:27 2016
+++ pkgsrc/pkgtools/pkglint/files/mkparser_test.go      Sun Jul 10 21:24:47 2016
@@ -159,6 +159,10 @@ func (s *Suite) Test_MkParser_MkCond(c *
                NewTree("compareVarStr", varuse("VARNAME"), "!=", "Value"))
        check("\"${VARNAME}\" != Value",
                NewTree("compareVarStr", varuse("VARNAME"), "!=", "Value"))
+       check("${pkg} == \"${name}\"",
+               NewTree("compareVarVar", varuse("pkg"), "==", varuse("name")))
+       check("\"${pkg}\" == \"${name}\"",
+               NewTree("compareVarVar", varuse("pkg"), "==", varuse("name")))
        check("(defined(VARNAME))",
                NewTree("defined", "VARNAME"))
        check("exists(/etc/hosts)",
Index: pkgsrc/pkgtools/pkglint/files/mktypes_test.go
diff -u pkgsrc/pkgtools/pkglint/files/mktypes_test.go:1.2 pkgsrc/pkgtools/pkglint/files/mktypes_test.go:1.3
--- pkgsrc/pkgtools/pkglint/files/mktypes_test.go:1.2   Thu Jul  7 12:09:27 2016
+++ pkgsrc/pkgtools/pkglint/files/mktypes_test.go       Sun Jul 10 21:24:47 2016
@@ -4,6 +4,10 @@ import (
        check "gopkg.in/check.v1"
 )
 
+func NewMkVarUse(varname string, modifiers ...string) *MkVarUse {
+       return &MkVarUse{varname, modifiers}
+}
+
 func (s *Suite) Test_MkVarUse_Mod(c *check.C) {
        varuse := &MkVarUse{"varname", []string{"Q"}}
 

Index: pkgsrc/pkgtools/pkglint/files/mktypes.go
diff -u pkgsrc/pkgtools/pkglint/files/mktypes.go:1.1 pkgsrc/pkgtools/pkglint/files/mktypes.go:1.2
--- pkgsrc/pkgtools/pkglint/files/mktypes.go:1.1        Sun Jun  5 11:24:32 2016
+++ pkgsrc/pkgtools/pkglint/files/mktypes.go    Sun Jul 10 21:24:47 2016
@@ -9,10 +9,6 @@ type MkVarUse struct {
        modifiers []string // E.g. "Q", "S/from/to/"
 }
 
-func NewMkVarUse(varname string, modifiers ...string) *MkVarUse {
-       return &MkVarUse{varname, modifiers}
-}
-
 func (vu *MkVarUse) Mod() string {
        mod := ""
        for _, modifier := range vu.modifiers {
Index: pkgsrc/pkgtools/pkglint/files/shell.y
diff -u pkgsrc/pkgtools/pkglint/files/shell.y:1.1 pkgsrc/pkgtools/pkglint/files/shell.y:1.2
--- pkgsrc/pkgtools/pkglint/files/shell.y:1.1   Thu Jul  7 12:09:27 2016
+++ pkgsrc/pkgtools/pkglint/files/shell.y       Sun Jul 10 21:24:47 2016
@@ -153,9 +153,9 @@ term : term separator and_or {
 
 for_clause : tkFOR tkWORD linebreak do_group {
        args := NewShToken("\"$$@\"",
-               NewShAtom(shtWord, "\"",shqDquot),
-               NewShAtom(shtWord, "$$@",shqDquot),
-               NewShAtom(shtWord,"\"",shqPlain))
+               &ShAtom{shtWord, "\"",shqDquot, nil},
+               &ShAtom{shtWord, "$$@",shqDquot, nil},
+               &ShAtom{shtWord,"\"",shqPlain, nil})
        $$ = &MkShForClause{$2.MkText, []*ShToken{args}, $4}
 }
 for_clause : tkFOR tkWORD linebreak tkIN sequential_sep do_group {
@@ -208,20 +208,20 @@ case_selector : pattern tkRPAREN {
 }
 
 case_item_ns : case_selector linebreak {
-       $$ = &MkShCaseItem{$1, &MkShList{}, nil}
+       $$ = &MkShCaseItem{$1, &MkShList{}, sepNone}
 }
 case_item_ns : case_selector linebreak term linebreak {
-       $$ = &MkShCaseItem{$1, $3, nil}
+       $$ = &MkShCaseItem{$1, $3, sepNone}
 }
 case_item_ns : case_selector linebreak term separator_op linebreak {
-       $$ = &MkShCaseItem{$1, $3, &$4}
+       $$ = &MkShCaseItem{$1, $3, $4}
 }
 
 case_item : case_selector linebreak tkSEMISEMI linebreak {
-       $$ = &MkShCaseItem{$1, &MkShList{}, nil}
+       $$ = &MkShCaseItem{$1, &MkShList{}, sepNone}
 }
 case_item : case_selector compound_list tkSEMISEMI linebreak {
-       $$ = &MkShCaseItem{$1, $2, nil}
+       $$ = &MkShCaseItem{$1, $2, sepNone}
 }
 
 pattern : tkWORD {
@@ -401,22 +401,22 @@ linebreak : /* empty */ {
 }
 
 separator_op : tkBACKGROUND {
-       $$ = "&"
+       $$ = sepBackground
 }
 separator_op : tkSEMI {
-       $$ = ";"
+       $$ = sepSemicolon
 }
 
 separator : separator_op linebreak {
        /* empty */
 }
 separator : newline_list {
-       $$ = "\n"
+       $$ = sepNewline
 }
 
 sequential_sep : tkSEMI linebreak {
-       $$ = ";"
+       $$ = sepSemicolon
 }
 sequential_sep : tkNEWLINE linebreak {
-       $$ = "\n"
+       $$ = sepNewline
 }
Index: pkgsrc/pkgtools/pkglint/files/shtypes_test.go
diff -u pkgsrc/pkgtools/pkglint/files/shtypes_test.go:1.1 pkgsrc/pkgtools/pkglint/files/shtypes_test.go:1.2
--- pkgsrc/pkgtools/pkglint/files/shtypes_test.go:1.1   Sun Jun  5 11:24:32 2016
+++ pkgsrc/pkgtools/pkglint/files/shtypes_test.go       Sun Jul 10 21:24:47 2016
@@ -4,10 +4,18 @@ import (
        check "gopkg.in/check.v1"
 )
 
+func NewShAtom(typ ShAtomType, text string, quoting ShQuoting) *ShAtom {
+       return &ShAtom{typ, text, quoting, nil}
+}
+
+func NewShAtomVaruse(text string, quoting ShQuoting, varname string, modifiers ...string) *ShAtom {
+       return &ShAtom{shtVaruse, text, quoting, NewMkVarUse(varname, modifiers...)}
+}
+
 func (s *Suite) Test_ShAtom_String(c *check.C) {
        c.Check(shtComment.String(), equals, "comment")
 }
 
 func (s *Suite) Test_ShQuoting_String(c *check.C) {
-       c.Check(shqUnknown.String(), equals, "unknown")
+       c.Check(shqDquotBacktSquot.String(), equals, "dbs")
 }

Index: pkgsrc/pkgtools/pkglint/files/package.go
diff -u pkgsrc/pkgtools/pkglint/files/package.go:1.10 pkgsrc/pkgtools/pkglint/files/package.go:1.11
--- pkgsrc/pkgtools/pkglint/files/package.go:1.10       Sat Jul  9 09:43:48 2016
+++ pkgsrc/pkgtools/pkglint/files/package.go    Sun Jul 10 21:24:47 2016
@@ -394,7 +394,7 @@ func (pkg *Package) checkfilePackageMake
        }
 
        if gnuLine, useLine := vardef["GNU_CONFIGURE"], vardef["USE_LANGUAGES"]; gnuLine != nil && useLine != nil {
-               if matches(useLine.Comment(), `(?-i)\b(?:c|empty|none)\b`) {
+               if matches(useLine.VarassignComment(), `(?-i)\b(?:c|empty|none)\b`) {
                        // Don't emit a warning, since the comment
                        // probably contains a statement that C is
                        // really not needed.
@@ -453,7 +453,7 @@ func (pkg *Package) determineEffectivePk
                pkgname = pkg.pkgnameFromDistname(pkgname, distname)
        }
 
-       if pkgname != "" && pkgname == distname && pkgnameLine.Comment() == "" {
+       if pkgname != "" && pkgname == distname && pkgnameLine.VarassignComment() == "" {
                pkgnameLine.Note0("PKGNAME is ${DISTNAME} by default. You probably don't need to define PKGNAME.")
        }
 
Index: pkgsrc/pkgtools/pkglint/files/pkglint.go
diff -u pkgsrc/pkgtools/pkglint/files/pkglint.go:1.10 pkgsrc/pkgtools/pkglint/files/pkglint.go:1.11
--- pkgsrc/pkgtools/pkglint/files/pkglint.go:1.10       Sat Jul  9 09:43:48 2016
+++ pkgsrc/pkgtools/pkglint/files/pkglint.go    Sun Jul 10 21:24:47 2016
@@ -7,7 +7,7 @@ import (
 )
 
 const (
-       reMkInclude = `^\.\s*(s?include)\s+\"([^\"]+)\"\s*(?:#.*)?$`
+       reMkInclude = `^\.(\s*)(s?include)\s+\"([^\"]+)\"\s*(?:#.*)?$`
        rePkgname   = `^([\w\-.+]+)-(\d(?:\w|\.\d)*)$`
 )
 

Index: pkgsrc/pkgtools/pkglint/files/shell.go
diff -u pkgsrc/pkgtools/pkglint/files/shell.go:1.11 pkgsrc/pkgtools/pkglint/files/shell.go:1.12
--- pkgsrc/pkgtools/pkglint/files/shell.go:1.11 Sat Jul  9 09:43:48 2016
+++ pkgsrc/pkgtools/pkglint/files/shell.go      Sun Jul 10 21:24:47 2016
@@ -8,7 +8,6 @@ import (
 )
 
 const (
-       reShVarassign    = `^([A-Z_a-z]\w*)=`
        reShVarname      = `(?:[!#*\-\d?@]|\$\$|[A-Za-z_]\w*)`
        reShVarexpansion = `(?:(?:#|##|%|%%|:-|:=|:\?|:\+|\+)[^$\\{}]*)`
        reShVaruse       = `\$\$` + `(?:` + reShVarname + `|` + `\{` + reShVarname + `(?:` + reShVarexpansion + `)?` + `\})`
@@ -24,7 +23,7 @@ func NewShellLine(mkline *MkLine) *Shell
        return &ShellLine{mkline.Line, mkline}
 }
 
-var shellcommandsContextType = &Vartype{lkNone, CheckvarShellCommands, []AclEntry{{"*", aclpAllRuntime}}, false}
+var shellcommandsContextType = &Vartype{lkNone, BtShellCommands, []AclEntry{{"*", aclpAllRuntime}}, false}
 var shellwordVuc = &VarUseContext{shellcommandsContextType, vucTimeUnknown, vucQuotPlain, false}
 
 func (shline *ShellLine) CheckWord(token string, checkQuoting bool) {
@@ -430,37 +429,37 @@ func NewSimpleCommandChecker(shline *She
 
 }
 
-func (c *SimpleCommandChecker) Check() {
+func (scc *SimpleCommandChecker) Check() {
        if G.opts.Debug {
-               defer tracecall(c.strcmd)()
+               defer tracecall(scc.strcmd)()
        }
 
-       c.checkCommandStart()
-       c.checkAbsolutePathnames()
-       c.checkAutoMkdirs()
-       c.checkInstallMulti()
-       c.checkPaxPe()
-       c.checkEchoN()
+       scc.checkCommandStart()
+       scc.checkAbsolutePathnames()
+       scc.checkAutoMkdirs()
+       scc.checkInstallMulti()
+       scc.checkPaxPe()
+       scc.checkEchoN()
 }
 
-func (ctx *SimpleCommandChecker) checkCommandStart() {
+func (scc *SimpleCommandChecker) checkCommandStart() {
        if G.opts.Debug {
                defer tracecall()()
        }
 
-       shellword := ctx.strcmd.Name
+       shellword := scc.strcmd.Name
        switch {
        case shellword == "${RUN}" || shellword == "":
-       case ctx.handleForbiddenCommand():
-       case ctx.handleTool():
-       case ctx.handleCommandVariable():
+       case scc.handleForbiddenCommand():
+       case scc.handleTool():
+       case scc.handleCommandVariable():
        case matches(shellword, `^(?::|break|cd|continue|eval|exec|exit|export|read|set|shift|umask|unset)$`):
        case hasPrefix(shellword, "./"): // All commands from the current directory are fine.
        case hasPrefix(shellword, "${PKGSRCDIR"): // With or without the :Q modifier
-       case ctx.handleComment():
+       case scc.handleComment():
        default:
                if G.opts.WarnExtra && !(G.Mk != nil && G.Mk.indentation.DependsOn("OPSYS")) {
-                       ctx.shline.line.Warn1("Unknown shell command %q.", shellword)
+                       scc.shline.line.Warn1("Unknown shell command %q.", shellword)
                        Explain3(
                                "If you want your package to be portable to all platforms that pkgsrc",
                                "supports, you should only use shell commands that are covered by the",
@@ -469,38 +468,38 @@ func (ctx *SimpleCommandChecker) checkCo
        }
 }
 
-func (ctx *SimpleCommandChecker) handleTool() bool {
+func (scc *SimpleCommandChecker) handleTool() bool {
        if G.opts.Debug {
                defer tracecall()()
        }
 
-       shellword := ctx.strcmd.Name
+       shellword := scc.strcmd.Name
        tool := G.globalData.Tools.byName[shellword]
        if tool == nil {
                return false
        }
 
        if !G.Mk.tools[shellword] && !G.Mk.tools["g"+shellword] {
-               ctx.shline.line.Warn1("The %q tool is used but not added to USE_TOOLS.", shellword)
+               scc.shline.line.Warn1("The %q tool is used but not added to USE_TOOLS.", shellword)
        }
 
        if tool.MustUseVarForm {
-               ctx.shline.line.Warn2("Please use \"${%s}\" instead of %q.", tool.Varname, shellword)
+               scc.shline.line.Warn2("Please use \"${%s}\" instead of %q.", tool.Varname, shellword)
        }
 
-       ctx.shline.checkCommandUse(shellword)
+       scc.shline.checkCommandUse(shellword)
        return true
 }
 
-func (ctx *SimpleCommandChecker) handleForbiddenCommand() bool {
+func (scc *SimpleCommandChecker) handleForbiddenCommand() bool {
        if G.opts.Debug {
                defer tracecall()()
        }
 
-       shellword := ctx.strcmd.Name
+       shellword := scc.strcmd.Name
        switch path.Base(shellword) {
        case "ktrace", "mktexlsr", "strace", "texconfig", "truss":
-               ctx.shline.line.Error1("%q must not be used in Makefiles.", shellword)
+               scc.shline.line.Error1("%q must not be used in Makefiles.", shellword)
                Explain3(
                        "This command must appear in INSTALL scripts, not in the package",
                        "Makefile, so that the package also works if it is installed as a binary",
@@ -510,24 +509,24 @@ func (ctx *SimpleCommandChecker) handleF
        return false
 }
 
-func (ctx *SimpleCommandChecker) handleCommandVariable() bool {
+func (scc *SimpleCommandChecker) handleCommandVariable() bool {
        if G.opts.Debug {
                defer tracecall()()
        }
 
-       shellword := ctx.strcmd.Name
+       shellword := scc.strcmd.Name
        if m, varname := match1(shellword, `^\$\{([\w_]+)\}$`); m {
 
                if tool := G.globalData.Tools.byVarname[varname]; tool != nil {
                        if !G.Mk.tools[tool.Name] {
-                               ctx.shline.line.Warn1("The %q tool is used but not added to USE_TOOLS.", tool.Name)
+                               scc.shline.line.Warn1("The %q tool is used but not added to USE_TOOLS.", tool.Name)
                        }
-                       ctx.shline.checkCommandUse(shellword)
+                       scc.shline.checkCommandUse(shellword)
                        return true
                }
 
-               if vartype := ctx.shline.mkline.getVariableType(varname); vartype != nil && vartype.checker.name == "ShellCommand" {
-                       ctx.shline.checkCommandUse(shellword)
+               if vartype := scc.shline.mkline.getVariableType(varname); vartype != nil && vartype.basicType.name == "ShellCommand" {
+                       scc.shline.checkCommandUse(shellword)
                        return true
                }
 
@@ -540,12 +539,12 @@ func (ctx *SimpleCommandChecker) handleC
        return false
 }
 
-func (ctx *SimpleCommandChecker) handleComment() bool {
+func (scc *SimpleCommandChecker) handleComment() bool {
        if G.opts.Debug {
                defer tracecall()()
        }
 
-       shellword := ctx.strcmd.Name
+       shellword := scc.strcmd.Name
        if G.opts.Debug {
                defer tracecall1(shellword)()
        }
@@ -555,13 +554,13 @@ func (ctx *SimpleCommandChecker) handleC
        }
 
        semicolon := contains(shellword, ";")
-       multiline := ctx.shline.line.IsMultiline()
+       multiline := scc.shline.line.IsMultiline()
 
        if semicolon {
-               ctx.shline.line.Warn0("A shell comment should not contain semicolons.")
+               scc.shline.line.Warn0("A shell comment should not contain semicolons.")
        }
        if multiline {
-               ctx.shline.line.Warn0("A shell comment does not stop at the end of line.")
+               scc.shline.line.Warn0("A shell comment does not stop at the end of line.")
        }
 
        if semicolon || multiline {
@@ -582,83 +581,19 @@ func (ctx *SimpleCommandChecker) handleC
        return true
 }
 
-type ShellProgramChecker struct {
-       shline *ShellLine
-}
-
-func (c *ShellProgramChecker) checkConditionalCd(list *MkShList) {
-       if G.opts.Debug {
-               defer tracecall()()
-       }
-
-       getSimple := func(list *MkShList) *MkShSimpleCommand {
-               if len(list.AndOrs) == 1 {
-                       if len(list.AndOrs[0].Pipes) == 1 {
-                               if len(list.AndOrs[0].Pipes[0].Cmds) == 1 {
-                                       return list.AndOrs[0].Pipes[0].Cmds[0].Simple
-                               }
-                       }
-               }
-               return nil
-       }
-
-       checkConditionalCd := func(cmd *MkShSimpleCommand) {
-               if NewStrCommand(cmd).Name == "cd" {
-                       c.shline.line.Error0("The Solaris /bin/sh cannot handle \"cd\" inside conditionals.")
-                       Explain3(
-                               "When the Solaris shell is in \"set -e\" mode and \"cd\" fails, the",
-                               "shell will exit, no matter if it is protected by an \"if\" or the",
-                               "\"||\" operator.")
-               }
-       }
-
-       (*MkShWalker).Walk(nil, list, func(node interface{}) {
-               if cmd, ok := node.(*MkShIfClause); ok {
-                       for _, cond := range cmd.Conds {
-                               if simple := getSimple(cond); simple != nil {
-                                       checkConditionalCd(simple)
-                               }
-                       }
-               }
-               if cmd, ok := node.(*MkShLoopClause); ok {
-                       if simple := getSimple(cmd.Cond); simple != nil {
-                               checkConditionalCd(simple)
-                       }
-               }
-       })
-}
-
-func (c *ShellProgramChecker) checkWords(words []*ShToken, checkQuoting bool) {
-       if G.opts.Debug {
-               defer tracecall()()
-       }
-
-       for _, word := range words {
-               c.checkWord(word, checkQuoting)
-       }
-}
-
-func (c *ShellProgramChecker) checkWord(word *ShToken, checkQuoting bool) {
-       if G.opts.Debug {
-               defer tracecall(word.MkText)()
-       }
-
-       c.shline.CheckWord(word.MkText, checkQuoting)
-}
-
-func (c *SimpleCommandChecker) checkAbsolutePathnames() {
+func (scc *SimpleCommandChecker) checkAbsolutePathnames() {
        if G.opts.Debug {
                defer tracecall()()
        }
 
-       cmdname := c.strcmd.Name
+       cmdname := scc.strcmd.Name
        isSubst := false
-       for _, arg := range c.strcmd.Args {
+       for _, arg := range scc.strcmd.Args {
                if !isSubst {
-                       c.shline.line.CheckAbsolutePathname(arg)
+                       scc.shline.line.CheckAbsolutePathname(arg)
                }
                if false && isSubst && !matches(arg, `"^[\"\'].*[\"\']$`) {
-                       c.shline.line.Warn1("Substitution commands like %q should always be quoted.", arg)
+                       scc.shline.line.Warn1("Substitution commands like %q should always be quoted.", arg)
                        Explain3(
                                "Usually these substitution commands contain characters like '*' or",
                                "other shell metacharacters that might lead to lookup of matching",
@@ -668,16 +603,16 @@ func (c *SimpleCommandChecker) checkAbso
        }
 }
 
-func (ctx *SimpleCommandChecker) checkAutoMkdirs() {
+func (scc *SimpleCommandChecker) checkAutoMkdirs() {
        if G.opts.Debug {
                defer tracecall()()
        }
 
-       cmdname := ctx.strcmd.Name
+       cmdname := scc.strcmd.Name
        switch {
        case cmdname == "${MKDIR}":
                break
-       case cmdname == "${INSTALL}" && ctx.strcmd.HasOption("-d"):
+       case cmdname == "${INSTALL}" && scc.strcmd.HasOption("-d"):
                cmdname = "${INSTALL} -d"
        case matches(cmdname, `^\$\{INSTALL_.*_DIR\}$`):
                break
@@ -685,10 +620,10 @@ func (ctx *SimpleCommandChecker) checkAu
                return
        }
 
-       for _, arg := range ctx.strcmd.Args {
+       for _, arg := range scc.strcmd.Args {
                if !contains(arg, "$$") && !matches(arg, `\$\{[_.]*[a-z]`) {
                        if m, dirname := match1(arg, `^(?:\$\{DESTDIR\})?\$\{PREFIX(?:|:Q)\}/(.*)`); m {
-                               ctx.shline.line.Note2("You can use AUTO_MKDIRS=yes or \"INSTALLATION_DIRS+= %s\" instead of %q.", dirname, cmdname)
+                               scc.shline.line.Note2("You can use AUTO_MKDIRS=yes or \"INSTALLATION_DIRS+= %s\" instead of %q.", dirname, cmdname)
                                Explain(
                                        "Many packages include a list of all needed directories in their",
                                        "PLIST file.  In such a case, you can just set AUTO_MKDIRS=yes and",
@@ -705,12 +640,12 @@ func (ctx *SimpleCommandChecker) checkAu
        }
 }
 
-func (ctx *SimpleCommandChecker) checkInstallMulti() {
+func (scc *SimpleCommandChecker) checkInstallMulti() {
        if G.opts.Debug {
                defer tracecall()()
        }
 
-       cmd := ctx.strcmd
+       cmd := scc.strcmd
 
        if hasPrefix(cmd.Name, "${INSTALL_") && hasSuffix(cmd.Name, "_DIR}") {
                prevdir := ""
@@ -722,7 +657,7 @@ func (ctx *SimpleCommandChecker) checkIn
                                break
                        default:
                                if prevdir != "" {
-                                       ctx.shline.line.Warn0("The INSTALL_*_DIR commands can only handle one directory at a time.")
+                                       scc.shline.line.Warn0("The INSTALL_*_DIR commands can only handle one directory at a time.")
                                        Explain2(
                                                "Many implementations of install(1) can handle more, but pkgsrc aims",
                                                "at maximum portability.")
@@ -734,13 +669,13 @@ func (ctx *SimpleCommandChecker) checkIn
        }
 }
 
-func (ctx *SimpleCommandChecker) checkPaxPe() {
+func (scc *SimpleCommandChecker) checkPaxPe() {
        if G.opts.Debug {
                defer tracecall()()
        }
 
-       if ctx.strcmd.Name == "${PAX}" && ctx.strcmd.HasOption("-pe") {
-               ctx.shline.line.Warn0("Please use the -pp option to pax(1) instead of -pe.")
+       if scc.strcmd.Name == "${PAX}" && scc.strcmd.HasOption("-pe") {
+               scc.shline.line.Warn0("Please use the -pp option to pax(1) instead of -pe.")
                Explain3(
                        "The -pe option tells pax to preserve the ownership of the files, which",
                        "means that the installed files will belong to the user that has built",
@@ -748,17 +683,81 @@ func (ctx *SimpleCommandChecker) checkPa
        }
 }
 
-func (ctx *SimpleCommandChecker) checkEchoN() {
+func (scc *SimpleCommandChecker) checkEchoN() {
+       if G.opts.Debug {
+               defer tracecall()()
+       }
+
+       if scc.strcmd.Name == "${ECHO}" && scc.strcmd.HasOption("-n") {
+               scc.shline.line.Warn0("Please use ${ECHO_N} instead of \"echo -n\".")
+       }
+}
+
+type ShellProgramChecker struct {
+       shline *ShellLine
+}
+
+func (spc *ShellProgramChecker) checkConditionalCd(list *MkShList) {
+       if G.opts.Debug {
+               defer tracecall()()
+       }
+
+       getSimple := func(list *MkShList) *MkShSimpleCommand {
+               if len(list.AndOrs) == 1 {
+                       if len(list.AndOrs[0].Pipes) == 1 {
+                               if len(list.AndOrs[0].Pipes[0].Cmds) == 1 {
+                                       return list.AndOrs[0].Pipes[0].Cmds[0].Simple
+                               }
+                       }
+               }
+               return nil
+       }
+
+       checkConditionalCd := func(cmd *MkShSimpleCommand) {
+               if NewStrCommand(cmd).Name == "cd" {
+                       spc.shline.line.Error0("The Solaris /bin/sh cannot handle \"cd\" inside conditionals.")
+                       Explain3(
+                               "When the Solaris shell is in \"set -e\" mode and \"cd\" fails, the",
+                               "shell will exit, no matter if it is protected by an \"if\" or the",
+                               "\"||\" operator.")
+               }
+       }
+
+       (*MkShWalker).Walk(nil, list, func(node interface{}) {
+               if cmd, ok := node.(*MkShIfClause); ok {
+                       for _, cond := range cmd.Conds {
+                               if simple := getSimple(cond); simple != nil {
+                                       checkConditionalCd(simple)
+                               }
+                       }
+               }
+               if cmd, ok := node.(*MkShLoopClause); ok {
+                       if simple := getSimple(cmd.Cond); simple != nil {
+                               checkConditionalCd(simple)
+                       }
+               }
+       })
+}
+
+func (spc *ShellProgramChecker) checkWords(words []*ShToken, checkQuoting bool) {
        if G.opts.Debug {
                defer tracecall()()
        }
 
-       if ctx.strcmd.Name == "${ECHO}" && ctx.strcmd.HasOption("-n") {
-               ctx.shline.line.Warn0("Please use ${ECHO_N} instead of \"echo -n\".")
+       for _, word := range words {
+               spc.checkWord(word, checkQuoting)
        }
 }
 
-func (ctx *ShellProgramChecker) checkPipeExitcode(line *Line, pipeline *MkShPipeline) {
+func (spc *ShellProgramChecker) checkWord(word *ShToken, checkQuoting bool) {
+       if G.opts.Debug {
+               defer tracecall(word.MkText)()
+       }
+
+       spc.shline.CheckWord(word.MkText, checkQuoting)
+}
+
+func (scc *ShellProgramChecker) checkPipeExitcode(line *Line, pipeline *MkShPipeline) {
        if G.opts.Debug {
                defer tracecall()()
        }
@@ -774,7 +773,7 @@ func (ctx *ShellProgramChecker) checkPip
        }
 }
 
-func (ctx *ShellProgramChecker) checkSetE(list *MkShList, eflag *bool) {
+func (scc *ShellProgramChecker) checkSetE(list *MkShList, eflag *bool) {
        if G.opts.Debug {
                defer tracecall()()
        }
@@ -782,7 +781,7 @@ func (ctx *ShellProgramChecker) checkSet
        // Disabled until the shell parser can recognize "command || exit 1" reliably.
        if false && G.opts.WarnExtra && !*eflag && "the current token" == ";" {
                *eflag = true
-               ctx.shline.line.Warn1("Please switch to \"set -e\" mode before using a semicolon (the one after %q) to separate commands.", "previous token")
+               scc.shline.line.Warn1("Please switch to \"set -e\" mode before using a semicolon (the one after %q) to separate commands.", "previous token")
                Explain(
                        "Normally, when a shell command fails (returns non-zero), the",
                        "remaining commands are still executed.  For example, the following",
@@ -898,84 +897,3 @@ func splitIntoMkWords(line *Line, text s
        }
        return words, word + p.mkp.Rest()
 }
-
-type ShQuote struct {
-       repl *PrefixReplacer
-       q    ShQuoting
-}
-
-func NewShQuote(s string) *ShQuote {
-       return &ShQuote{NewPrefixReplacer(s), shqPlain}
-}
-
-func (sq *ShQuote) Feed(str string) {
-       const (
-               reSkip = "^[^\"'`\\\\]+" // Characters that don’t influence the quoting mode.
-       )
-
-       repl := sq.repl
-       repl.rest += str
-       for repl.rest != "" {
-               if repl.AdvanceRegexp(reSkip) {
-                       continue
-               }
-
-               mark := repl.Mark()
-               switch sq.q {
-               case shqPlain:
-                       switch {
-                       case repl.AdvanceStr("\""):
-                               sq.q = shqDquot
-                       case repl.AdvanceStr("'"):
-                               sq.q = shqSquot
-                       case repl.AdvanceStr("`"):
-                               sq.q = shqBackt
-                       case repl.AdvanceRegexp(`^\\.`):
-                       }
-
-               case shqDquot:
-                       switch {
-                       case repl.AdvanceStr("\""):
-                               sq.q = shqPlain
-                       case repl.AdvanceStr("`"):
-                               sq.q = shqDquotBackt
-                       case repl.AdvanceStr("'"):
-                       case repl.AdvanceRegexp(`^\\.`):
-                       }
-               case shqSquot:
-                       switch {
-                       case repl.AdvanceStr("'"):
-                               sq.q = shqPlain
-                       case repl.AdvanceRegexp(`^[^']+`):
-                       }
-               case shqBackt:
-                       switch {
-                       case repl.AdvanceStr("`"):
-                               sq.q = shqPlain
-                       case repl.AdvanceStr("'"):
-                               sq.q = shqBacktSquot
-                       case repl.AdvanceRegexp(`^\\.`):
-                       }
-
-               case shqDquotBackt:
-                       switch {
-                       case repl.AdvanceStr("`"):
-                               sq.q = shqDquot
-                       case repl.AdvanceStr("'"):
-                               sq.q = shqDquotBacktSquot
-                       case repl.AdvanceRegexp(`^\\.`):
-                       }
-               case shqDquotBacktSquot:
-                       switch {
-                       case repl.AdvanceStr("'"):
-                               sq.q = shqDquotBackt
-                       }
-               }
-
-               if repl.Since(mark) == "" {
-                       traceStep2("ShQuote.stuck stack=%s rest=%s", sq.q.String(), sq.repl.rest)
-                       repl.AdvanceRest()
-                       sq.q = shqUnknown
-               }
-       }
-}
Index: pkgsrc/pkgtools/pkglint/files/shell_test.go
diff -u pkgsrc/pkgtools/pkglint/files/shell_test.go:1.11 pkgsrc/pkgtools/pkglint/files/shell_test.go:1.12
--- pkgsrc/pkgtools/pkglint/files/shell_test.go:1.11    Sat Jul  9 09:43:48 2016
+++ pkgsrc/pkgtools/pkglint/files/shell_test.go Sun Jul 10 21:24:47 2016
@@ -1,8 +1,6 @@
 package main
 
 import (
-       "strings"
-
        check "gopkg.in/check.v1"
 )
 
@@ -500,24 +498,6 @@ func (s *Suite) Test_ShellLine__shell_co
        c.Check(s.Output(), equals, "WARN: ~/Makefile:3--4: A shell comment does not stop at the end of line.\n")
 }
 
-func (s *Suite) Test_ShQuote(c *check.C) {
-       traceQuoting := func(input string) (result string) {
-               sq := NewShQuote("")
-               for _, part := range strings.Split(input, "x") {
-                       sq.Feed(part)
-                       result += part + "[" + sq.q.String() + "]"
-               }
-               return
-       }
-
-       c.Check(traceQuoting("x\"x`x`x\"x'x\"x'"), equals, "[plain]\"[d]`[db]`[d]\"[plain]'[s]\"[s]'[plain]")
-       c.Check(traceQuoting("x\"x`x'x'x`x\""), equals, "[plain]\"[d]`[db]'[dbs]'[db]`[d]\"[plain]")
-       c.Check(traceQuoting("x\\\"x\\'x\\`x\\\\"), equals, "[plain]\\\"[plain]\\'[plain]\\`[plain]\\\\[plain]")
-       c.Check(traceQuoting("x\"x\\\"x\\'x\\`x\\\\"), equals, "[plain]\"[d]\\\"[d]\\'[d]\\`[d]\\\\[d]")
-       c.Check(traceQuoting("x'x\\\"x\\'x\\`x\\\\"), equals, "[plain]'[s]\\\"[s]\\'[plain]\\`[plain]\\\\[plain]")
-       c.Check(traceQuoting("x`x\\\"x\\'x\\`x\\\\"), equals, "[plain]`[b]\\\"[b]\\'[b]\\`[b]\\\\[b]")
-}
-
 func (s *Suite) Test_ShellLine_unescapeBackticks(c *check.C) {
        shline := NewShellLine(NewMkLine(dummyLine))
        // foobar="`echo \"foo   bar\"`"

Index: pkgsrc/pkgtools/pkglint/files/vardefs.go
diff -u pkgsrc/pkgtools/pkglint/files/vardefs.go:1.13 pkgsrc/pkgtools/pkglint/files/vardefs.go:1.14
--- pkgsrc/pkgtools/pkglint/files/vardefs.go:1.13       Sun Jul 10 11:37:27 2016
+++ pkgsrc/pkgtools/pkglint/files/vardefs.go    Sun Jul 10 21:24:47 2016
@@ -17,734 +17,734 @@ import (
 // Last synced with mk/defaults/mk.conf revision 1.118
 
 func (gd *GlobalData) InitVartypes() {
-       usr("ALLOW_VULNERABLE_PACKAGES", lkNone, CheckvarYes)
+       usr("ALLOW_VULNERABLE_PACKAGES", lkNone, BtYes)
        usr("MANINSTALL", lkShell, enum("maninstall catinstall"))
-       usr("MANZ", lkNone, CheckvarYes)
-       usr("GZIP", lkShell, CheckvarShellWord)
-       usr("MKCRYPTO", lkNone, CheckvarYesNo)
-       usr("OBJHOSTNAME", lkNone, CheckvarYes)
-       usr("OBJMACHINE", lkNone, CheckvarYes)
-       usr("PKG_SUFX", lkNone, CheckvarFilename)
+       usr("MANZ", lkNone, BtYes)
+       usr("GZIP", lkShell, BtShellWord)
+       usr("MKCRYPTO", lkNone, BtYesNo)
+       usr("OBJHOSTNAME", lkNone, BtYes)
+       usr("OBJMACHINE", lkNone, BtYes)
+       usr("PKG_SUFX", lkNone, BtFilename)
        usr("PKGSRC_LOCKTYPE", lkNone, enum("none sleep once"))
-       usr("PKGSRC_SLEEPSECS", lkNone, CheckvarInteger)
-       usr("USETBL", lkNone, CheckvarYes)
+       usr("PKGSRC_SLEEPSECS", lkNone, BtInteger)
+       usr("USETBL", lkNone, BtYes)
        usr("ABI", lkNone, enum("32 64"))
-       usr("PKG_DEVELOPER", lkNone, CheckvarYesNo)
-       usr("USE_ABI_DEPENDS", lkNone, CheckvarYesNo)
+       usr("PKG_DEVELOPER", lkNone, BtYesNo)
+       usr("USE_ABI_DEPENDS", lkNone, BtYesNo)
        usr("PKG_REGISTER_SHELLS", lkNone, enum("YES NO"))
        usr("PKGSRC_COMPILER", lkShell, enum("ccache ccc clang distcc f2c gcc hp icc ido gcc mipspro mipspro-ucode pcc sunpro xlc"))
-       usr("PKGSRC_MESSAGE_RECIPIENTS", lkShell, CheckvarMailAddress)
-       usr("PKGSRC_SHOW_BUILD_DEFS", lkNone, CheckvarYesNo)
-       usr("PKGSRC_SHOW_PATCH_ERRORMSG", lkNone, CheckvarYesNo)
-       usr("PKGSRC_RUN_TEST", lkNone, CheckvarYesNo)
-       usr("PREFER_PKGSRC", lkShell, CheckvarIdentifier)
-       usr("PREFER_NATIVE", lkShell, CheckvarIdentifier)
-       usr("PREFER_NATIVE_PTHREADS", lkNone, CheckvarYesNo)
-       usr("LOCALBASE", lkNone, CheckvarPathname)
-       usr("CROSSBASE", lkNone, CheckvarPathname)
-       usr("VARBASE", lkNone, CheckvarPathname)
+       usr("PKGSRC_MESSAGE_RECIPIENTS", lkShell, BtMailAddress)
+       usr("PKGSRC_SHOW_BUILD_DEFS", lkNone, BtYesNo)
+       usr("PKGSRC_SHOW_PATCH_ERRORMSG", lkNone, BtYesNo)
+       usr("PKGSRC_RUN_TEST", lkNone, BtYesNo)
+       usr("PREFER_PKGSRC", lkShell, BtIdentifier)
+       usr("PREFER_NATIVE", lkShell, BtIdentifier)
+       usr("PREFER_NATIVE_PTHREADS", lkNone, BtYesNo)
+       usr("LOCALBASE", lkNone, BtPathname)
+       usr("CROSSBASE", lkNone, BtPathname)
+       usr("VARBASE", lkNone, BtPathname)
        usr("X11_TYPE", lkNone, enum("modular native"))
-       usr("X11BASE", lkNone, CheckvarPathname)
-       usr("MOTIFBASE", lkNone, CheckvarPathname)
-       usr("PKGINFODIR", lkNone, CheckvarPathname)
-       usr("PKGMANDIR", lkNone, CheckvarPathname)
-       usr("USE_XPKGWEDGE", lkNone, CheckvarYesNo)
-       usr("BSDSRCDIR", lkNone, CheckvarPathname)
-       usr("BSDXSRCDIR", lkNone, CheckvarPathname)
-       usr("DISTDIR", lkNone, CheckvarPathname)
-       usr("DIST_PATH", lkNone, CheckvarPathlist)
-       usr("DEFAULT_VIEW", lkNone, CheckvarUnchecked)
-       usr("FETCH_CMD", lkNone, CheckvarShellCommand)
+       usr("X11BASE", lkNone, BtPathname)
+       usr("MOTIFBASE", lkNone, BtPathname)
+       usr("PKGINFODIR", lkNone, BtPathname)
+       usr("PKGMANDIR", lkNone, BtPathname)
+       usr("USE_XPKGWEDGE", lkNone, BtYesNo)
+       usr("BSDSRCDIR", lkNone, BtPathname)
+       usr("BSDXSRCDIR", lkNone, BtPathname)
+       usr("DISTDIR", lkNone, BtPathname)
+       usr("DIST_PATH", lkNone, BtPathlist)
+       usr("DEFAULT_VIEW", lkNone, BtUnknown)
+       usr("FETCH_CMD", lkNone, BtShellCommand)
        usr("FETCH_USING", lkNone, enum("curl custom fetch ftp manual wget"))
-       usr("FETCH_RESUME_ARGS", lkShell, CheckvarShellWord)
-       usr("FETCH_OUTPUT_ARGS", lkShell, CheckvarShellWord)
-       usr("LIBTOOLIZE_PLIST", lkNone, CheckvarYesNo)
-       usr("PKG_RESUME_TRANSFERS", lkNone, CheckvarYesNo)
-       usr("PKG_SYSCONFBASE", lkNone, CheckvarPathname)
-       usr("RCD_SCRIPTS_DIR", lkNone, CheckvarPathname)
-       usr("PACKAGES", lkNone, CheckvarPathname)
-       usr("PKGVULNDIR", lkNone, CheckvarPathname)
-       usr("PASSIVE_FETCH", lkNone, CheckvarYes)
+       usr("FETCH_RESUME_ARGS", lkShell, BtShellWord)
+       usr("FETCH_OUTPUT_ARGS", lkShell, BtShellWord)
+       usr("LIBTOOLIZE_PLIST", lkNone, BtYesNo)
+       usr("PKG_RESUME_TRANSFERS", lkNone, BtYesNo)
+       usr("PKG_SYSCONFBASE", lkNone, BtPathname)
+       usr("RCD_SCRIPTS_DIR", lkNone, BtPathname)
+       usr("PACKAGES", lkNone, BtPathname)
+       usr("PKGVULNDIR", lkNone, BtPathname)
+       usr("PASSIVE_FETCH", lkNone, BtYes)
        usr("PATCH_FUZZ_FACTOR", lkNone, enum("-F0 -F1 -F2 -F3"))
-       usr("ACCEPTABLE_LICENSES", lkShell, CheckvarIdentifier)
-       usr("SPECIFIC_PKGS", lkNone, CheckvarYes)
-       usr("SITE_SPECIFIC_PKGS", lkShell, CheckvarPkgPath)
-       usr("HOST_SPECIFIC_PKGS", lkShell, CheckvarPkgPath)
-       usr("GROUP_SPECIFIC_PKGS", lkShell, CheckvarPkgPath)
-       usr("USER_SPECIFIC_PKGS", lkShell, CheckvarPkgPath)
-       usr("FAILOVER_FETCH", lkNone, CheckvarYes)
-       usr("MASTER_SORT", lkShell, CheckvarUnchecked)
-       usr("MASTER_SORT_REGEX", lkShell, CheckvarUnchecked)
-       usr("PATCH_DEBUG", lkNone, CheckvarYes)
-       usr("PKG_FC", lkNone, CheckvarShellCommand)
-       usr("IMAKE", lkNone, CheckvarShellCommand)
-       usr("IMAKEOPTS", lkShell, CheckvarShellWord)
-       usr("PRE_ROOT_CMD", lkNone, CheckvarShellCommand)
-       pkg("USE_GAMESGROUP", lkNone, CheckvarYesNo)
-       usr("SU_CMD", lkNone, CheckvarShellCommand)
-       usr("SU_CMD_PATH_APPEND", lkNone, CheckvarPathlist)
-       usr("FATAL_OBJECT_FMT_SKEW", lkNone, CheckvarYesNo)
-       usr("WARN_NO_OBJECT_FMT", lkNone, CheckvarYesNo)
-       usr("SMART_MESSAGES", lkNone, CheckvarYes)
-       usr("BINPKG_SITES", lkShell, CheckvarURL)
-       usr("BIN_INSTALL_FLAG", lkShell, CheckvarShellWord)
-       usr("LOCALPATCHES", lkNone, CheckvarPathname)
+       usr("ACCEPTABLE_LICENSES", lkShell, BtIdentifier)
+       usr("SPECIFIC_PKGS", lkNone, BtYes)
+       usr("SITE_SPECIFIC_PKGS", lkShell, BtPkgPath)
+       usr("HOST_SPECIFIC_PKGS", lkShell, BtPkgPath)
+       usr("GROUP_SPECIFIC_PKGS", lkShell, BtPkgPath)
+       usr("USER_SPECIFIC_PKGS", lkShell, BtPkgPath)
+       usr("FAILOVER_FETCH", lkNone, BtYes)
+       usr("MASTER_SORT", lkShell, BtUnknown)
+       usr("MASTER_SORT_REGEX", lkShell, BtUnknown)
+       usr("PATCH_DEBUG", lkNone, BtYes)
+       usr("PKG_FC", lkNone, BtShellCommand)
+       usr("IMAKE", lkNone, BtShellCommand)
+       usr("IMAKEOPTS", lkShell, BtShellWord)
+       usr("PRE_ROOT_CMD", lkNone, BtShellCommand)
+       pkg("USE_GAMESGROUP", lkNone, BtYesNo)
+       usr("SU_CMD", lkNone, BtShellCommand)
+       usr("SU_CMD_PATH_APPEND", lkNone, BtPathlist)
+       usr("FATAL_OBJECT_FMT_SKEW", lkNone, BtYesNo)
+       usr("WARN_NO_OBJECT_FMT", lkNone, BtYesNo)
+       usr("SMART_MESSAGES", lkNone, BtYes)
+       usr("BINPKG_SITES", lkShell, BtURL)
+       usr("BIN_INSTALL_FLAG", lkShell, BtShellWord)
+       usr("LOCALPATCHES", lkNone, BtPathname)
 
        // some other variables, sorted alphabetically
 
-       acl(".CURDIR", lkNone, CheckvarPathname, "buildlink3.mk:; *: use, use-loadtime")
-       acl(".TARGET", lkNone, CheckvarPathname, "buildlink3.mk:; *: use, use-loadtime")
-       acl("ALL_ENV", lkShell, CheckvarShellWord, "")
-       acl("ALTERNATIVES_FILE", lkNone, CheckvarFilename, "")
-       acl("ALTERNATIVES_SRC", lkShell, CheckvarPathname, "")
-       pkg("APACHE_MODULE", lkNone, CheckvarYes)
-       sys("AR", lkNone, CheckvarShellCommand)
-       sys("AS", lkNone, CheckvarShellCommand)
-       pkglist("AUTOCONF_REQD", lkShell, CheckvarVersion)
-       acl("AUTOMAKE_OVERRIDE", lkShell, CheckvarPathmask, "")
-       pkglist("AUTOMAKE_REQD", lkShell, CheckvarVersion)
-       pkg("AUTO_MKDIRS", lkNone, CheckvarYesNo)
-       usr("BATCH", lkNone, CheckvarYes)
-       acl("BDB185_DEFAULT", lkNone, CheckvarUnchecked, "")
-       sys("BDBBASE", lkNone, CheckvarPathname)
+       acl(".CURDIR", lkNone, BtPathname, "buildlink3.mk:; *: use, use-loadtime")
+       acl(".TARGET", lkNone, BtPathname, "buildlink3.mk:; *: use, use-loadtime")
+       acl("ALL_ENV", lkShell, BtShellWord, "")
+       acl("ALTERNATIVES_FILE", lkNone, BtFilename, "")
+       acl("ALTERNATIVES_SRC", lkShell, BtPathname, "")
+       pkg("APACHE_MODULE", lkNone, BtYes)
+       sys("AR", lkNone, BtShellCommand)
+       sys("AS", lkNone, BtShellCommand)
+       pkglist("AUTOCONF_REQD", lkShell, BtVersion)
+       acl("AUTOMAKE_OVERRIDE", lkShell, BtPathmask, "")
+       pkglist("AUTOMAKE_REQD", lkShell, BtVersion)
+       pkg("AUTO_MKDIRS", lkNone, BtYesNo)
+       usr("BATCH", lkNone, BtYes)
+       acl("BDB185_DEFAULT", lkNone, BtUnknown, "")
+       sys("BDBBASE", lkNone, BtPathname)
        pkg("BDB_ACCEPTED", lkShell, enum("db1 db2 db3 db4 db5"))
        acl("BDB_DEFAULT", lkNone, enum("db1 db2 db3 db4 db5"), "")
-       sys("BDB_LIBS", lkShell, CheckvarLdFlag)
+       sys("BDB_LIBS", lkShell, BtLdFlag)
        sys("BDB_TYPE", lkNone, enum("db1 db2 db3 db4 db5"))
-       sys("BINGRP", lkNone, CheckvarUserGroupName)
-       sys("BINMODE", lkNone, CheckvarFileMode)
-       sys("BINOWN", lkNone, CheckvarUserGroupName)
-       acl("BOOTSTRAP_DEPENDS", lkSpace, CheckvarDependencyWithPath, "Makefile, Makefile.common, *.mk: append")
-       pkg("BOOTSTRAP_PKG", lkNone, CheckvarYesNo)
-       acl("BROKEN", lkNone, CheckvarMessage, "")
-       pkg("BROKEN_GETTEXT_DETECTION", lkNone, CheckvarYesNo)
-       pkglist("BROKEN_EXCEPT_ON_PLATFORM", lkShell, CheckvarMachinePlatformPattern)
-       pkglist("BROKEN_ON_PLATFORM", lkSpace, CheckvarMachinePlatformPattern)
-       sys("BSD_MAKE_ENV", lkShell, CheckvarShellWord)
-       acl("BUILDLINK_ABI_DEPENDS.*", lkSpace, CheckvarDependency, "builtin.mk: append, use-loadtime; *: append")
-       acl("BUILDLINK_API_DEPENDS.*", lkSpace, CheckvarDependency, "builtin.mk: append, use-loadtime; *: append")
-       acl("BUILDLINK_CONTENTS_FILTER", lkNone, CheckvarShellCommand, "")
-       sys("BUILDLINK_CFLAGS", lkShell, CheckvarCFlag)
-       bl3list("BUILDLINK_CFLAGS.*", lkShell, CheckvarCFlag)
-       sys("BUILDLINK_CPPFLAGS", lkShell, CheckvarCFlag)
-       bl3list("BUILDLINK_CPPFLAGS.*", lkShell, CheckvarCFlag)
-       acl("BUILDLINK_CONTENTS_FILTER.*", lkNone, CheckvarShellCommand, "buildlink3.mk: set")
-       acl("BUILDLINK_DEPENDS", lkSpace, CheckvarIdentifier, "buildlink3.mk: append")
-       acl("BUILDLINK_DEPMETHOD.*", lkShell, CheckvarBuildlinkDepmethod, "buildlink3.mk: default, append, use; Makefile: set, append; Makefile.common, *.mk: append")
-       acl("BUILDLINK_DIR", lkNone, CheckvarPathname, "*: use")
-       bl3list("BUILDLINK_FILES.*", lkShell, CheckvarPathmask)
-       acl("BUILDLINK_FILES_CMD.*", lkNone, CheckvarShellCommand, "")
-       acl("BUILDLINK_INCDIRS.*", lkShell, CheckvarPathname, "buildlink3.mk: default, append; Makefile, Makefile.common, *.mk: use")
-       acl("BUILDLINK_JAVA_PREFIX.*", lkNone, CheckvarPathname, "buildlink3.mk: set, use")
-       acl("BUILDLINK_LDADD.*", lkShell, CheckvarLdFlag, "builtin.mk: set, default, append, use; buildlink3.mk: append, use; Makefile, Makefile.common, *.mk: use")
-       acl("BUILDLINK_LDFLAGS", lkShell, CheckvarLdFlag, "*: use")
-       bl3list("BUILDLINK_LDFLAGS.*", lkShell, CheckvarLdFlag)
-       acl("BUILDLINK_LIBDIRS.*", lkShell, CheckvarPathname, "buildlink3.mk, builtin.mk: append; Makefile, Makefile.common, *.mk: use")
-       acl("BUILDLINK_LIBS.*", lkShell, CheckvarLdFlag, "buildlink3.mk: append")
-       acl("BUILDLINK_PASSTHRU_DIRS", lkShell, CheckvarPathname, "Makefile, Makefile.common, buildlink3.mk, hacks.mk: append")
-       acl("BUILDLINK_PASSTHRU_RPATHDIRS", lkShell, CheckvarPathname, "Makefile, Makefile.common, buildlink3.mk, hacks.mk: append")
-       acl("BUILDLINK_PKGSRCDIR.*", lkNone, CheckvarRelativePkgDir, "buildlink3.mk: default, use-loadtime")
-       acl("BUILDLINK_PREFIX.*", lkNone, CheckvarPathname, "builtin.mk: set, use; Makefile, Makefile.common, *.mk: use")
-       acl("BUILDLINK_RPATHDIRS.*", lkShell, CheckvarPathname, "buildlink3.mk: append")
-       acl("BUILDLINK_TARGETS", lkShell, CheckvarIdentifier, "")
-       acl("BUILDLINK_FNAME_TRANSFORM.*", lkNone, CheckvarSedCommands, "Makefile, buildlink3.mk, builtin.mk, hacks.mk: append")
-       acl("BUILDLINK_TRANSFORM", lkShell, CheckvarWrapperTransform, "*: append")
-       acl("BUILDLINK_TRANSFORM.*", lkShell, CheckvarWrapperTransform, "*: append")
-       acl("BUILDLINK_TREE", lkShell, CheckvarIdentifier, "buildlink3.mk: append")
-       acl("BUILD_DEFS", lkShell, CheckvarVariableName, "Makefile, Makefile.common, options.mk: append")
-       pkglist("BUILD_DEFS_EFFECTS", lkShell, CheckvarVariableName)
-       acl("BUILD_DEPENDS", lkSpace, CheckvarDependencyWithPath, "Makefile, Makefile.common, *.mk: append")
-       pkglist("BUILD_DIRS", lkShell, CheckvarWrksrcSubdirectory)
-       pkglist("BUILD_ENV", lkShell, CheckvarShellWord)
-       sys("BUILD_MAKE_CMD", lkNone, CheckvarShellCommand)
-       pkglist("BUILD_MAKE_FLAGS", lkShell, CheckvarShellWord)
-       pkglist("BUILD_TARGET", lkShell, CheckvarIdentifier)
-       pkglist("BUILD_TARGET.*", lkShell, CheckvarIdentifier)
-       pkg("BUILD_USES_MSGFMT", lkNone, CheckvarYes)
-       acl("BUILTIN_PKG", lkNone, CheckvarIdentifier, "builtin.mk: set, use-loadtime, use")
-       acl("BUILTIN_PKG.*", lkNone, CheckvarPkgName, "builtin.mk: set, use-loadtime, use")
-       acl("BUILTIN_FIND_FILES_VAR", lkShell, CheckvarVariableName, "builtin.mk: set")
-       acl("BUILTIN_FIND_FILES.*", lkShell, CheckvarPathname, "builtin.mk: set")
-       acl("BUILTIN_FIND_GREP.*", lkNone, CheckvarString, "builtin.mk: set")
-       acl("BUILTIN_FIND_HEADERS_VAR", lkShell, CheckvarVariableName, "builtin.mk: set")
-       acl("BUILTIN_FIND_HEADERS.*", lkShell, CheckvarPathname, "builtin.mk: set")
-       acl("BUILTIN_FIND_LIBS", lkShell, CheckvarPathname, "builtin.mk: set")
-       acl("BUILTIN_IMAKE_CHECK", lkShell, CheckvarUnchecked, "builtin.mk: set")
-       acl("BUILTIN_IMAKE_CHECK.*", lkNone, CheckvarYesNo, "")
-       sys("BUILTIN_X11_TYPE", lkNone, CheckvarUnchecked)
-       sys("BUILTIN_X11_VERSION", lkNone, CheckvarUnchecked)
-       acl("CATEGORIES", lkShell, CheckvarCategory, "Makefile: set, append; Makefile.common: set, default, append")
-       sys("CC_VERSION", lkNone, CheckvarMessage)
-       sys("CC", lkNone, CheckvarShellCommand)
-       pkglist("CFLAGS", lkShell, CheckvarCFlag)   // may also be changed by the user
-       pkglist("CFLAGS.*", lkShell, CheckvarCFlag) // may also be changed by the user
-       acl("CHECK_BUILTIN", lkNone, CheckvarYesNo, "builtin.mk: default; Makefile: set")
-       acl("CHECK_BUILTIN.*", lkNone, CheckvarYesNo, "Makefile, options.mk, buildlink3.mk: set; builtin.mk: default; *: use-loadtime")
-       acl("CHECK_FILES_SKIP", lkShell, CheckvarBasicRegularExpression, "Makefile, Makefile.common: append")
-       pkg("CHECK_FILES_SUPPORTED", lkNone, CheckvarYesNo)
-       usr("CHECK_HEADERS", lkNone, CheckvarYesNo)
-       pkglist("CHECK_HEADERS_SKIP", lkShell, CheckvarPathmask)
-       usr("CHECK_INTERPRETER", lkNone, CheckvarYesNo)
-       pkglist("CHECK_INTERPRETER_SKIP", lkShell, CheckvarPathmask)
-       usr("CHECK_PERMS", lkNone, CheckvarYesNo)
-       pkglist("CHECK_PERMS_SKIP", lkShell, CheckvarPathmask)
-       usr("CHECK_PORTABILITY", lkNone, CheckvarYesNo)
-       pkglist("CHECK_PORTABILITY_SKIP", lkShell, CheckvarPathmask)
-       acl("CHECK_SHLIBS", lkNone, CheckvarYesNo, "Makefile: set")
-       pkglist("CHECK_SHLIBS_SKIP", lkShell, CheckvarPathmask)
-       acl("CHECK_SHLIBS_SUPPORTED", lkNone, CheckvarYesNo, "Makefile: set")
-       pkglist("CHECK_WRKREF_SKIP", lkShell, CheckvarPathmask)
-       pkg("CMAKE_ARG_PATH", lkNone, CheckvarPathname)
-       pkglist("CMAKE_ARGS", lkShell, CheckvarShellWord)
-       pkglist("CMAKE_ARGS.*", lkShell, CheckvarShellWord)
-       acl("COMMENT", lkNone, CheckvarComment, "Makefile, Makefile.common: set, append")
+       sys("BINGRP", lkNone, BtUserGroupName)
+       sys("BINMODE", lkNone, BtFileMode)
+       sys("BINOWN", lkNone, BtUserGroupName)
+       acl("BOOTSTRAP_DEPENDS", lkSpace, BtDependencyWithPath, "Makefile, Makefile.common, *.mk: append")
+       pkg("BOOTSTRAP_PKG", lkNone, BtYesNo)
+       acl("BROKEN", lkNone, BtMessage, "")
+       pkg("BROKEN_GETTEXT_DETECTION", lkNone, BtYesNo)
+       pkglist("BROKEN_EXCEPT_ON_PLATFORM", lkShell, BtMachinePlatformPattern)
+       pkglist("BROKEN_ON_PLATFORM", lkSpace, BtMachinePlatformPattern)
+       sys("BSD_MAKE_ENV", lkShell, BtShellWord)
+       acl("BUILDLINK_ABI_DEPENDS.*", lkSpace, BtDependency, "builtin.mk: append, use-loadtime; *: append")
+       acl("BUILDLINK_API_DEPENDS.*", lkSpace, BtDependency, "builtin.mk: append, use-loadtime; *: append")
+       acl("BUILDLINK_CONTENTS_FILTER", lkNone, BtShellCommand, "")
+       sys("BUILDLINK_CFLAGS", lkShell, BtCFlag)
+       bl3list("BUILDLINK_CFLAGS.*", lkShell, BtCFlag)
+       sys("BUILDLINK_CPPFLAGS", lkShell, BtCFlag)
+       bl3list("BUILDLINK_CPPFLAGS.*", lkShell, BtCFlag)
+       acl("BUILDLINK_CONTENTS_FILTER.*", lkNone, BtShellCommand, "buildlink3.mk: set")
+       acl("BUILDLINK_DEPENDS", lkSpace, BtIdentifier, "buildlink3.mk: append")
+       acl("BUILDLINK_DEPMETHOD.*", lkShell, BtBuildlinkDepmethod, "buildlink3.mk: default, append, use; Makefile: set, append; Makefile.common, *.mk: append")
+       acl("BUILDLINK_DIR", lkNone, BtPathname, "*: use")
+       bl3list("BUILDLINK_FILES.*", lkShell, BtPathmask)
+       acl("BUILDLINK_FILES_CMD.*", lkNone, BtShellCommand, "")
+       acl("BUILDLINK_INCDIRS.*", lkShell, BtPathname, "buildlink3.mk: default, append; Makefile, Makefile.common, *.mk: use")
+       acl("BUILDLINK_JAVA_PREFIX.*", lkNone, BtPathname, "buildlink3.mk: set, use")
+       acl("BUILDLINK_LDADD.*", lkShell, BtLdFlag, "builtin.mk: set, default, append, use; buildlink3.mk: append, use; Makefile, Makefile.common, *.mk: use")
+       acl("BUILDLINK_LDFLAGS", lkShell, BtLdFlag, "*: use")
+       bl3list("BUILDLINK_LDFLAGS.*", lkShell, BtLdFlag)
+       acl("BUILDLINK_LIBDIRS.*", lkShell, BtPathname, "buildlink3.mk, builtin.mk: append; Makefile, Makefile.common, *.mk: use")
+       acl("BUILDLINK_LIBS.*", lkShell, BtLdFlag, "buildlink3.mk: append")
+       acl("BUILDLINK_PASSTHRU_DIRS", lkShell, BtPathname, "Makefile, Makefile.common, buildlink3.mk, hacks.mk: append")
+       acl("BUILDLINK_PASSTHRU_RPATHDIRS", lkShell, BtPathname, "Makefile, Makefile.common, buildlink3.mk, hacks.mk: append")
+       acl("BUILDLINK_PKGSRCDIR.*", lkNone, BtRelativePkgDir, "buildlink3.mk: default, use-loadtime")
+       acl("BUILDLINK_PREFIX.*", lkNone, BtPathname, "builtin.mk: set, use; Makefile, Makefile.common, *.mk: use")
+       acl("BUILDLINK_RPATHDIRS.*", lkShell, BtPathname, "buildlink3.mk: append")
+       acl("BUILDLINK_TARGETS", lkShell, BtIdentifier, "")
+       acl("BUILDLINK_FNAME_TRANSFORM.*", lkNone, BtSedCommands, "Makefile, buildlink3.mk, builtin.mk, hacks.mk: append")
+       acl("BUILDLINK_TRANSFORM", lkShell, BtWrapperTransform, "*: append")
+       acl("BUILDLINK_TRANSFORM.*", lkShell, BtWrapperTransform, "*: append")
+       acl("BUILDLINK_TREE", lkShell, BtIdentifier, "buildlink3.mk: append")
+       acl("BUILD_DEFS", lkShell, BtVariableName, "Makefile, Makefile.common, options.mk: append")
+       pkglist("BUILD_DEFS_EFFECTS", lkShell, BtVariableName)
+       acl("BUILD_DEPENDS", lkSpace, BtDependencyWithPath, "Makefile, Makefile.common, *.mk: append")
+       pkglist("BUILD_DIRS", lkShell, BtWrksrcSubdirectory)
+       pkglist("BUILD_ENV", lkShell, BtShellWord)
+       sys("BUILD_MAKE_CMD", lkNone, BtShellCommand)
+       pkglist("BUILD_MAKE_FLAGS", lkShell, BtShellWord)
+       pkglist("BUILD_TARGET", lkShell, BtIdentifier)
+       pkglist("BUILD_TARGET.*", lkShell, BtIdentifier)
+       pkg("BUILD_USES_MSGFMT", lkNone, BtYes)
+       acl("BUILTIN_PKG", lkNone, BtIdentifier, "builtin.mk: set, use-loadtime, use")
+       acl("BUILTIN_PKG.*", lkNone, BtPkgName, "builtin.mk: set, use-loadtime, use")
+       acl("BUILTIN_FIND_FILES_VAR", lkShell, BtVariableName, "builtin.mk: set")
+       acl("BUILTIN_FIND_FILES.*", lkShell, BtPathname, "builtin.mk: set")
+       acl("BUILTIN_FIND_GREP.*", lkNone, BtUnknown, "builtin.mk: set")
+       acl("BUILTIN_FIND_HEADERS_VAR", lkShell, BtVariableName, "builtin.mk: set")
+       acl("BUILTIN_FIND_HEADERS.*", lkShell, BtPathname, "builtin.mk: set")
+       acl("BUILTIN_FIND_LIBS", lkShell, BtPathname, "builtin.mk: set")
+       acl("BUILTIN_IMAKE_CHECK", lkShell, BtUnknown, "builtin.mk: set")
+       acl("BUILTIN_IMAKE_CHECK.*", lkNone, BtYesNo, "")
+       sys("BUILTIN_X11_TYPE", lkNone, BtUnknown)
+       sys("BUILTIN_X11_VERSION", lkNone, BtUnknown)
+       acl("CATEGORIES", lkShell, BtCategory, "Makefile: set, append; Makefile.common: set, default, append")
+       sys("CC_VERSION", lkNone, BtMessage)
+       sys("CC", lkNone, BtShellCommand)
+       pkglist("CFLAGS", lkShell, BtCFlag)   // may also be changed by the user
+       pkglist("CFLAGS.*", lkShell, BtCFlag) // may also be changed by the user
+       acl("CHECK_BUILTIN", lkNone, BtYesNo, "builtin.mk: default; Makefile: set")
+       acl("CHECK_BUILTIN.*", lkNone, BtYesNo, "Makefile, options.mk, buildlink3.mk: set; builtin.mk: default; *: use-loadtime")
+       acl("CHECK_FILES_SKIP", lkShell, BtBasicRegularExpression, "Makefile, Makefile.common: append")
+       pkg("CHECK_FILES_SUPPORTED", lkNone, BtYesNo)
+       usr("CHECK_HEADERS", lkNone, BtYesNo)
+       pkglist("CHECK_HEADERS_SKIP", lkShell, BtPathmask)
+       usr("CHECK_INTERPRETER", lkNone, BtYesNo)
+       pkglist("CHECK_INTERPRETER_SKIP", lkShell, BtPathmask)
+       usr("CHECK_PERMS", lkNone, BtYesNo)
+       pkglist("CHECK_PERMS_SKIP", lkShell, BtPathmask)
+       usr("CHECK_PORTABILITY", lkNone, BtYesNo)
+       pkglist("CHECK_PORTABILITY_SKIP", lkShell, BtPathmask)
+       acl("CHECK_SHLIBS", lkNone, BtYesNo, "Makefile: set")
+       pkglist("CHECK_SHLIBS_SKIP", lkShell, BtPathmask)
+       acl("CHECK_SHLIBS_SUPPORTED", lkNone, BtYesNo, "Makefile: set")
+       pkglist("CHECK_WRKREF_SKIP", lkShell, BtPathmask)
+       pkg("CMAKE_ARG_PATH", lkNone, BtPathname)
+       pkglist("CMAKE_ARGS", lkShell, BtShellWord)
+       pkglist("CMAKE_ARGS.*", lkShell, BtShellWord)
+       acl("COMMENT", lkNone, BtComment, "Makefile, Makefile.common: set, append")
        acl("COMPILER_RPATH_FLAG", lkNone, enum("-Wl,-rpath"), "*: use")
-       pkglist("CONFIGURE_ARGS", lkShell, CheckvarShellWord)
-       pkglist("CONFIGURE_ARGS.*", lkShell, CheckvarShellWord)
-       pkglist("CONFIGURE_DIRS", lkShell, CheckvarWrksrcSubdirectory)
-       acl("CONFIGURE_ENV", lkShell, CheckvarShellWord, "Makefile, Makefile.common: append, set, use; buildlink3.mk, builtin.mk: append; *.mk: append, use")
-       acl("CONFIGURE_ENV.*", lkShell, CheckvarShellWord, "Makefile, Makefile.common: append, set, use; buildlink3.mk, builtin.mk: append; *.mk: append, use")
-       pkg("CONFIGURE_HAS_INFODIR", lkNone, CheckvarYesNo)
-       pkg("CONFIGURE_HAS_LIBDIR", lkNone, CheckvarYesNo)
-       pkg("CONFIGURE_HAS_MANDIR", lkNone, CheckvarYesNo)
-       pkg("CONFIGURE_SCRIPT", lkNone, CheckvarPathname)
-       acl("CONFIG_GUESS_OVERRIDE", lkShell, CheckvarPathmask, "Makefile, Makefile.common: set, append")
-       acl("CONFIG_STATUS_OVERRIDE", lkShell, CheckvarPathmask, "Makefile, Makefile.common: set, append")
-       acl("CONFIG_SHELL", lkNone, CheckvarPathname, "Makefile, Makefile.common: set")
-       acl("CONFIG_SUB_OVERRIDE", lkShell, CheckvarPathmask, "Makefile, Makefile.common: set, append")
-       pkglist("CONFLICTS", lkSpace, CheckvarDependency)
-       pkglist("CONF_FILES", lkShell, CheckvarShellWord)
+       pkglist("CONFIGURE_ARGS", lkShell, BtShellWord)
+       pkglist("CONFIGURE_ARGS.*", lkShell, BtShellWord)
+       pkglist("CONFIGURE_DIRS", lkShell, BtWrksrcSubdirectory)
+       acl("CONFIGURE_ENV", lkShell, BtShellWord, "Makefile, Makefile.common: append, set, use; buildlink3.mk, builtin.mk: append; *.mk: append, use")
+       acl("CONFIGURE_ENV.*", lkShell, BtShellWord, "Makefile, Makefile.common: append, set, use; buildlink3.mk, builtin.mk: append; *.mk: append, use")
+       pkg("CONFIGURE_HAS_INFODIR", lkNone, BtYesNo)
+       pkg("CONFIGURE_HAS_LIBDIR", lkNone, BtYesNo)
+       pkg("CONFIGURE_HAS_MANDIR", lkNone, BtYesNo)
+       pkg("CONFIGURE_SCRIPT", lkNone, BtPathname)
+       acl("CONFIG_GUESS_OVERRIDE", lkShell, BtPathmask, "Makefile, Makefile.common: set, append")
+       acl("CONFIG_STATUS_OVERRIDE", lkShell, BtPathmask, "Makefile, Makefile.common: set, append")
+       acl("CONFIG_SHELL", lkNone, BtPathname, "Makefile, Makefile.common: set")
+       acl("CONFIG_SUB_OVERRIDE", lkShell, BtPathmask, "Makefile, Makefile.common: set, append")
+       pkglist("CONFLICTS", lkSpace, BtDependency)
+       pkglist("CONF_FILES", lkShell, BtShellWord)
        pkg("CONF_FILES_MODE", lkNone, enum("0644 0640 0600 0400"))
-       pkglist("CONF_FILES_PERMS", lkShell, CheckvarPerms)
+       pkglist("CONF_FILES_PERMS", lkShell, BtPerms)
        sys("COPY", lkNone, enum("-c")) // The flag that tells ${INSTALL} to copy a file
-       sys("CPP", lkNone, CheckvarShellCommand)
-       pkglist("CPPFLAGS", lkShell, CheckvarCFlag)
-       pkglist("CPPFLAGS.*", lkShell, CheckvarCFlag)
-       acl("CRYPTO", lkNone, CheckvarYes, "Makefile: set")
-       sys("CXX", lkNone, CheckvarShellCommand)
-       pkglist("CXXFLAGS", lkShell, CheckvarCFlag)
-       pkglist("CXXFLAGS.*", lkShell, CheckvarCFlag)
-       pkglist("CWRAPPERS_APPEND.*", lkShell, CheckvarShellWord)
-       acl("DEINSTALL_FILE", lkNone, CheckvarPathname, "Makefile: set")
-       acl("DEINSTALL_SRC", lkShell, CheckvarPathname, "Makefile: set; Makefile.common: default, set")
-       acl("DEINSTALL_TEMPLATES", lkShell, CheckvarPathname, "Makefile: set, append; Makefile.common: set, default, append")
-       sys("DELAYED_ERROR_MSG", lkNone, CheckvarShellCommand)
-       sys("DELAYED_WARNING_MSG", lkNone, CheckvarShellCommand)
-       pkglist("DEPENDS", lkSpace, CheckvarDependencyWithPath)
-       usr("DEPENDS_TARGET", lkShell, CheckvarIdentifier)
-       acl("DESCR_SRC", lkShell, CheckvarPathname, "Makefile: set, append; Makefile.common: default, set")
-       sys("DESTDIR", lkNone, CheckvarPathname)
-       acl("DESTDIR_VARNAME", lkNone, CheckvarVariableName, "Makefile, Makefile.common: set")
-       sys("DEVOSSAUDIO", lkNone, CheckvarPathname)
-       sys("DEVOSSSOUND", lkNone, CheckvarPathname)
-       pkglist("DISTFILES", lkShell, CheckvarFilename)
-       pkg("DISTINFO_FILE", lkNone, CheckvarRelativePkgPath)
-       pkg("DISTNAME", lkNone, CheckvarFilename)
-       pkg("DIST_SUBDIR", lkNone, CheckvarPathname)
-       acl("DJB_BUILD_ARGS", lkShell, CheckvarShellWord, "")
-       acl("DJB_BUILD_TARGETS", lkShell, CheckvarIdentifier, "")
-       acl("DJB_CONFIG_CMDS", lkNone, CheckvarShellCommands, "options.mk: set")
-       acl("DJB_CONFIG_DIRS", lkShell, CheckvarWrksrcSubdirectory, "")
-       acl("DJB_CONFIG_HOME", lkNone, CheckvarFilename, "")
-       acl("DJB_CONFIG_PREFIX", lkNone, CheckvarPathname, "")
-       acl("DJB_INSTALL_TARGETS", lkShell, CheckvarIdentifier, "")
-       acl("DJB_MAKE_TARGETS", lkNone, CheckvarYesNo, "")
-       acl("DJB_RESTRICTED", lkNone, CheckvarYesNo, "Makefile: set")
-       acl("DJB_SLASHPACKAGE", lkNone, CheckvarYesNo, "")
-       acl("DLOPEN_REQUIRE_PTHREADS", lkNone, CheckvarYesNo, "")
-       acl("DL_AUTO_VARS", lkNone, CheckvarYes, "Makefile, Makefile.common, options.mk: set")
-       acl("DL_LIBS", lkShell, CheckvarLdFlag, "")
-       sys("DOCOWN", lkNone, CheckvarUserGroupName)
-       sys("DOCGRP", lkNone, CheckvarUserGroupName)
-       sys("DOCMODE", lkNone, CheckvarFileMode)
-       sys("DOWNLOADED_DISTFILE", lkNone, CheckvarPathname)
-       sys("DO_NADA", lkNone, CheckvarShellCommand)
-       pkg("DYNAMIC_SITES_CMD", lkNone, CheckvarShellCommand)
-       pkg("DYNAMIC_SITES_SCRIPT", lkNone, CheckvarPathname)
-       acl("ECHO", lkNone, CheckvarShellCommand, "*: use")
-       sys("ECHO_MSG", lkNone, CheckvarShellCommand)
-       sys("ECHO_N", lkNone, CheckvarShellCommand)
-       pkg("EGDIR", lkNone, CheckvarPathname) // Not defined anywhere, but used in many places like this.
-       sys("EMACS_BIN", lkNone, CheckvarPathname)
-       sys("EMACS_ETCPREFIX", lkNone, CheckvarPathname)
+       sys("CPP", lkNone, BtShellCommand)
+       pkglist("CPPFLAGS", lkShell, BtCFlag)
+       pkglist("CPPFLAGS.*", lkShell, BtCFlag)
+       acl("CRYPTO", lkNone, BtYes, "Makefile: set")
+       sys("CXX", lkNone, BtShellCommand)
+       pkglist("CXXFLAGS", lkShell, BtCFlag)
+       pkglist("CXXFLAGS.*", lkShell, BtCFlag)
+       pkglist("CWRAPPERS_APPEND.*", lkShell, BtShellWord)
+       acl("DEINSTALL_FILE", lkNone, BtPathname, "Makefile: set")
+       acl("DEINSTALL_SRC", lkShell, BtPathname, "Makefile: set; Makefile.common: default, set")
+       acl("DEINSTALL_TEMPLATES", lkShell, BtPathname, "Makefile: set, append; Makefile.common: set, default, append")
+       sys("DELAYED_ERROR_MSG", lkNone, BtShellCommand)
+       sys("DELAYED_WARNING_MSG", lkNone, BtShellCommand)
+       pkglist("DEPENDS", lkSpace, BtDependencyWithPath)
+       usr("DEPENDS_TARGET", lkShell, BtIdentifier)
+       acl("DESCR_SRC", lkShell, BtPathname, "Makefile: set, append; Makefile.common: default, set")
+       sys("DESTDIR", lkNone, BtPathname)
+       acl("DESTDIR_VARNAME", lkNone, BtVariableName, "Makefile, Makefile.common: set")
+       sys("DEVOSSAUDIO", lkNone, BtPathname)
+       sys("DEVOSSSOUND", lkNone, BtPathname)
+       pkglist("DISTFILES", lkShell, BtFilename)
+       pkg("DISTINFO_FILE", lkNone, BtRelativePkgPath)
+       pkg("DISTNAME", lkNone, BtFilename)
+       pkg("DIST_SUBDIR", lkNone, BtPathname)
+       acl("DJB_BUILD_ARGS", lkShell, BtShellWord, "")
+       acl("DJB_BUILD_TARGETS", lkShell, BtIdentifier, "")
+       acl("DJB_CONFIG_CMDS", lkNone, BtShellCommands, "options.mk: set")
+       acl("DJB_CONFIG_DIRS", lkShell, BtWrksrcSubdirectory, "")
+       acl("DJB_CONFIG_HOME", lkNone, BtFilename, "")
+       acl("DJB_CONFIG_PREFIX", lkNone, BtPathname, "")
+       acl("DJB_INSTALL_TARGETS", lkShell, BtIdentifier, "")
+       acl("DJB_MAKE_TARGETS", lkNone, BtYesNo, "")
+       acl("DJB_RESTRICTED", lkNone, BtYesNo, "Makefile: set")
+       acl("DJB_SLASHPACKAGE", lkNone, BtYesNo, "")
+       acl("DLOPEN_REQUIRE_PTHREADS", lkNone, BtYesNo, "")
+       acl("DL_AUTO_VARS", lkNone, BtYes, "Makefile, Makefile.common, options.mk: set")
+       acl("DL_LIBS", lkShell, BtLdFlag, "")
+       sys("DOCOWN", lkNone, BtUserGroupName)
+       sys("DOCGRP", lkNone, BtUserGroupName)
+       sys("DOCMODE", lkNone, BtFileMode)
+       sys("DOWNLOADED_DISTFILE", lkNone, BtPathname)
+       sys("DO_NADA", lkNone, BtShellCommand)
+       pkg("DYNAMIC_SITES_CMD", lkNone, BtShellCommand)
+       pkg("DYNAMIC_SITES_SCRIPT", lkNone, BtPathname)
+       acl("ECHO", lkNone, BtShellCommand, "*: use")
+       sys("ECHO_MSG", lkNone, BtShellCommand)
+       sys("ECHO_N", lkNone, BtShellCommand)
+       pkg("EGDIR", lkNone, BtPathname) // Not defined anywhere, but used in many places like this.
+       sys("EMACS_BIN", lkNone, BtPathname)
+       sys("EMACS_ETCPREFIX", lkNone, BtPathname)
        sys("EMACS_FLAVOR", lkNone, enum("emacs xemacs"))
-       sys("EMACS_INFOPREFIX", lkNone, CheckvarPathname)
-       sys("EMACS_LISPPREFIX", lkNone, CheckvarPathname)
-       acl("EMACS_MODULES", lkShell, CheckvarIdentifier, "Makefile, Makefile.common: set, append")
-       sys("EMACS_PKGNAME_PREFIX", lkNone, CheckvarIdentifier) // Or the empty string.
+       sys("EMACS_INFOPREFIX", lkNone, BtPathname)
+       sys("EMACS_LISPPREFIX", lkNone, BtPathname)
+       acl("EMACS_MODULES", lkShell, BtIdentifier, "Makefile, Makefile.common: set, append")
+       sys("EMACS_PKGNAME_PREFIX", lkNone, BtIdentifier) // Or the empty string.
        sys("EMACS_TYPE", lkNone, enum("emacs xemacs"))
-       acl("EMACS_USE_LEIM", lkNone, CheckvarYes, "")
+       acl("EMACS_USE_LEIM", lkNone, BtYes, "")
        acl("EMACS_VERSIONS_ACCEPTED", lkShell, enum("emacs25 emacs24 emacs24nox emacs23 emacs23nox emacs22 emacs22nox emacs21 emacs21nox emacs20 xemacs215 xemacs215nox xemacs214 xemacs214nox"), 
"Makefile: set")
-       sys("EMACS_VERSION_MAJOR", lkNone, CheckvarInteger)
-       sys("EMACS_VERSION_MINOR", lkNone, CheckvarInteger)
+       sys("EMACS_VERSION_MAJOR", lkNone, BtInteger)
+       sys("EMACS_VERSION_MINOR", lkNone, BtInteger)
        acl("EMACS_VERSION_REQD", lkShell, enum("emacs24 emacs24nox emacs23 emacs23nox emacs22 emacs22nox emacs21 emacs21nox emacs20 xemacs215 xemacs214"), "Makefile: set, append")
-       sys("EMULDIR", lkNone, CheckvarPathname)
-       sys("EMULSUBDIR", lkNone, CheckvarPathname)
-       sys("OPSYS_EMULDIR", lkNone, CheckvarPathname)
-       sys("EMULSUBDIRSLASH", lkNone, CheckvarPathname)
+       sys("EMULDIR", lkNone, BtPathname)
+       sys("EMULSUBDIR", lkNone, BtPathname)
+       sys("OPSYS_EMULDIR", lkNone, BtPathname)
+       sys("EMULSUBDIRSLASH", lkNone, BtPathname)
        sys("EMUL_ARCH", lkNone, enum("arm i386 m68k none ns32k sparc vax x86_64"))
-       sys("EMUL_DISTRO", lkNone, CheckvarIdentifier)
-       sys("EMUL_IS_NATIVE", lkNone, CheckvarYes)
-       pkg("EMUL_MODULES.*", lkShell, CheckvarIdentifier)
+       sys("EMUL_DISTRO", lkNone, BtIdentifier)
+       sys("EMUL_IS_NATIVE", lkNone, BtYes)
+       pkg("EMUL_MODULES.*", lkShell, BtIdentifier)
        sys("EMUL_OPSYS", lkNone, enum("darwin freebsd hpux irix linux osf1 solaris sunos none"))
        pkg("EMUL_PKG_FMT", lkNone, enum("plain rpm"))
-       usr("EMUL_PLATFORM", lkNone, CheckvarEmulPlatform)
-       pkg("EMUL_PLATFORMS", lkShell, CheckvarEmulPlatform)
-       usr("EMUL_PREFER", lkShell, CheckvarEmulPlatform)
-       pkg("EMUL_REQD", lkSpace, CheckvarDependency)
+       usr("EMUL_PLATFORM", lkNone, BtEmulPlatform)
+       pkg("EMUL_PLATFORMS", lkShell, BtEmulPlatform)
+       usr("EMUL_PREFER", lkShell, BtEmulPlatform)
+       pkg("EMUL_REQD", lkSpace, BtDependency)
        usr("EMUL_TYPE.*", lkNone, enum("native builtin suse suse-9.1 suse-9.x suse-10.0 suse-10.x"))
-       sys("ERROR_CAT", lkNone, CheckvarShellCommand)
-       sys("ERROR_MSG", lkNone, CheckvarShellCommand)
-       acl("EVAL_PREFIX", lkSpace, CheckvarShellWord, "Makefile, Makefile.common: append") // XXX: Combining ShellWord with lkSpace looks weird.
-       sys("EXPORT_SYMBOLS_LDFLAGS", lkShell, CheckvarLdFlag)
-       sys("EXTRACT_CMD", lkNone, CheckvarShellCommand)
-       pkg("EXTRACT_DIR", lkNone, CheckvarPathname)
-       pkg("EXTRACT_DIR.*", lkNone, CheckvarPathname)
-       pkglist("EXTRACT_ELEMENTS", lkShell, CheckvarPathmask)
-       pkglist("EXTRACT_ENV", lkShell, CheckvarShellWord)
-       pkglist("EXTRACT_ONLY", lkShell, CheckvarPathname)
-       acl("EXTRACT_OPTS", lkShell, CheckvarShellWord, "Makefile, Makefile.common: set, append")
-       acl("EXTRACT_OPTS_BIN", lkShell, CheckvarShellWord, "Makefile, Makefile.common: set, append")
-       acl("EXTRACT_OPTS_LHA", lkShell, CheckvarShellWord, "Makefile, Makefile.common: set, append")
-       acl("EXTRACT_OPTS_PAX", lkShell, CheckvarShellWord, "Makefile, Makefile.common: set, append")
-       acl("EXTRACT_OPTS_RAR", lkShell, CheckvarShellWord, "Makefile, Makefile.common: set, append")
-       acl("EXTRACT_OPTS_TAR", lkShell, CheckvarShellWord, "Makefile, Makefile.common: set, append")
-       acl("EXTRACT_OPTS_ZIP", lkShell, CheckvarShellWord, "Makefile, Makefile.common: set, append")
-       acl("EXTRACT_OPTS_ZOO", lkShell, CheckvarShellWord, "Makefile, Makefile.common: set, append")
-       pkg("EXTRACT_SUFX", lkNone, CheckvarDistSuffix)
+       sys("ERROR_CAT", lkNone, BtShellCommand)
+       sys("ERROR_MSG", lkNone, BtShellCommand)
+       acl("EVAL_PREFIX", lkSpace, BtShellWord, "Makefile, Makefile.common: append") // XXX: Combining ShellWord with lkSpace looks weird.
+       sys("EXPORT_SYMBOLS_LDFLAGS", lkShell, BtLdFlag)
+       sys("EXTRACT_CMD", lkNone, BtShellCommand)
+       pkg("EXTRACT_DIR", lkNone, BtPathname)
+       pkg("EXTRACT_DIR.*", lkNone, BtPathname)
+       pkglist("EXTRACT_ELEMENTS", lkShell, BtPathmask)
+       pkglist("EXTRACT_ENV", lkShell, BtShellWord)
+       pkglist("EXTRACT_ONLY", lkShell, BtPathname)
+       acl("EXTRACT_OPTS", lkShell, BtShellWord, "Makefile, Makefile.common: set, append")
+       acl("EXTRACT_OPTS_BIN", lkShell, BtShellWord, "Makefile, Makefile.common: set, append")
+       acl("EXTRACT_OPTS_LHA", lkShell, BtShellWord, "Makefile, Makefile.common: set, append")
+       acl("EXTRACT_OPTS_PAX", lkShell, BtShellWord, "Makefile, Makefile.common: set, append")
+       acl("EXTRACT_OPTS_RAR", lkShell, BtShellWord, "Makefile, Makefile.common: set, append")
+       acl("EXTRACT_OPTS_TAR", lkShell, BtShellWord, "Makefile, Makefile.common: set, append")
+       acl("EXTRACT_OPTS_ZIP", lkShell, BtShellWord, "Makefile, Makefile.common: set, append")
+       acl("EXTRACT_OPTS_ZOO", lkShell, BtShellWord, "Makefile, Makefile.common: set, append")
+       pkg("EXTRACT_SUFX", lkNone, BtDistSuffix)
        pkg("EXTRACT_USING", lkNone, enum("bsdtar gtar nbtar pax"))
-       sys("FAIL_MSG", lkNone, CheckvarShellCommand)
-       sys("FAMBASE", lkNone, CheckvarPathname)
+       sys("FAIL_MSG", lkNone, BtShellCommand)
+       sys("FAMBASE", lkNone, BtPathname)
        pkg("FAM_ACCEPTED", lkShell, enum("fam gamin"))
        usr("FAM_DEFAULT", lkNone, enum("fam gamin"))
        sys("FAM_TYPE", lkNone, enum("fam gamin"))
-       acl("FETCH_BEFORE_ARGS", lkShell, CheckvarShellWord, "Makefile: set, append")
-       pkglist("FETCH_MESSAGE", lkShell, CheckvarShellWord)
-       pkg("FILESDIR", lkNone, CheckvarRelativePkgPath)
-       pkglist("FILES_SUBST", lkShell, CheckvarShellWord)
-       acl("FILES_SUBST_SED", lkShell, CheckvarShellWord, "")
-       pkglist("FIX_RPATH", lkShell, CheckvarVariableName)
-       pkglist("FLEX_REQD", lkShell, CheckvarVersion)
-       acl("FONTS_DIRS.*", lkShell, CheckvarPathname, "Makefile: set, append, use; Makefile.common: append, use")
-       sys("GAMEDATAMODE", lkNone, CheckvarFileMode)
-       sys("GAMES_GROUP", lkNone, CheckvarUserGroupName)
-       sys("GAMEMODE", lkNone, CheckvarFileMode)
-       sys("GAMES_USER", lkNone, CheckvarUserGroupName)
-       pkglist("GCC_REQD", lkShell, CheckvarVersion)
-       pkglist("GENERATE_PLIST", lkNone, CheckvarShellCommands)
-       pkg("GITHUB_PROJECT", lkNone, CheckvarIdentifier)
-       pkg("GITHUB_TAG", lkNone, CheckvarIdentifier)
-       pkg("GITHUB_RELEASE", lkNone, CheckvarFilename)
+       acl("FETCH_BEFORE_ARGS", lkShell, BtShellWord, "Makefile: set, append")
+       pkglist("FETCH_MESSAGE", lkShell, BtShellWord)
+       pkg("FILESDIR", lkNone, BtRelativePkgPath)
+       pkglist("FILES_SUBST", lkShell, BtShellWord)
+       acl("FILES_SUBST_SED", lkShell, BtShellWord, "")
+       pkglist("FIX_RPATH", lkShell, BtVariableName)
+       pkglist("FLEX_REQD", lkShell, BtVersion)
+       acl("FONTS_DIRS.*", lkShell, BtPathname, "Makefile: set, append, use; Makefile.common: append, use")
+       sys("GAMEDATAMODE", lkNone, BtFileMode)
+       sys("GAMES_GROUP", lkNone, BtUserGroupName)
+       sys("GAMEMODE", lkNone, BtFileMode)
+       sys("GAMES_USER", lkNone, BtUserGroupName)
+       pkglist("GCC_REQD", lkShell, BtVersion)
+       pkglist("GENERATE_PLIST", lkNone, BtShellCommands)
+       pkg("GITHUB_PROJECT", lkNone, BtIdentifier)
+       pkg("GITHUB_TAG", lkNone, BtIdentifier)
+       pkg("GITHUB_RELEASE", lkNone, BtFilename)
        pkg("GITHUB_TYPE", lkNone, enum("tag release"))
-       pkg("GMAKE_REQD", lkNone, CheckvarVersion)
+       pkg("GMAKE_REQD", lkNone, BtVersion)
        acl("GNU_ARCH", lkNone, enum("mips"), "")
-       acl("GNU_CONFIGURE", lkNone, CheckvarYes, "Makefile, Makefile.common: set")
-       acl("GNU_CONFIGURE_INFODIR", lkNone, CheckvarPathname, "Makefile, Makefile.common: set")
-       acl("GNU_CONFIGURE_LIBDIR", lkNone, CheckvarPathname, "Makefile, Makefile.common: set")
-       pkg("GNU_CONFIGURE_LIBSUBDIR", lkNone, CheckvarPathname)
-       acl("GNU_CONFIGURE_MANDIR", lkNone, CheckvarPathname, "Makefile, Makefile.common: set")
-       acl("GNU_CONFIGURE_PREFIX", lkNone, CheckvarPathname, "Makefile: set")
-       acl("HAS_CONFIGURE", lkNone, CheckvarYes, "Makefile, Makefile.common: set")
-       pkglist("HEADER_TEMPLATES", lkShell, CheckvarPathname)
-       pkg("HOMEPAGE", lkNone, CheckvarHomepage)
-       acl("IGNORE_PKG.*", lkNone, CheckvarYes, "*: set, use-loadtime")
-       acl("INCOMPAT_CURSES", lkSpace, CheckvarMachinePlatformPattern, "Makefile: set, append")
-       acl("INCOMPAT_ICONV", lkSpace, CheckvarMachinePlatformPattern, "")
-       acl("INFO_DIR", lkNone, CheckvarPathname, "") // relative to PREFIX
-       pkg("INFO_FILES", lkNone, CheckvarYes)
-       sys("INSTALL", lkNone, CheckvarShellCommand)
-       pkglist("INSTALLATION_DIRS", lkShell, CheckvarPrefixPathname)
-       pkg("INSTALLATION_DIRS_FROM_PLIST", lkNone, CheckvarYes)
-       sys("INSTALL_DATA", lkNone, CheckvarShellCommand)
-       sys("INSTALL_DATA_DIR", lkNone, CheckvarShellCommand)
-       pkglist("INSTALL_DIRS", lkShell, CheckvarWrksrcSubdirectory)
-       pkglist("INSTALL_ENV", lkShell, CheckvarShellWord)
-       acl("INSTALL_FILE", lkNone, CheckvarPathname, "Makefile: set")
-       sys("INSTALL_GAME", lkNone, CheckvarShellCommand)
-       sys("INSTALL_GAME_DATA", lkNone, CheckvarShellCommand)
-       sys("INSTALL_LIB", lkNone, CheckvarShellCommand)
-       sys("INSTALL_LIB_DIR", lkNone, CheckvarShellCommand)
-       pkglist("INSTALL_MAKE_FLAGS", lkShell, CheckvarShellWord)
-       sys("INSTALL_MAN", lkNone, CheckvarShellCommand)
-       sys("INSTALL_MAN_DIR", lkNone, CheckvarShellCommand)
-       sys("INSTALL_PROGRAM", lkNone, CheckvarShellCommand)
-       sys("INSTALL_PROGRAM_DIR", lkNone, CheckvarShellCommand)
-       sys("INSTALL_SCRIPT", lkNone, CheckvarShellCommand)
-       acl("INSTALL_SCRIPTS_ENV", lkShell, CheckvarShellWord, "")
-       sys("INSTALL_SCRIPT_DIR", lkNone, CheckvarShellCommand)
-       acl("INSTALL_SRC", lkShell, CheckvarPathname, "Makefile: set; Makefile.common: default, set")
-       pkg("INSTALL_TARGET", lkShell, CheckvarIdentifier)
-       acl("INSTALL_TEMPLATES", lkShell, CheckvarPathname, "Makefile: set, append; Makefile.common: set, default, append")
-       acl("INSTALL_UNSTRIPPED", lkNone, CheckvarYesNo, "Makefile, Makefile.common: set")
+       acl("GNU_CONFIGURE", lkNone, BtYes, "Makefile, Makefile.common: set")
+       acl("GNU_CONFIGURE_INFODIR", lkNone, BtPathname, "Makefile, Makefile.common: set")
+       acl("GNU_CONFIGURE_LIBDIR", lkNone, BtPathname, "Makefile, Makefile.common: set")
+       pkg("GNU_CONFIGURE_LIBSUBDIR", lkNone, BtPathname)
+       acl("GNU_CONFIGURE_MANDIR", lkNone, BtPathname, "Makefile, Makefile.common: set")
+       acl("GNU_CONFIGURE_PREFIX", lkNone, BtPathname, "Makefile: set")
+       acl("HAS_CONFIGURE", lkNone, BtYes, "Makefile, Makefile.common: set")
+       pkglist("HEADER_TEMPLATES", lkShell, BtPathname)
+       pkg("HOMEPAGE", lkNone, BtHomepage)
+       acl("IGNORE_PKG.*", lkNone, BtYes, "*: set, use-loadtime")
+       acl("INCOMPAT_CURSES", lkSpace, BtMachinePlatformPattern, "Makefile: set, append")
+       acl("INCOMPAT_ICONV", lkSpace, BtMachinePlatformPattern, "")
+       acl("INFO_DIR", lkNone, BtPathname, "") // relative to PREFIX
+       pkg("INFO_FILES", lkNone, BtYes)
+       sys("INSTALL", lkNone, BtShellCommand)
+       pkglist("INSTALLATION_DIRS", lkShell, BtPrefixPathname)
+       pkg("INSTALLATION_DIRS_FROM_PLIST", lkNone, BtYes)
+       sys("INSTALL_DATA", lkNone, BtShellCommand)
+       sys("INSTALL_DATA_DIR", lkNone, BtShellCommand)
+       pkglist("INSTALL_DIRS", lkShell, BtWrksrcSubdirectory)
+       pkglist("INSTALL_ENV", lkShell, BtShellWord)
+       acl("INSTALL_FILE", lkNone, BtPathname, "Makefile: set")
+       sys("INSTALL_GAME", lkNone, BtShellCommand)
+       sys("INSTALL_GAME_DATA", lkNone, BtShellCommand)
+       sys("INSTALL_LIB", lkNone, BtShellCommand)
+       sys("INSTALL_LIB_DIR", lkNone, BtShellCommand)
+       pkglist("INSTALL_MAKE_FLAGS", lkShell, BtShellWord)
+       sys("INSTALL_MAN", lkNone, BtShellCommand)
+       sys("INSTALL_MAN_DIR", lkNone, BtShellCommand)
+       sys("INSTALL_PROGRAM", lkNone, BtShellCommand)
+       sys("INSTALL_PROGRAM_DIR", lkNone, BtShellCommand)
+       sys("INSTALL_SCRIPT", lkNone, BtShellCommand)
+       acl("INSTALL_SCRIPTS_ENV", lkShell, BtShellWord, "")
+       sys("INSTALL_SCRIPT_DIR", lkNone, BtShellCommand)
+       acl("INSTALL_SRC", lkShell, BtPathname, "Makefile: set; Makefile.common: default, set")
+       pkg("INSTALL_TARGET", lkShell, BtIdentifier)
+       acl("INSTALL_TEMPLATES", lkShell, BtPathname, "Makefile: set, append; Makefile.common: set, default, append")
+       acl("INSTALL_UNSTRIPPED", lkNone, BtYesNo, "Makefile, Makefile.common: set")
        pkg("INTERACTIVE_STAGE", lkShell, enum("fetch extract configure build test install"))
-       acl("IS_BUILTIN.*", lkNone, CheckvarYesNoIndirectly, "builtin.mk: set, use-loadtime, use")
-       sys("JAVA_BINPREFIX", lkNone, CheckvarPathname)
-       pkg("JAVA_CLASSPATH", lkNone, CheckvarShellWord)
-       pkg("JAVA_HOME", lkNone, CheckvarPathname)
-       pkg("JAVA_NAME", lkNone, CheckvarFilename)
+       acl("IS_BUILTIN.*", lkNone, BtYesNoIndirectly, "builtin.mk: set, use-loadtime, use")
+       sys("JAVA_BINPREFIX", lkNone, BtPathname)
+       pkg("JAVA_CLASSPATH", lkNone, BtShellWord)
+       pkg("JAVA_HOME", lkNone, BtPathname)
+       pkg("JAVA_NAME", lkNone, BtFilename)
        pkglist("JAVA_UNLIMIT", lkShell, enum("cmdsize datasize stacksize"))
-       pkglist("JAVA_WRAPPERS", lkSpace, CheckvarFilename)
-       pkg("JAVA_WRAPPER_BIN.*", lkNone, CheckvarPathname)
-       sys("KRB5BASE", lkNone, CheckvarPathname)
+       pkglist("JAVA_WRAPPERS", lkSpace, BtFilename)
+       pkg("JAVA_WRAPPER_BIN.*", lkNone, BtPathname)
+       sys("KRB5BASE", lkNone, BtPathname)
        acl("KRB5_ACCEPTED", lkShell, enum("heimdal mit-krb5"), "")
        usr("KRB5_DEFAULT", lkNone, enum("heimdal mit-krb5"))
-       sys("KRB5_TYPE", lkNone, CheckvarIdentifier)
-       sys("LD", lkNone, CheckvarShellCommand)
-       pkglist("LDFLAGS", lkShell, CheckvarLdFlag)
-       pkglist("LDFLAGS.*", lkShell, CheckvarLdFlag)
-       sys("LIBGRP", lkNone, CheckvarUserGroupName)
-       sys("LIBMODE", lkNone, CheckvarFileMode)
-       sys("LIBOWN", lkNone, CheckvarUserGroupName)
-       sys("LIBOSSAUDIO", lkNone, CheckvarPathname)
-       pkglist("LIBS", lkShell, CheckvarLdFlag)
-       pkglist("LIBS.*", lkShell, CheckvarLdFlag)
-       sys("LIBTOOL", lkNone, CheckvarShellCommand)
-       acl("LIBTOOL_OVERRIDE", lkShell, CheckvarPathmask, "Makefile: set, append")
-       pkglist("LIBTOOL_REQD", lkShell, CheckvarVersion)
-       acl("LICENCE", lkNone, CheckvarLicense, "Makefile, Makefile.common, options.mk: set")
-       acl("LICENSE", lkNone, CheckvarLicense, "Makefile, Makefile.common, options.mk: set")
-       pkg("LICENSE_FILE", lkNone, CheckvarPathname)
-       sys("LINKER_RPATH_FLAG", lkNone, CheckvarShellWord)
-       sys("LOWER_OPSYS", lkNone, CheckvarIdentifier)
-       sys("LOWER_VENDOR", lkNone, CheckvarIdentifier)
-       acl("LTCONFIG_OVERRIDE", lkShell, CheckvarPathmask, "Makefile: set, append; Makefile.common: append")
+       sys("KRB5_TYPE", lkNone, BtIdentifier)
+       sys("LD", lkNone, BtShellCommand)
+       pkglist("LDFLAGS", lkShell, BtLdFlag)
+       pkglist("LDFLAGS.*", lkShell, BtLdFlag)
+       sys("LIBGRP", lkNone, BtUserGroupName)
+       sys("LIBMODE", lkNone, BtFileMode)
+       sys("LIBOWN", lkNone, BtUserGroupName)
+       sys("LIBOSSAUDIO", lkNone, BtPathname)
+       pkglist("LIBS", lkShell, BtLdFlag)
+       pkglist("LIBS.*", lkShell, BtLdFlag)
+       sys("LIBTOOL", lkNone, BtShellCommand)
+       acl("LIBTOOL_OVERRIDE", lkShell, BtPathmask, "Makefile: set, append")
+       pkglist("LIBTOOL_REQD", lkShell, BtVersion)
+       acl("LICENCE", lkNone, BtLicense, "Makefile, Makefile.common, options.mk: set, append")
+       acl("LICENSE", lkNone, BtLicense, "Makefile, Makefile.common, options.mk: set, append")
+       pkg("LICENSE_FILE", lkNone, BtPathname)
+       sys("LINKER_RPATH_FLAG", lkNone, BtShellWord)
+       sys("LOWER_OPSYS", lkNone, BtIdentifier)
+       sys("LOWER_VENDOR", lkNone, BtIdentifier)
+       acl("LTCONFIG_OVERRIDE", lkShell, BtPathmask, "Makefile: set, append; Makefile.common: append")
        sys("MACHINE_ARCH", lkNone, enumMachineArch)
        sys("MACHINE_GNU_ARCH", lkNone, enumMachineGnuArch)
-       sys("MACHINE_GNU_PLATFORM", lkNone, CheckvarMachineGnuPlatform)
-       sys("MACHINE_PLATFORM", lkNone, CheckvarMachinePlatform)
-       acl("MAINTAINER", lkNone, CheckvarMailAddress, "Makefile: set; Makefile.common: default")
-       sys("MAKE", lkNone, CheckvarShellCommand)
-       pkglist("MAKEFLAGS", lkShell, CheckvarShellWord)
-       acl("MAKEVARS", lkShell, CheckvarVariableName, "buildlink3.mk, builtin.mk, hacks.mk: append")
-       pkglist("MAKE_DIRS", lkShell, CheckvarPathname)
-       pkglist("MAKE_DIRS_PERMS", lkShell, CheckvarPerms)
-       acl("MAKE_ENV", lkShell, CheckvarShellWord, "Makefile, Makefile.common: append, set, use; buildlink3.mk, builtin.mk: append; *.mk: append, use")
-       acl("MAKE_ENV.*", lkShell, CheckvarShellWord, "Makefile, Makefile.common: append, set, use; buildlink3.mk, builtin.mk: append; *.mk: append, use")
-       pkg("MAKE_FILE", lkNone, CheckvarPathname)
-       pkglist("MAKE_FLAGS", lkShell, CheckvarShellWord)
-       pkglist("MAKE_FLAGS.*", lkShell, CheckvarShellWord)
-       usr("MAKE_JOBS", lkNone, CheckvarInteger)
-       pkg("MAKE_JOBS_SAFE", lkNone, CheckvarYesNo)
-       pkg("MAKE_PROGRAM", lkNone, CheckvarShellCommand)
-       acl("MANCOMPRESSED", lkNone, CheckvarYesNo, "Makefile: set; Makefile.common: default, set")
-       acl("MANCOMPRESSED_IF_MANZ", lkNone, CheckvarYes, "Makefile: set; Makefile.common: default, set")
-       sys("MANGRP", lkNone, CheckvarUserGroupName)
-       sys("MANMODE", lkNone, CheckvarFileMode)
-       sys("MANOWN", lkNone, CheckvarUserGroupName)
-       pkglist("MASTER_SITES", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_APACHE", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_BACKUP", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_CYGWIN", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_DEBIAN", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_FREEBSD", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_FREEBSD_LOCAL", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_GENTOO", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_GITHUB", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_GNOME", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_GNU", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_GNUSTEP", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_IFARCHIVE", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_HASKELL_HACKAGE", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_KDE", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_LOCAL", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_MOZILLA", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_MOZILLA_ALL", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_MOZILLA_ESR", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_MYSQL", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_NETLIB", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_OPENOFFICE", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_OSDN", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_PERL_CPAN", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_R_CRAN", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_RUBYGEMS", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_SOURCEFORGE", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_SUNSITE", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_SUSE", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_TEX_CTAN", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_XCONTRIB", lkShell, CheckvarFetchURL)
-       sys("MASTER_SITE_XEMACS", lkShell, CheckvarFetchURL)
-       pkglist("MESSAGE_SRC", lkShell, CheckvarPathname)
-       acl("MESSAGE_SUBST", lkShell, CheckvarShellWord, "Makefile, Makefile.common, options.mk: append")
-       pkg("META_PACKAGE", lkNone, CheckvarYes)
-       sys("MISSING_FEATURES", lkShell, CheckvarIdentifier)
+       sys("MACHINE_GNU_PLATFORM", lkNone, BtMachineGnuPlatform)
+       sys("MACHINE_PLATFORM", lkNone, BtMachinePlatform)
+       acl("MAINTAINER", lkNone, BtMailAddress, "Makefile: set; Makefile.common: default")
+       sys("MAKE", lkNone, BtShellCommand)
+       pkglist("MAKEFLAGS", lkShell, BtShellWord)
+       acl("MAKEVARS", lkShell, BtVariableName, "buildlink3.mk, builtin.mk, hacks.mk: append")
+       pkglist("MAKE_DIRS", lkShell, BtPathname)
+       pkglist("MAKE_DIRS_PERMS", lkShell, BtPerms)
+       acl("MAKE_ENV", lkShell, BtShellWord, "Makefile, Makefile.common: append, set, use; buildlink3.mk, builtin.mk: append; *.mk: append, use")
+       acl("MAKE_ENV.*", lkShell, BtShellWord, "Makefile, Makefile.common: append, set, use; buildlink3.mk, builtin.mk: append; *.mk: append, use")
+       pkg("MAKE_FILE", lkNone, BtPathname)
+       pkglist("MAKE_FLAGS", lkShell, BtShellWord)
+       pkglist("MAKE_FLAGS.*", lkShell, BtShellWord)
+       usr("MAKE_JOBS", lkNone, BtInteger)
+       pkg("MAKE_JOBS_SAFE", lkNone, BtYesNo)
+       pkg("MAKE_PROGRAM", lkNone, BtShellCommand)
+       acl("MANCOMPRESSED", lkNone, BtYesNo, "Makefile: set; Makefile.common: default, set")
+       acl("MANCOMPRESSED_IF_MANZ", lkNone, BtYes, "Makefile: set; Makefile.common: default, set")
+       sys("MANGRP", lkNone, BtUserGroupName)
+       sys("MANMODE", lkNone, BtFileMode)
+       sys("MANOWN", lkNone, BtUserGroupName)
+       pkglist("MASTER_SITES", lkShell, BtFetchURL)
+       sys("MASTER_SITE_APACHE", lkShell, BtFetchURL)
+       sys("MASTER_SITE_BACKUP", lkShell, BtFetchURL)
+       sys("MASTER_SITE_CYGWIN", lkShell, BtFetchURL)
+       sys("MASTER_SITE_DEBIAN", lkShell, BtFetchURL)
+       sys("MASTER_SITE_FREEBSD", lkShell, BtFetchURL)
+       sys("MASTER_SITE_FREEBSD_LOCAL", lkShell, BtFetchURL)
+       sys("MASTER_SITE_GENTOO", lkShell, BtFetchURL)
+       sys("MASTER_SITE_GITHUB", lkShell, BtFetchURL)
+       sys("MASTER_SITE_GNOME", lkShell, BtFetchURL)
+       sys("MASTER_SITE_GNU", lkShell, BtFetchURL)
+       sys("MASTER_SITE_GNUSTEP", lkShell, BtFetchURL)
+       sys("MASTER_SITE_IFARCHIVE", lkShell, BtFetchURL)
+       sys("MASTER_SITE_HASKELL_HACKAGE", lkShell, BtFetchURL)
+       sys("MASTER_SITE_KDE", lkShell, BtFetchURL)
+       sys("MASTER_SITE_LOCAL", lkShell, BtFetchURL)
+       sys("MASTER_SITE_MOZILLA", lkShell, BtFetchURL)
+       sys("MASTER_SITE_MOZILLA_ALL", lkShell, BtFetchURL)
+       sys("MASTER_SITE_MOZILLA_ESR", lkShell, BtFetchURL)
+       sys("MASTER_SITE_MYSQL", lkShell, BtFetchURL)
+       sys("MASTER_SITE_NETLIB", lkShell, BtFetchURL)
+       sys("MASTER_SITE_OPENOFFICE", lkShell, BtFetchURL)
+       sys("MASTER_SITE_OSDN", lkShell, BtFetchURL)
+       sys("MASTER_SITE_PERL_CPAN", lkShell, BtFetchURL)
+       sys("MASTER_SITE_R_CRAN", lkShell, BtFetchURL)
+       sys("MASTER_SITE_RUBYGEMS", lkShell, BtFetchURL)
+       sys("MASTER_SITE_SOURCEFORGE", lkShell, BtFetchURL)
+       sys("MASTER_SITE_SUNSITE", lkShell, BtFetchURL)
+       sys("MASTER_SITE_SUSE", lkShell, BtFetchURL)
+       sys("MASTER_SITE_TEX_CTAN", lkShell, BtFetchURL)
+       sys("MASTER_SITE_XCONTRIB", lkShell, BtFetchURL)
+       sys("MASTER_SITE_XEMACS", lkShell, BtFetchURL)
+       pkglist("MESSAGE_SRC", lkShell, BtPathname)
+       acl("MESSAGE_SUBST", lkShell, BtShellWord, "Makefile, Makefile.common, options.mk: append")
+       pkg("META_PACKAGE", lkNone, BtYes)
+       sys("MISSING_FEATURES", lkShell, BtIdentifier)
        acl("MYSQL_VERSIONS_ACCEPTED", lkShell, enum("51 55 56"), "Makefile: set")
-       usr("MYSQL_VERSION_DEFAULT", lkNone, CheckvarVersion)
-       sys("NM", lkNone, CheckvarShellCommand)
-       sys("NONBINMODE", lkNone, CheckvarFileMode)
+       usr("MYSQL_VERSION_DEFAULT", lkNone, BtVersion)
+       sys("NM", lkNone, BtShellCommand)
+       sys("NONBINMODE", lkNone, BtFileMode)
        pkg("NOT_FOR_COMPILER", lkShell, enum("ccache ccc clang distcc f2c gcc hp icc ido mipspro mipspro-ucode pcc sunpro xlc"))
-       pkglist("NOT_FOR_BULK_PLATFORM", lkSpace, CheckvarMachinePlatformPattern)
-       pkglist("NOT_FOR_PLATFORM", lkSpace, CheckvarMachinePlatformPattern)
-       pkg("NOT_FOR_UNPRIVILEGED", lkNone, CheckvarYesNo)
-       acl("NO_BIN_ON_CDROM", lkNone, CheckvarRestricted, "Makefile, Makefile.common: set")
-       acl("NO_BIN_ON_FTP", lkNone, CheckvarRestricted, "Makefile, Makefile.common: set")
-       acl("NO_BUILD", lkNone, CheckvarYes, "Makefile, Makefile.common: set; Makefile.*: default, set")
-       pkg("NO_CHECKSUM", lkNone, CheckvarYes)
-       pkg("NO_CONFIGURE", lkNone, CheckvarYes)
-       acl("NO_EXPORT_CPP", lkNone, CheckvarYes, "Makefile: set")
-       pkg("NO_EXTRACT", lkNone, CheckvarYes)
-       pkg("NO_INSTALL_MANPAGES", lkNone, CheckvarYes) // only has an effect for Imake packages.
-       acl("NO_PKGTOOLS_REQD_CHECK", lkNone, CheckvarYes, "Makefile: set")
-       acl("NO_SRC_ON_CDROM", lkNone, CheckvarRestricted, "Makefile, Makefile.common: set")
-       acl("NO_SRC_ON_FTP", lkNone, CheckvarRestricted, "Makefile, Makefile.common: set")
+       pkglist("NOT_FOR_BULK_PLATFORM", lkSpace, BtMachinePlatformPattern)
+       pkglist("NOT_FOR_PLATFORM", lkSpace, BtMachinePlatformPattern)
+       pkg("NOT_FOR_UNPRIVILEGED", lkNone, BtYesNo)
+       acl("NO_BIN_ON_CDROM", lkNone, BtRestricted, "Makefile, Makefile.common: set")
+       acl("NO_BIN_ON_FTP", lkNone, BtRestricted, "Makefile, Makefile.common: set")
+       acl("NO_BUILD", lkNone, BtYes, "Makefile, Makefile.common: set; Makefile.*: default, set")
+       pkg("NO_CHECKSUM", lkNone, BtYes)
+       pkg("NO_CONFIGURE", lkNone, BtYes)
+       acl("NO_EXPORT_CPP", lkNone, BtYes, "Makefile: set")
+       pkg("NO_EXTRACT", lkNone, BtYes)
+       pkg("NO_INSTALL_MANPAGES", lkNone, BtYes) // only has an effect for Imake packages.
+       acl("NO_PKGTOOLS_REQD_CHECK", lkNone, BtYes, "Makefile: set")
+       acl("NO_SRC_ON_CDROM", lkNone, BtRestricted, "Makefile, Makefile.common: set")
+       acl("NO_SRC_ON_FTP", lkNone, BtRestricted, "Makefile, Makefile.common: set")
        pkglist("ONLY_FOR_COMPILER", lkShell, enum("ccc clang gcc hp icc ido mipspro mipspro-ucode pcc sunpro xlc"))
-       pkglist("ONLY_FOR_PLATFORM", lkSpace, CheckvarMachinePlatformPattern)
-       pkg("ONLY_FOR_UNPRIVILEGED", lkNone, CheckvarYesNo)
-       sys("OPSYS", lkNone, CheckvarIdentifier)
-       acl("OPSYSVARS", lkShell, CheckvarVariableName, "Makefile, Makefile.common: append")
-       acl("OSVERSION_SPECIFIC", lkNone, CheckvarYes, "Makefile, Makefile.common: set")
-       sys("OS_VERSION", lkNone, CheckvarVersion)
-       pkg("OVERRIDE_DIRDEPTH*", lkNone, CheckvarInteger)
-       pkg("OVERRIDE_GNU_CONFIG_SCRIPTS", lkNone, CheckvarYes)
-       acl("OWNER", lkNone, CheckvarMailAddress, "Makefile: set; Makefile.common: default")
-       pkglist("OWN_DIRS", lkShell, CheckvarPathname)
-       pkglist("OWN_DIRS_PERMS", lkShell, CheckvarPerms)
-       sys("PAMBASE", lkNone, CheckvarPathname)
+       pkglist("ONLY_FOR_PLATFORM", lkSpace, BtMachinePlatformPattern)
+       pkg("ONLY_FOR_UNPRIVILEGED", lkNone, BtYesNo)
+       sys("OPSYS", lkNone, BtIdentifier)
+       acl("OPSYSVARS", lkShell, BtVariableName, "Makefile, Makefile.common: append")
+       acl("OSVERSION_SPECIFIC", lkNone, BtYes, "Makefile, Makefile.common: set")
+       sys("OS_VERSION", lkNone, BtVersion)
+       pkg("OVERRIDE_DIRDEPTH*", lkNone, BtInteger)
+       pkg("OVERRIDE_GNU_CONFIG_SCRIPTS", lkNone, BtYes)
+       acl("OWNER", lkNone, BtMailAddress, "Makefile: set; Makefile.common: default")
+       pkglist("OWN_DIRS", lkShell, BtPathname)
+       pkglist("OWN_DIRS_PERMS", lkShell, BtPerms)
+       sys("PAMBASE", lkNone, BtPathname)
        usr("PAM_DEFAULT", lkNone, enum("linux-pam openpam solaris-pam"))
-       acl("PATCHDIR", lkNone, CheckvarRelativePkgPath, "Makefile: set; Makefile.common: default, set")
-       pkglist("PATCHFILES", lkShell, CheckvarFilename)
-       acl("PATCH_ARGS", lkShell, CheckvarShellWord, "")
-       acl("PATCH_DIST_ARGS", lkShell, CheckvarShellWord, "Makefile: set, append")
-       acl("PATCH_DIST_CAT", lkNone, CheckvarShellCommand, "")
-       acl("PATCH_DIST_STRIP*", lkNone, CheckvarShellWord, "buildlink3.mk, builtin.mk:; Makefile, Makefile.common, *.mk: set")
-       acl("PATCH_SITES", lkShell, CheckvarFetchURL, "Makefile, Makefile.common, options.mk: set")
-       acl("PATCH_STRIP", lkNone, CheckvarShellWord, "")
-       acl("PERL5_PACKLIST", lkShell, CheckvarPerl5Packlist, "Makefile: set; options.mk: set, append")
-       acl("PERL5_PACKLIST_DIR", lkNone, CheckvarPathname, "")
-       pkg("PERL5_REQD", lkShell, CheckvarVersion)
-       pkg("PERL5_USE_PACKLIST", lkNone, CheckvarYesNo)
-       sys("PGSQL_PREFIX", lkNone, CheckvarPathname)
+       acl("PATCHDIR", lkNone, BtRelativePkgPath, "Makefile: set; Makefile.common: default, set")
+       pkglist("PATCHFILES", lkShell, BtFilename)
+       acl("PATCH_ARGS", lkShell, BtShellWord, "")
+       acl("PATCH_DIST_ARGS", lkShell, BtShellWord, "Makefile: set, append")
+       acl("PATCH_DIST_CAT", lkNone, BtShellCommand, "")
+       acl("PATCH_DIST_STRIP*", lkNone, BtShellWord, "buildlink3.mk, builtin.mk:; Makefile, Makefile.common, *.mk: set")
+       acl("PATCH_SITES", lkShell, BtFetchURL, "Makefile, Makefile.common, options.mk: set")
+       acl("PATCH_STRIP", lkNone, BtShellWord, "")
+       acl("PERL5_PACKLIST", lkShell, BtPerl5Packlist, "Makefile: set; options.mk: set, append")
+       acl("PERL5_PACKLIST_DIR", lkNone, BtPathname, "")
+       pkg("PERL5_REQD", lkShell, BtVersion)
+       pkg("PERL5_USE_PACKLIST", lkNone, BtYesNo)
+       sys("PGSQL_PREFIX", lkNone, BtPathname)
        acl("PGSQL_VERSIONS_ACCEPTED", lkShell, enum("91 92 93 94"), "")
-       usr("PGSQL_VERSION_DEFAULT", lkNone, CheckvarVersion)
+       usr("PGSQL_VERSION_DEFAULT", lkNone, BtVersion)
        sys("PG_LIB_EXT", lkNone, enum("dylib so"))
        sys("PGSQL_TYPE", lkNone, enum("postgresql81-client postgresql80-client"))
-       sys("PGPKGSRCDIR", lkNone, CheckvarPathname)
-       sys("PHASE_MSG", lkNone, CheckvarShellCommand)
-       usr("PHP_VERSION_REQD", lkNone, CheckvarVersion)
-       sys("PKGBASE", lkNone, CheckvarIdentifier)
-       acl("PKGCONFIG_FILE.*", lkShell, CheckvarPathname, "builtin.mk: set, append; pkgconfig-builtin.mk: use-loadtime")
-       acl("PKGCONFIG_OVERRIDE", lkShell, CheckvarPathmask, "Makefile: set, append; Makefile.common: append")
-       pkg("PKGCONFIG_OVERRIDE_STAGE", lkNone, CheckvarStage)
-       pkg("PKGDIR", lkNone, CheckvarRelativePkgDir)
-       sys("PKGDIRMODE", lkNone, CheckvarFileMode)
-       sys("PKGLOCALEDIR", lkNone, CheckvarPathname)
-       pkg("PKGNAME", lkNone, CheckvarPkgName)
-       sys("PKGNAME_NOREV", lkNone, CheckvarPkgName)
-       sys("PKGPATH", lkNone, CheckvarPathname)
-       acl("PKGREPOSITORY", lkNone, CheckvarUnchecked, "")
-       acl("PKGREVISION", lkNone, CheckvarPkgRevision, "Makefile: set")
-       sys("PKGSRCDIR", lkNone, CheckvarPathname)
-       acl("PKGSRCTOP", lkNone, CheckvarYes, "Makefile: set")
-       acl("PKGTOOLS_ENV", lkShell, CheckvarShellWord, "")
-       sys("PKGVERSION", lkNone, CheckvarVersion)
-       sys("PKGWILDCARD", lkNone, CheckvarFilemask)
-       sys("PKG_ADMIN", lkNone, CheckvarShellCommand)
+       sys("PGPKGSRCDIR", lkNone, BtPathname)
+       sys("PHASE_MSG", lkNone, BtShellCommand)
+       usr("PHP_VERSION_REQD", lkNone, BtVersion)
+       sys("PKGBASE", lkNone, BtIdentifier)
+       acl("PKGCONFIG_FILE.*", lkShell, BtPathname, "builtin.mk: set, append; pkgconfig-builtin.mk: use-loadtime")
+       acl("PKGCONFIG_OVERRIDE", lkShell, BtPathmask, "Makefile: set, append; Makefile.common: append")
+       pkg("PKGCONFIG_OVERRIDE_STAGE", lkNone, BtStage)
+       pkg("PKGDIR", lkNone, BtRelativePkgDir)
+       sys("PKGDIRMODE", lkNone, BtFileMode)
+       sys("PKGLOCALEDIR", lkNone, BtPathname)
+       pkg("PKGNAME", lkNone, BtPkgName)
+       sys("PKGNAME_NOREV", lkNone, BtPkgName)
+       sys("PKGPATH", lkNone, BtPathname)
+       acl("PKGREPOSITORY", lkNone, BtUnknown, "")
+       acl("PKGREVISION", lkNone, BtPkgRevision, "Makefile: set")
+       sys("PKGSRCDIR", lkNone, BtPathname)
+       acl("PKGSRCTOP", lkNone, BtYes, "Makefile: set")
+       acl("PKGTOOLS_ENV", lkShell, BtShellWord, "")
+       sys("PKGVERSION", lkNone, BtVersion)
+       sys("PKGWILDCARD", lkNone, BtFilemask)
+       sys("PKG_ADMIN", lkNone, BtShellCommand)
        sys("PKG_APACHE", lkNone, enum("apache22 apache24"))
        pkg("PKG_APACHE_ACCEPTED", lkShell, enum("apache22 apache24"))
        usr("PKG_APACHE_DEFAULT", lkNone, enum("apache22 apache24"))
-       usr("PKG_CONFIG", lkNone, CheckvarYes)
+       usr("PKG_CONFIG", lkNone, BtYes)
        // ^^ No, this is not the popular command from GNOME, but the setting
        // whether the pkgsrc user wants configuration files automatically
        // installed or not.
-       sys("PKG_CREATE", lkNone, CheckvarShellCommand)
-       sys("PKG_DBDIR", lkNone, CheckvarPathname)
-       cmdline("PKG_DEBUG_LEVEL", lkNone, CheckvarInteger)
-       usr("PKG_DEFAULT_OPTIONS", lkShell, CheckvarOption)
-       sys("PKG_DELETE", lkNone, CheckvarShellCommand)
+       sys("PKG_CREATE", lkNone, BtShellCommand)
+       sys("PKG_DBDIR", lkNone, BtPathname)
+       cmdline("PKG_DEBUG_LEVEL", lkNone, BtInteger)
+       usr("PKG_DEFAULT_OPTIONS", lkShell, BtOption)
+       sys("PKG_DELETE", lkNone, BtShellCommand)
        acl("PKG_DESTDIR_SUPPORT", lkShell, enum("destdir user-destdir"), "Makefile, Makefile.common: set")
-       pkglist("PKG_FAIL_REASON", lkShell, CheckvarShellWord)
-       acl("PKG_GECOS.*", lkNone, CheckvarMessage, "Makefile: set")
-       acl("PKG_GID.*", lkNone, CheckvarInteger, "Makefile: set")
-       acl("PKG_GROUPS", lkShell, CheckvarShellWord, "Makefile: set, append")
-       pkglist("PKG_GROUPS_VARS", lkShell, CheckvarVariableName)
-       acl("PKG_HOME.*", lkNone, CheckvarPathname, "Makefile: set")
-       acl("PKG_HACKS", lkShell, CheckvarIdentifier, "hacks.mk: append")
-       sys("PKG_INFO", lkNone, CheckvarShellCommand)
-       sys("PKG_JAVA_HOME", lkNone, CheckvarPathname)
+       pkglist("PKG_FAIL_REASON", lkShell, BtShellWord)
+       acl("PKG_GECOS.*", lkNone, BtMessage, "Makefile: set")
+       acl("PKG_GID.*", lkNone, BtInteger, "Makefile: set")
+       acl("PKG_GROUPS", lkShell, BtShellWord, "Makefile: set, append")
+       pkglist("PKG_GROUPS_VARS", lkShell, BtVariableName)
+       acl("PKG_HOME.*", lkNone, BtPathname, "Makefile: set")
+       acl("PKG_HACKS", lkShell, BtIdentifier, "hacks.mk: append")
+       sys("PKG_INFO", lkNone, BtShellCommand)
+       sys("PKG_JAVA_HOME", lkNone, BtPathname)
        jvms := enum("openjdk8 oracle-jdk8 openjdk7 sun-jdk7 sun-jdk6 jdk16 jdk15 kaffe") // See mk/java-vm.mk:/_PKG_JVMS/
        sys("PKG_JVM", lkNone, jvms)
        acl("PKG_JVMS_ACCEPTED", lkShell, jvms, "Makefile: set; Makefile.common: default, set")
        usr("PKG_JVM_DEFAULT", lkNone, jvms)
-       acl("PKG_LEGACY_OPTIONS", lkShell, CheckvarOption, "")
-       acl("PKG_LIBTOOL", lkNone, CheckvarPathname, "Makefile: set")
-       acl("PKG_OPTIONS", lkSpace, CheckvarOption, "bsd.options.mk: set; *: use-loadtime, use")
-       usr("PKG_OPTIONS.*", lkSpace, CheckvarOption)
-       acl("PKG_OPTIONS_DEPRECATED_WARNINGS", lkShell, CheckvarShellWord, "")
-       acl("PKG_OPTIONS_GROUP.*", lkSpace, CheckvarOption, "Makefile, options.mk: set, append")
-       acl("PKG_OPTIONS_LEGACY_OPTS", lkSpace, CheckvarUnchecked, "Makefile, Makefile.common, options.mk: append")
-       acl("PKG_OPTIONS_LEGACY_VARS", lkSpace, CheckvarUnchecked, "Makefile, Makefile.common, options.mk: append")
-       acl("PKG_OPTIONS_NONEMPTY_SETS", lkSpace, CheckvarIdentifier, "")
-       acl("PKG_OPTIONS_OPTIONAL_GROUPS", lkSpace, CheckvarIdentifier, "options.mk: set, append")
-       acl("PKG_OPTIONS_REQUIRED_GROUPS", lkSpace, CheckvarIdentifier, "Makefile, options.mk: set")
-       acl("PKG_OPTIONS_SET.*", lkSpace, CheckvarOption, "")
-       acl("PKG_OPTIONS_VAR", lkNone, CheckvarPkgOptionsVar, "Makefile, Makefile.common, options.mk: set; bsd.options.mk: use-loadtime")
-       acl("PKG_PRESERVE", lkNone, CheckvarYes, "Makefile: set")
-       acl("PKG_SHELL", lkNone, CheckvarPathname, "Makefile, Makefile.common: set")
-       acl("PKG_SHELL.*", lkNone, CheckvarPathname, "Makefile, Makefile.common: set")
-       acl("PKG_SHLIBTOOL", lkNone, CheckvarPathname, "")
-       pkglist("PKG_SKIP_REASON", lkShell, CheckvarShellWord)
-       acl("PKG_SUGGESTED_OPTIONS", lkShell, CheckvarOption, "Makefile, Makefile.common, options.mk: set, append")
-       acl("PKG_SUGGESTED_OPTIONS.*", lkShell, CheckvarOption, "Makefile, Makefile.common, options.mk: set, append")
-       acl("PKG_SUPPORTED_OPTIONS", lkShell, CheckvarOption, "Makefile: set, append; Makefile.common: set; options.mk: set, append, use")
-       pkg("PKG_SYSCONFDIR*", lkNone, CheckvarPathname)
-       pkglist("PKG_SYSCONFDIR_PERMS", lkShell, CheckvarPerms)
-       sys("PKG_SYSCONFBASEDIR", lkNone, CheckvarPathname)
-       pkg("PKG_SYSCONFSUBDIR", lkNone, CheckvarPathname)
-       acl("PKG_SYSCONFVAR", lkNone, CheckvarIdentifier, "") // FIXME: name/type mismatch.
-       acl("PKG_UID", lkNone, CheckvarInteger, "Makefile: set")
-       acl("PKG_USERS", lkShell, CheckvarShellWord, "Makefile: set, append")
-       pkg("PKG_USERS_VARS", lkShell, CheckvarVariableName)
-       acl("PKG_USE_KERBEROS", lkNone, CheckvarYes, "Makefile, Makefile.common: set")
+       acl("PKG_LEGACY_OPTIONS", lkShell, BtOption, "")
+       acl("PKG_LIBTOOL", lkNone, BtPathname, "Makefile: set")
+       acl("PKG_OPTIONS", lkSpace, BtOption, "bsd.options.mk: set; *: use-loadtime, use")
+       usr("PKG_OPTIONS.*", lkSpace, BtOption)
+       acl("PKG_OPTIONS_DEPRECATED_WARNINGS", lkShell, BtShellWord, "")
+       acl("PKG_OPTIONS_GROUP.*", lkSpace, BtOption, "Makefile, options.mk: set, append")
+       acl("PKG_OPTIONS_LEGACY_OPTS", lkSpace, BtUnknown, "Makefile, Makefile.common, options.mk: append")
+       acl("PKG_OPTIONS_LEGACY_VARS", lkSpace, BtUnknown, "Makefile, Makefile.common, options.mk: append")
+       acl("PKG_OPTIONS_NONEMPTY_SETS", lkSpace, BtIdentifier, "")
+       acl("PKG_OPTIONS_OPTIONAL_GROUPS", lkSpace, BtIdentifier, "options.mk: set, append")
+       acl("PKG_OPTIONS_REQUIRED_GROUPS", lkSpace, BtIdentifier, "Makefile, options.mk: set")
+       acl("PKG_OPTIONS_SET.*", lkSpace, BtOption, "")
+       acl("PKG_OPTIONS_VAR", lkNone, BtPkgOptionsVar, "Makefile, Makefile.common, options.mk: set; bsd.options.mk: use-loadtime")
+       acl("PKG_PRESERVE", lkNone, BtYes, "Makefile: set")
+       acl("PKG_SHELL", lkNone, BtPathname, "Makefile, Makefile.common: set")
+       acl("PKG_SHELL.*", lkNone, BtPathname, "Makefile, Makefile.common: set")
+       acl("PKG_SHLIBTOOL", lkNone, BtPathname, "")
+       pkglist("PKG_SKIP_REASON", lkShell, BtShellWord)
+       acl("PKG_SUGGESTED_OPTIONS", lkShell, BtOption, "Makefile, Makefile.common, options.mk: set, append")
+       acl("PKG_SUGGESTED_OPTIONS.*", lkShell, BtOption, "Makefile, Makefile.common, options.mk: set, append")
+       acl("PKG_SUPPORTED_OPTIONS", lkShell, BtOption, "Makefile: set, append; Makefile.common: set; options.mk: set, append, use")
+       pkg("PKG_SYSCONFDIR*", lkNone, BtPathname)
+       pkglist("PKG_SYSCONFDIR_PERMS", lkShell, BtPerms)
+       sys("PKG_SYSCONFBASEDIR", lkNone, BtPathname)
+       pkg("PKG_SYSCONFSUBDIR", lkNone, BtPathname)
+       acl("PKG_SYSCONFVAR", lkNone, BtIdentifier, "") // FIXME: name/type mismatch.
+       acl("PKG_UID", lkNone, BtInteger, "Makefile: set")
+       acl("PKG_USERS", lkShell, BtShellWord, "Makefile: set, append")
+       pkg("PKG_USERS_VARS", lkShell, BtVariableName)
+       acl("PKG_USE_KERBEROS", lkNone, BtYes, "Makefile, Makefile.common: set")
        // PLIST.* has special handling code
-       pkglist("PLIST_VARS", lkShell, CheckvarIdentifier)
-       pkglist("PLIST_SRC", lkShell, CheckvarRelativePkgPath)
-       pkglist("PLIST_SUBST", lkShell, CheckvarShellWord)
+       pkglist("PLIST_VARS", lkShell, BtIdentifier)
+       pkglist("PLIST_SRC", lkShell, BtRelativePkgPath)
+       pkglist("PLIST_SUBST", lkShell, BtShellWord)
        acl("PLIST_TYPE", lkNone, enum("dynamic static"), "")
-       acl("PREPEND_PATH", lkShell, CheckvarPathname, "")
-       acl("PREFIX", lkNone, CheckvarPathname, "*: use")
-       acl("PREV_PKGPATH", lkNone, CheckvarPathname, "*: use") // doesn't exist any longer
-       acl("PRINT_PLIST_AWK", lkNone, CheckvarAwkCommand, "*: append")
+       acl("PREPEND_PATH", lkShell, BtPathname, "")
+       acl("PREFIX", lkNone, BtPathname, "*: use")
+       acl("PREV_PKGPATH", lkNone, BtPathname, "*: use") // doesn't exist any longer
+       acl("PRINT_PLIST_AWK", lkNone, BtAwkCommand, "*: append")
        acl("PRIVILEGED_STAGES", lkShell, enum("install package clean"), "")
-       acl("PTHREAD_AUTO_VARS", lkNone, CheckvarYesNo, "Makefile: set")
-       sys("PTHREAD_CFLAGS", lkShell, CheckvarCFlag)
-       sys("PTHREAD_LDFLAGS", lkShell, CheckvarLdFlag)
-       sys("PTHREAD_LIBS", lkShell, CheckvarLdFlag)
+       acl("PTHREAD_AUTO_VARS", lkNone, BtYesNo, "Makefile: set")
+       sys("PTHREAD_CFLAGS", lkShell, BtCFlag)
+       sys("PTHREAD_LDFLAGS", lkShell, BtLdFlag)
+       sys("PTHREAD_LIBS", lkShell, BtLdFlag)
        acl("PTHREAD_OPTS", lkShell, enum("native optional require"), "Makefile: set, append; Makefile.common, buildlink3.mk: append")
-       sys("PTHREAD_TYPE", lkNone, CheckvarIdentifier) // Or "native" or "none".
-       pkg("PY_PATCHPLIST", lkNone, CheckvarYes)
+       sys("PTHREAD_TYPE", lkNone, BtIdentifier) // Or "native" or "none".
+       pkg("PY_PATCHPLIST", lkNone, BtYes)
        acl("PYPKGPREFIX", lkNone, enum("py27 py33 py34 py35"), "pyversion.mk: set; *: use-loadtime, use")
-       pkg("PYTHON_FOR_BUILD_ONLY", lkNone, CheckvarYes)
-       pkglist("REPLACE_PYTHON", lkShell, CheckvarPathmask)
-       pkg("PYTHON_VERSIONS_ACCEPTED", lkShell, CheckvarVersion)
-       pkg("PYTHON_VERSIONS_INCOMPATIBLE", lkShell, CheckvarVersion)
-       usr("PYTHON_VERSION_DEFAULT", lkNone, CheckvarVersion)
-       usr("PYTHON_VERSION_REQD", lkNone, CheckvarVersion)
-       pkglist("PYTHON_VERSIONED_DEPENDENCIES", lkShell, CheckvarPythonDependency)
-       sys("RANLIB", lkNone, CheckvarShellCommand)
-       pkglist("RCD_SCRIPTS", lkShell, CheckvarFilename)
-       acl("RCD_SCRIPT_SRC.*", lkNone, CheckvarPathname, "Makefile: set")
-       acl("RCD_SCRIPT_WRK.*", lkNone, CheckvarPathname, "Makefile: set")
-       acl("REPLACE.*", lkNone, CheckvarString, "Makefile: set")
-       pkglist("REPLACE_AWK", lkShell, CheckvarPathmask)
-       pkglist("REPLACE_BASH", lkShell, CheckvarPathmask)
-       pkglist("REPLACE_CSH", lkShell, CheckvarPathmask)
-       acl("REPLACE_EMACS", lkShell, CheckvarPathmask, "")
-       acl("REPLACE_FILES.*", lkShell, CheckvarPathmask, "Makefile, Makefile.common: set, append")
-       acl("REPLACE_INTERPRETER", lkShell, CheckvarIdentifier, "Makefile, Makefile.common: append")
-       pkglist("REPLACE_KSH", lkShell, CheckvarPathmask)
-       pkglist("REPLACE_LOCALEDIR_PATTERNS", lkShell, CheckvarFilemask)
-       pkglist("REPLACE_LUA", lkShell, CheckvarPathmask)
-       pkglist("REPLACE_PERL", lkShell, CheckvarPathmask)
-       pkglist("REPLACE_PYTHON", lkShell, CheckvarPathmask)
-       pkglist("REPLACE_SH", lkShell, CheckvarPathmask)
-       pkglist("REQD_DIRS", lkShell, CheckvarPathname)
-       pkglist("REQD_DIRS_PERMS", lkShell, CheckvarPerms)
-       pkglist("REQD_FILES", lkShell, CheckvarPathname)
+       pkg("PYTHON_FOR_BUILD_ONLY", lkNone, BtYes)
+       pkglist("REPLACE_PYTHON", lkShell, BtPathmask)
+       pkg("PYTHON_VERSIONS_ACCEPTED", lkShell, BtVersion)
+       pkg("PYTHON_VERSIONS_INCOMPATIBLE", lkShell, BtVersion)
+       usr("PYTHON_VERSION_DEFAULT", lkNone, BtVersion)
+       usr("PYTHON_VERSION_REQD", lkNone, BtVersion)
+       pkglist("PYTHON_VERSIONED_DEPENDENCIES", lkShell, BtPythonDependency)
+       sys("RANLIB", lkNone, BtShellCommand)
+       pkglist("RCD_SCRIPTS", lkShell, BtFilename)
+       acl("RCD_SCRIPT_SRC.*", lkNone, BtPathname, "Makefile: set")
+       acl("RCD_SCRIPT_WRK.*", lkNone, BtPathname, "Makefile: set")
+       acl("REPLACE.*", lkNone, BtUnknown, "Makefile: set")
+       pkglist("REPLACE_AWK", lkShell, BtPathmask)
+       pkglist("REPLACE_BASH", lkShell, BtPathmask)
+       pkglist("REPLACE_CSH", lkShell, BtPathmask)
+       acl("REPLACE_EMACS", lkShell, BtPathmask, "")
+       acl("REPLACE_FILES.*", lkShell, BtPathmask, "Makefile, Makefile.common: set, append")
+       acl("REPLACE_INTERPRETER", lkShell, BtIdentifier, "Makefile, Makefile.common: append")
+       pkglist("REPLACE_KSH", lkShell, BtPathmask)
+       pkglist("REPLACE_LOCALEDIR_PATTERNS", lkShell, BtFilemask)
+       pkglist("REPLACE_LUA", lkShell, BtPathmask)
+       pkglist("REPLACE_PERL", lkShell, BtPathmask)
+       pkglist("REPLACE_PYTHON", lkShell, BtPathmask)
+       pkglist("REPLACE_SH", lkShell, BtPathmask)
+       pkglist("REQD_DIRS", lkShell, BtPathname)
+       pkglist("REQD_DIRS_PERMS", lkShell, BtPerms)
+       pkglist("REQD_FILES", lkShell, BtPathname)
        pkg("REQD_FILES_MODE", lkNone, enum("0644 0640 0600 0400"))
-       pkglist("REQD_FILES_PERMS", lkShell, CheckvarPerms)
-       pkg("RESTRICTED", lkNone, CheckvarMessage)
-       usr("ROOT_USER", lkNone, CheckvarUserGroupName)
-       usr("ROOT_GROUP", lkNone, CheckvarUserGroupName)
-       usr("RUBY_VERSION_REQD", lkNone, CheckvarVersion)
-       sys("RUN", lkNone, CheckvarShellCommand)
-       sys("RUN_LDCONFIG", lkNone, CheckvarYesNo)
-       acl("SCRIPTS_ENV", lkShell, CheckvarShellWord, "Makefile, Makefile.common: append")
-       usr("SETUID_ROOT_PERMS", lkShell, CheckvarShellWord)
-       pkg("SET_LIBDIR", lkNone, CheckvarYes)
-       sys("SHAREGRP", lkNone, CheckvarUserGroupName)
-       sys("SHAREMODE", lkNone, CheckvarFileMode)
-       sys("SHAREOWN", lkNone, CheckvarUserGroupName)
-       sys("SHCOMMENT", lkNone, CheckvarShellCommand)
+       pkglist("REQD_FILES_PERMS", lkShell, BtPerms)
+       pkg("RESTRICTED", lkNone, BtMessage)
+       usr("ROOT_USER", lkNone, BtUserGroupName)
+       usr("ROOT_GROUP", lkNone, BtUserGroupName)
+       usr("RUBY_VERSION_REQD", lkNone, BtVersion)
+       sys("RUN", lkNone, BtShellCommand)
+       sys("RUN_LDCONFIG", lkNone, BtYesNo)
+       acl("SCRIPTS_ENV", lkShell, BtShellWord, "Makefile, Makefile.common: append")
+       usr("SETUID_ROOT_PERMS", lkShell, BtShellWord)
+       pkg("SET_LIBDIR", lkNone, BtYes)
+       sys("SHAREGRP", lkNone, BtUserGroupName)
+       sys("SHAREMODE", lkNone, BtFileMode)
+       sys("SHAREOWN", lkNone, BtUserGroupName)
+       sys("SHCOMMENT", lkNone, BtShellCommand)
        acl("SHLIB_HANDLING", lkNone, enum("YES NO no"), "")
-       acl("SHLIBTOOL", lkNone, CheckvarShellCommand, "Makefile: use")
-       acl("SHLIBTOOL_OVERRIDE", lkShell, CheckvarPathmask, "Makefile: set, append; Makefile.common: append")
-       acl("SITES.*", lkShell, CheckvarFetchURL, "Makefile, Makefile.common, options.mk: set, append, use")
-       usr("SMF_PREFIS", lkNone, CheckvarPathname)
-       pkg("SMF_SRCDIR", lkNone, CheckvarPathname)
-       pkg("SMF_NAME", lkNone, CheckvarFilename)
-       pkg("SMF_MANIFEST", lkNone, CheckvarPathname)
-       pkg("SMF_INSTANCES", lkShell, CheckvarIdentifier)
-       pkg("SMF_METHODS", lkShell, CheckvarFilename)
-       pkg("SMF_METHOD_SRC.*", lkNone, CheckvarPathname)
-       pkg("SMF_METHOD_SHELL", lkNone, CheckvarShellCommand)
-       pkglist("SPECIAL_PERMS", lkShell, CheckvarPerms)
-       sys("STEP_MSG", lkNone, CheckvarShellCommand)
-       acl("SUBDIR", lkShell, CheckvarFilename, "Makefile: append; *:")
-       acl("SUBST_CLASSES", lkShell, CheckvarIdentifier, "Makefile: set, append; *: append")
-       acl("SUBST_CLASSES.*", lkShell, CheckvarIdentifier, "Makefile: set, append; *: append")
-       acl("SUBST_FILES.*", lkShell, CheckvarPathmask, "Makefile, Makefile.*, *.mk: set, append")
-       acl("SUBST_FILTER_CMD.*", lkNone, CheckvarShellCommand, "Makefile, Makefile.*, *.mk: set")
-       acl("SUBST_MESSAGE.*", lkNone, CheckvarMessage, "Makefile, Makefile.*, *.mk: set")
-       acl("SUBST_SED.*", lkNone, CheckvarSedCommands, "Makefile, Makefile.*, *.mk: set, append")
-       pkg("SUBST_STAGE.*", lkNone, CheckvarStage)
-       pkglist("SUBST_VARS.*", lkShell, CheckvarVariableName)
-       pkglist("SUPERSEDES", lkSpace, CheckvarDependency)
-       pkglist("TEST_DIRS", lkShell, CheckvarWrksrcSubdirectory)
-       pkglist("TEST_ENV", lkShell, CheckvarShellWord)
-       acl("TEST_TARGET", lkShell, CheckvarIdentifier, "Makefile: set; Makefile.common: default, set; options.mk: set, append")
+       acl("SHLIBTOOL", lkNone, BtShellCommand, "Makefile: use")
+       acl("SHLIBTOOL_OVERRIDE", lkShell, BtPathmask, "Makefile: set, append; Makefile.common: append")
+       acl("SITES.*", lkShell, BtFetchURL, "Makefile, Makefile.common, options.mk: set, append, use")
+       usr("SMF_PREFIS", lkNone, BtPathname)
+       pkg("SMF_SRCDIR", lkNone, BtPathname)
+       pkg("SMF_NAME", lkNone, BtFilename)
+       pkg("SMF_MANIFEST", lkNone, BtPathname)
+       pkg("SMF_INSTANCES", lkShell, BtIdentifier)
+       pkg("SMF_METHODS", lkShell, BtFilename)
+       pkg("SMF_METHOD_SRC.*", lkNone, BtPathname)
+       pkg("SMF_METHOD_SHELL", lkNone, BtShellCommand)
+       pkglist("SPECIAL_PERMS", lkShell, BtPerms)
+       sys("STEP_MSG", lkNone, BtShellCommand)
+       acl("SUBDIR", lkShell, BtFilename, "Makefile: append; *:")
+       acl("SUBST_CLASSES", lkShell, BtIdentifier, "Makefile: set, append; *: append")
+       acl("SUBST_CLASSES.*", lkShell, BtIdentifier, "Makefile: set, append; *: append")
+       acl("SUBST_FILES.*", lkShell, BtPathmask, "Makefile, Makefile.*, *.mk: set, append")
+       acl("SUBST_FILTER_CMD.*", lkNone, BtShellCommand, "Makefile, Makefile.*, *.mk: set")
+       acl("SUBST_MESSAGE.*", lkNone, BtMessage, "Makefile, Makefile.*, *.mk: set")
+       acl("SUBST_SED.*", lkNone, BtSedCommands, "Makefile, Makefile.*, *.mk: set, append")
+       pkg("SUBST_STAGE.*", lkNone, BtStage)
+       pkglist("SUBST_VARS.*", lkShell, BtVariableName)
+       pkglist("SUPERSEDES", lkSpace, BtDependency)
+       pkglist("TEST_DIRS", lkShell, BtWrksrcSubdirectory)
+       pkglist("TEST_ENV", lkShell, BtShellWord)
+       acl("TEST_TARGET", lkShell, BtIdentifier, "Makefile: set; Makefile.common: default, set; options.mk: set, append")
        acl("TEX_ACCEPTED", lkShell, enum("teTeX1 teTeX2 teTeX3"), "Makefile, Makefile.common: set")
        acl("TEX_DEPMETHOD", lkNone, enum("build run"), "Makefile, Makefile.common: set")
-       pkglist("TEXINFO_REQD", lkShell, CheckvarVersion)
-       acl("TOOL_DEPENDS", lkSpace, CheckvarDependencyWithPath, "Makefile, Makefile.common, *.mk: append")
-       sys("TOOLS_ALIASES", lkShell, CheckvarFilename)
-       sys("TOOLS_BROKEN", lkShell, CheckvarTool)
-       sys("TOOLS_CMD.*", lkNone, CheckvarPathname)
-       sys("TOOLS_CREATE", lkShell, CheckvarTool)
-       acl("TOOLS_DEPENDS.*", lkSpace, CheckvarDependencyWithPath, "buildlink3.mk:; Makefile, Makefile.*: set, default; *: use")
-       sys("TOOLS_GNU_MISSING", lkShell, CheckvarTool)
-       sys("TOOLS_NOOP", lkShell, CheckvarTool)
-       sys("TOOLS_PATH.*", lkNone, CheckvarPathname)
-       sys("TOOLS_PLATFORM.*", lkNone, CheckvarShellCommand)
-       sys("TOUCH_FLAGS", lkShell, CheckvarShellWord)
-       pkglist("UAC_REQD_EXECS", lkShell, CheckvarPrefixPathname)
+       pkglist("TEXINFO_REQD", lkShell, BtVersion)
+       acl("TOOL_DEPENDS", lkSpace, BtDependencyWithPath, "Makefile, Makefile.common, *.mk: append")
+       sys("TOOLS_ALIASES", lkShell, BtFilename)
+       sys("TOOLS_BROKEN", lkShell, BtTool)
+       sys("TOOLS_CMD.*", lkNone, BtPathname)
+       sys("TOOLS_CREATE", lkShell, BtTool)
+       acl("TOOLS_DEPENDS.*", lkSpace, BtDependencyWithPath, "buildlink3.mk:; Makefile, Makefile.*: set, default; *: use")
+       sys("TOOLS_GNU_MISSING", lkShell, BtTool)
+       sys("TOOLS_NOOP", lkShell, BtTool)
+       sys("TOOLS_PATH.*", lkNone, BtPathname)
+       sys("TOOLS_PLATFORM.*", lkNone, BtShellCommand)
+       sys("TOUCH_FLAGS", lkShell, BtShellWord)
+       pkglist("UAC_REQD_EXECS", lkShell, BtPrefixPathname)
        acl("UNLIMIT_RESOURCES", lkShell, enum("datasize stacksize memorysize"), "Makefile: set, append; Makefile.common: append")
-       usr("UNPRIVILEGED_USER", lkNone, CheckvarUserGroupName)
-       usr("UNPRIVILEGED_GROUP", lkNone, CheckvarUserGroupName)
-       pkglist("UNWRAP_FILES", lkShell, CheckvarPathmask)
-       usr("UPDATE_TARGET", lkShell, CheckvarIdentifier)
+       usr("UNPRIVILEGED_USER", lkNone, BtUserGroupName)
+       usr("UNPRIVILEGED_GROUP", lkNone, BtUserGroupName)
+       pkglist("UNWRAP_FILES", lkShell, BtPathmask)
+       usr("UPDATE_TARGET", lkShell, BtIdentifier)
        pkg("USERGROUP_PHASE", lkNone, enum("configure build pre-install"))
-       pkg("USE_BSD_MAKEFILE", lkNone, CheckvarYes)
-       acl("USE_BUILTIN.*", lkNone, CheckvarYesNoIndirectly, "builtin.mk: set")
-       pkg("USE_CMAKE", lkNone, CheckvarYes)
-       usr("USE_DESTDIR", lkNone, CheckvarYes)
-       pkglist("USE_FEATURES", lkShell, CheckvarIdentifier)
-       pkg("USE_GCC_RUNTIME", lkNone, CheckvarYesNo)
-       pkg("USE_GNU_CONFIGURE_HOST", lkNone, CheckvarYesNo)
-       acl("USE_GNU_ICONV", lkNone, CheckvarYes, "Makefile, Makefile.common, options.mk: set")
-       acl("USE_IMAKE", lkNone, CheckvarYes, "Makefile: set")
+       pkg("USE_BSD_MAKEFILE", lkNone, BtYes)
+       acl("USE_BUILTIN.*", lkNone, BtYesNoIndirectly, "builtin.mk: set")
+       pkg("USE_CMAKE", lkNone, BtYes)
+       usr("USE_DESTDIR", lkNone, BtYes)
+       pkglist("USE_FEATURES", lkShell, BtIdentifier)
+       pkg("USE_GCC_RUNTIME", lkNone, BtYesNo)
+       pkg("USE_GNU_CONFIGURE_HOST", lkNone, BtYesNo)
+       acl("USE_GNU_ICONV", lkNone, BtYes, "Makefile, Makefile.common, options.mk: set")
+       acl("USE_IMAKE", lkNone, BtYes, "Makefile: set")
        pkg("USE_JAVA", lkNone, enum("run yes build"))
        pkg("USE_JAVA2", lkNone, enum("YES yes no 1.4 1.5 6 7 8"))
        acl("USE_LANGUAGES", lkShell, enum("ada c c99 c++ fortran fortran77 java objc"), "Makefile, Makefile.common, options.mk: set, append")
-       pkg("USE_LIBTOOL", lkNone, CheckvarYes)
-       pkg("USE_MAKEINFO", lkNone, CheckvarYes)
-       pkg("USE_MSGFMT_PLURALS", lkNone, CheckvarYes)
-       pkg("USE_NCURSES", lkNone, CheckvarYes)
-       pkg("USE_OLD_DES_API", lkNone, CheckvarYesNo)
-       pkg("USE_PKGINSTALL", lkNone, CheckvarYes)
-       pkg("USE_PKGLOCALEDIR", lkNone, CheckvarYesNo)
-       usr("USE_PKGSRC_GCC", lkNone, CheckvarYes)
-       acl("USE_TOOLS", lkShell, CheckvarTool, "*: append")
-       acl("USE_TOOLS.*", lkShell, CheckvarTool, "*: append")
-       pkg("USE_X11", lkNone, CheckvarYes)
-       sys("WARNING_MSG", lkNone, CheckvarShellCommand)
-       sys("WARNING_CAT", lkNone, CheckvarShellCommand)
-       acl("WRAPPER_REORDER_CMDS", lkShell, CheckvarWrapperReorder, "Makefile, Makefile.common, buildlink3.mk: append")
-       pkg("WRAPPER_SHELL", lkNone, CheckvarShellCommand)
-       acl("WRAPPER_TRANSFORM_CMDS", lkShell, CheckvarWrapperTransform, "Makefile, Makefile.common, buildlink3.mk: append")
-       sys("WRKDIR", lkNone, CheckvarPathname)
-       pkg("WRKSRC", lkNone, CheckvarWrkdirSubdirectory)
-       sys("X11_PKGSRCDIR.*", lkNone, CheckvarPathname)
+       pkg("USE_LIBTOOL", lkNone, BtYes)
+       pkg("USE_MAKEINFO", lkNone, BtYes)
+       pkg("USE_MSGFMT_PLURALS", lkNone, BtYes)
+       pkg("USE_NCURSES", lkNone, BtYes)
+       pkg("USE_OLD_DES_API", lkNone, BtYesNo)
+       pkg("USE_PKGINSTALL", lkNone, BtYes)
+       pkg("USE_PKGLOCALEDIR", lkNone, BtYesNo)
+       usr("USE_PKGSRC_GCC", lkNone, BtYes)
+       acl("USE_TOOLS", lkShell, BtTool, "*: append")
+       acl("USE_TOOLS.*", lkShell, BtTool, "*: append")
+       pkg("USE_X11", lkNone, BtYes)
+       sys("WARNING_MSG", lkNone, BtShellCommand)
+       sys("WARNING_CAT", lkNone, BtShellCommand)
+       acl("WRAPPER_REORDER_CMDS", lkShell, BtWrapperReorder, "Makefile, Makefile.common, buildlink3.mk: append")
+       pkg("WRAPPER_SHELL", lkNone, BtShellCommand)
+       acl("WRAPPER_TRANSFORM_CMDS", lkShell, BtWrapperTransform, "Makefile, Makefile.common, buildlink3.mk: append")
+       sys("WRKDIR", lkNone, BtPathname)
+       pkg("WRKSRC", lkNone, BtWrkdirSubdirectory)
+       sys("X11_PKGSRCDIR.*", lkNone, BtPathname)
        usr("XAW_TYPE", lkNone, enum("3d neXtaw standard xpm"))
-       acl("XMKMF_FLAGS", lkShell, CheckvarShellWord, "")
-       pkglist("_WRAP_EXTRA_ARGS.*", lkShell, CheckvarShellWord)
+       acl("XMKMF_FLAGS", lkShell, BtShellWord, "")
+       pkglist("_WRAP_EXTRA_ARGS.*", lkShell, BtShellWord)
 }
 
-func enum(values string) *VarChecker {
+func enum(values string) *BasicType {
        vmap := make(map[string]bool)
        for _, value := range splitOnSpace(values) {
                vmap[value] = true
        }
        name := "enum: " + values + " " // See IsEnum
-       return &VarChecker{name, func(cv *VartypeCheck) {
+       return &BasicType{name, func(cv *VartypeCheck) {
                if cv.Op == opUseMatch {
                        if !vmap[cv.Value] && cv.Value == cv.ValueNoVar {
                                canMatch := false
@@ -768,7 +768,7 @@ func enum(values string) *VarChecker {
        }}
 }
 
-func acl(varname string, kindOfList KindOfList, checker *VarChecker, aclentries string) {
+func acl(varname string, kindOfList KindOfList, checker *BasicType, aclentries string) {
        m := mustMatch(varname, `^([A-Z_.][A-Z0-9_]*)(|\*|\.\*)$`)
        varbase, varparam := m[1], m[2]
 
@@ -843,13 +843,13 @@ func parseAclEntries(varname string, acl
 }
 
 // A package-defined variable may be set in all Makefiles except buildlink3.mk and builtin.mk.
-func pkg(varname string, kindOfList KindOfList, checker *VarChecker) {
+func pkg(varname string, kindOfList KindOfList, checker *BasicType) {
        acl(varname, kindOfList, checker, "Makefile: set, use; buildlink3.mk, builtin.mk:; Makefile.*, *.mk: default, set, use")
 }
 
 // A package-defined list may be appended to in all Makefiles except buildlink3.mk and builtin.mk.
 // Simple assignment (instead of appending) is only allowed in Makefile and Makefile.common.
-func pkglist(varname string, kindOfList KindOfList, checker *VarChecker) {
+func pkglist(varname string, kindOfList KindOfList, checker *BasicType) {
        acl(varname, kindOfList, checker, "Makefile, Makefile.common, options.mk: append, default, set, use; buildlink3.mk, builtin.mk:; *.mk: append, default, use")
 }
 
@@ -857,15 +857,15 @@ func pkglist(varname string, kindOfList 
 // package file. It also must not be used in buildlink3.mk and
 // builtin.mk files or at load-time, since the system/user preferences
 // may not have been loaded when these files are included.
-func sys(varname string, kindOfList KindOfList, checker *VarChecker) {
+func sys(varname string, kindOfList KindOfList, checker *BasicType) {
        acl(varname, kindOfList, checker, "buildlink3.mk:; *: use")
 }
-func usr(varname string, kindOfList KindOfList, checker *VarChecker) {
+func usr(varname string, kindOfList KindOfList, checker *BasicType) {
        acl(varname, kindOfList, checker, "buildlink3.mk:; *: use-loadtime, use")
 }
-func bl3list(varname string, kindOfList KindOfList, checker *VarChecker) {
+func bl3list(varname string, kindOfList KindOfList, checker *BasicType) {
        acl(varname, kindOfList, checker, "buildlink3.mk, builtin.mk: append")
 }
-func cmdline(varname string, kindOfList KindOfList, checker *VarChecker) {
+func cmdline(varname string, kindOfList KindOfList, checker *BasicType) {
        acl(varname, kindOfList, checker, "buildlink3.mk, builtin.mk:; *: use-loadtime, use")
 }
Index: pkgsrc/pkgtools/pkglint/files/vartypecheck_test.go
diff -u pkgsrc/pkgtools/pkglint/files/vartypecheck_test.go:1.13 pkgsrc/pkgtools/pkglint/files/vartypecheck_test.go:1.14
--- pkgsrc/pkgtools/pkglint/files/vartypecheck_test.go:1.13     Sun Jul 10 11:37:27 2016
+++ pkgsrc/pkgtools/pkglint/files/vartypecheck_test.go  Sun Jul 10 21:24:47 2016
@@ -231,6 +231,24 @@ func (s *Suite) Test_VartypeCheck_LdFlag
        c.Check(s.Output(), equals, "WARN: fname:4: Unknown linker flag \"-unknown\".\n")
 }
 
+func (s *Suite) Test_VartypeCheck_License(c *check.C) {
+       runVartypeChecks("LICENSE", opAssign, (*VartypeCheck).License,
+               "gnu-gpl-v2",
+               "AND mit")
+
+       c.Check(s.Output(), equals, ""+
+               "WARN: fname:1: License file /licenses/gnu-gpl-v2 does not exist.\n"+
+               "ERROR: fname:2: Parse error for license condition \"AND mit\".\n")
+
+       runVartypeChecks("LICENSE", opAssignAppend, (*VartypeCheck).License,
+               "gnu-gpl-v2",
+               "AND mit")
+
+       c.Check(s.Output(), equals, ""+
+               "ERROR: fname:1: Parse error for appended license condition \"gnu-gpl-v2\".\n"+
+               "WARN: fname:2: License file /licenses/mit does not exist.\n")
+}
+
 func (s *Suite) Test_VartypeCheck_MachineGnuPlatform(c *check.C) {
        runVartypeMatchChecks("MACHINE_GNU_PLATFORM", (*VartypeCheck).MachineGnuPlatform,
                "x86_64-pc-cygwin",

Index: pkgsrc/pkgtools/pkglint/files/vartype.go
diff -u pkgsrc/pkgtools/pkglint/files/vartype.go:1.9 pkgsrc/pkgtools/pkglint/files/vartype.go:1.10
--- pkgsrc/pkgtools/pkglint/files/vartype.go:1.9        Sat Jul  9 09:43:48 2016
+++ pkgsrc/pkgtools/pkglint/files/vartype.go    Sun Jul 10 21:24:47 2016
@@ -9,7 +9,7 @@ import (
 // See vardefs.go for examples, and vartypecheck.go for the implementation.
 type Vartype struct {
        kindOfList KindOfList
-       checker    *VarChecker
+       basicType  *BasicType
        aclEntries []AclEntry
        guessed    bool
 }
@@ -110,8 +110,8 @@ func (vt *Vartype) IsConsideredList() bo
        case lkSpace:
                return false
        }
-       switch vt.checker {
-       case CheckvarAwkCommand, CheckvarSedCommands, CheckvarShellCommand, CheckvarShellCommands:
+       switch vt.basicType {
+       case BtAwkCommand, BtSedCommands, BtShellCommand, BtShellCommands, BtLicense:
                return true
        }
        return false
@@ -124,24 +124,24 @@ func (vt *Vartype) MayBeAppendedTo() boo
 func (vt *Vartype) String() string {
        switch vt.kindOfList {
        case lkNone:
-               return vt.checker.name
+               return vt.basicType.name
        case lkSpace:
-               return "SpaceList of " + vt.checker.name
+               return "SpaceList of " + vt.basicType.name
        case lkShell:
-               return "ShellList of " + vt.checker.name
+               return "ShellList of " + vt.basicType.name
        default:
                panic("Unknown list type")
        }
 }
 
 func (vt *Vartype) IsShell() bool {
-       switch vt.checker {
-       case CheckvarCFlag, // Subtype of ShellWord
-               CheckvarLdFlag, // Subtype of ShellWord
-               CheckvarSedCommands,
-               CheckvarShellCommand,
-               CheckvarShellCommands,
-               CheckvarShellWord:
+       switch vt.basicType {
+       case BtCFlag, // Subtype of ShellWord
+               BtLdFlag, // Subtype of ShellWord
+               BtSedCommands,
+               BtShellCommand,
+               BtShellCommands,
+               BtShellWord:
                return true
        }
        return false
@@ -150,127 +150,125 @@ func (vt *Vartype) IsShell() bool {
 // The basic vartype consists only of characters that don’t
 // need escaping in most contexts, like A-Za-z0-9-_.
 func (vt *Vartype) IsBasicSafe() bool {
-       switch vt.checker {
-       case CheckvarBuildlinkDepmethod,
-               CheckvarCategory,
-               CheckvarDistSuffix,
-               CheckvarEmulPlatform,
-               CheckvarFileMode,
-               CheckvarFilename,
-               CheckvarIdentifier,
-               CheckvarInteger,
-               CheckvarMachineGnuPlatform,
-               CheckvarMachinePlatform,
-               CheckvarOption,
-               CheckvarPathname,
-               CheckvarPerl5Packlist,
-               CheckvarPkgName,
-               CheckvarPkgOptionsVar,
-               CheckvarPkgPath,
-               CheckvarPkgRevision,
-               CheckvarPrefixPathname,
-               CheckvarPythonDependency,
-               CheckvarRelativePkgDir,
-               CheckvarRelativePkgPath,
-               CheckvarStage,
-               CheckvarUserGroupName,
-               CheckvarVersion,
-               CheckvarWrkdirSubdirectory,
-               CheckvarYesNo,
-               CheckvarYesNoIndirectly:
+       switch vt.basicType {
+       case BtBuildlinkDepmethod,
+               BtCategory,
+               BtDistSuffix,
+               BtEmulPlatform,
+               BtFileMode,
+               BtFilename,
+               BtIdentifier,
+               BtInteger,
+               BtMachineGnuPlatform,
+               BtMachinePlatform,
+               BtOption,
+               BtPathname,
+               BtPerl5Packlist,
+               BtPkgName,
+               BtPkgOptionsVar,
+               BtPkgPath,
+               BtPkgRevision,
+               BtPrefixPathname,
+               BtPythonDependency,
+               BtRelativePkgDir,
+               BtRelativePkgPath,
+               BtStage,
+               BtUserGroupName,
+               BtVersion,
+               BtWrkdirSubdirectory,
+               BtYesNo,
+               BtYesNoIndirectly:
                return true
        }
        return false
 }
 
 func (vt *Vartype) IsPlainString() bool {
-       switch vt.checker {
-       case CheckvarComment, CheckvarMessage, CheckvarString:
+       switch vt.basicType {
+       case BtComment, BtMessage, BtUnknown:
                return true
        }
        return false
 }
 
-type VarChecker struct {
+type BasicType struct {
        name    string
        checker func(*VartypeCheck)
 }
 
-func (vc *VarChecker) IsEnum() bool {
-       return hasPrefix(vc.name, "enum: ")
+func (bt *BasicType) IsEnum() bool {
+       return hasPrefix(bt.name, "enum: ")
 }
-func (vc *VarChecker) HasEnum(value string) bool {
-       return !contains(value, " ") && contains(vc.name, " "+value+" ")
+func (bt *BasicType) HasEnum(value string) bool {
+       return !contains(value, " ") && contains(bt.name, " "+value+" ")
 }
-func (vc *VarChecker) AllowedEnums() string {
-       return vc.name[6 : len(vc.name)-1]
+func (bt *BasicType) AllowedEnums() string {
+       return bt.name[6 : len(bt.name)-1]
 }
 
 var (
-       CheckvarAwkCommand             = &VarChecker{"AwkCommand", (*VartypeCheck).AwkCommand}
-       CheckvarBasicRegularExpression = &VarChecker{"BasicRegularExpression", (*VartypeCheck).BasicRegularExpression}
-       CheckvarBuildlinkDepmethod     = &VarChecker{"BuildlinkDepmethod", (*VartypeCheck).BuildlinkDepmethod}
-       CheckvarCategory               = &VarChecker{"Category", (*VartypeCheck).Category}
-       CheckvarCFlag                  = &VarChecker{"CFlag", (*VartypeCheck).CFlag}
-       CheckvarComment                = &VarChecker{"Comment", (*VartypeCheck).Comment}
-       CheckvarDependency             = &VarChecker{"Dependency", (*VartypeCheck).Dependency}
-       CheckvarDependencyWithPath     = &VarChecker{"DependencyWithPath", (*VartypeCheck).DependencyWithPath}
-       CheckvarDistSuffix             = &VarChecker{"DistSuffix", (*VartypeCheck).DistSuffix}
-       CheckvarEmulPlatform           = &VarChecker{"EmulPlatform", (*VartypeCheck).EmulPlatform}
-       CheckvarFetchURL               = &VarChecker{"FetchURL", (*VartypeCheck).FetchURL}
-       CheckvarFilename               = &VarChecker{"Filename", (*VartypeCheck).Filename}
-       CheckvarFilemask               = &VarChecker{"Filemask", (*VartypeCheck).Filemask}
-       CheckvarFileMode               = &VarChecker{"FileMode", (*VartypeCheck).FileMode}
-       CheckvarHomepage               = &VarChecker{"Homepage", (*VartypeCheck).Homepage}
-       CheckvarIdentifier             = &VarChecker{"Identifier", (*VartypeCheck).Identifier}
-       CheckvarInteger                = &VarChecker{"Integer", (*VartypeCheck).Integer}
-       CheckvarLdFlag                 = &VarChecker{"LdFlag", (*VartypeCheck).LdFlag}
-       CheckvarLicense                = &VarChecker{"License", (*VartypeCheck).License}
-       CheckvarMachineGnuPlatform     = &VarChecker{"MachineGnuPlatform", (*VartypeCheck).MachineGnuPlatform}
-       CheckvarMachinePlatform        = &VarChecker{"MachinePlatform", (*VartypeCheck).MachinePlatform}
-       CheckvarMachinePlatformPattern = &VarChecker{"MachinePlatformPattern", (*VartypeCheck).MachinePlatformPattern}
-       CheckvarMailAddress            = &VarChecker{"MailAddress", (*VartypeCheck).MailAddress}
-       CheckvarMessage                = &VarChecker{"Message", (*VartypeCheck).Message}
-       CheckvarOption                 = &VarChecker{"Option", (*VartypeCheck).Option}
-       CheckvarPathlist               = &VarChecker{"Pathlist", (*VartypeCheck).Pathlist}
-       CheckvarPathmask               = &VarChecker{"Pathmask", (*VartypeCheck).Pathmask}
-       CheckvarPathname               = &VarChecker{"Pathname", (*VartypeCheck).Pathname}
-       CheckvarPerl5Packlist          = &VarChecker{"Perl5Packlist", (*VartypeCheck).Perl5Packlist}
-       CheckvarPerms                  = &VarChecker{"Perms", (*VartypeCheck).Perms}
-       CheckvarPkgName                = &VarChecker{"PkgName", (*VartypeCheck).PkgName}
-       CheckvarPkgPath                = &VarChecker{"PkgPath", (*VartypeCheck).PkgPath}
-       CheckvarPkgOptionsVar          = &VarChecker{"PkgOptionsVar", (*VartypeCheck).PkgOptionsVar}
-       CheckvarPkgRevision            = &VarChecker{"PkgRevision", (*VartypeCheck).PkgRevision}
-       CheckvarPrefixPathname         = &VarChecker{"PrefixPathname", (*VartypeCheck).PrefixPathname}
-       CheckvarPythonDependency       = &VarChecker{"PythonDependency", (*VartypeCheck).PythonDependency}
-       CheckvarRelativePkgDir         = &VarChecker{"RelativePkgDir", (*VartypeCheck).RelativePkgDir}
-       CheckvarRelativePkgPath        = &VarChecker{"RelativePkgPath", (*VartypeCheck).RelativePkgPath}
-       CheckvarRestricted             = &VarChecker{"Restricted", (*VartypeCheck).Restricted}
-       CheckvarSedCommand             = &VarChecker{"SedCommand", (*VartypeCheck).SedCommand}
-       CheckvarSedCommands            = &VarChecker{"SedCommands", nil}
-       CheckvarShellCommand           = &VarChecker{"ShellCommand", nil}
-       CheckvarShellCommands          = &VarChecker{"ShellCommands", nil}
-       CheckvarShellWord              = &VarChecker{"ShellWord", nil}
-       CheckvarStage                  = &VarChecker{"Stage", (*VartypeCheck).Stage}
-       CheckvarString                 = &VarChecker{"String", (*VartypeCheck).String}
-       CheckvarTool                   = &VarChecker{"Tool", (*VartypeCheck).Tool}
-       CheckvarUnchecked              = &VarChecker{"Unchecked", (*VartypeCheck).Unchecked}
-       CheckvarURL                    = &VarChecker{"URL", (*VartypeCheck).URL}
-       CheckvarUserGroupName          = &VarChecker{"UserGroupName", (*VartypeCheck).UserGroupName}
-       CheckvarVariableName           = &VarChecker{"VariableName", (*VartypeCheck).VariableName}
-       CheckvarVersion                = &VarChecker{"Version", (*VartypeCheck).Version}
-       CheckvarWrapperReorder         = &VarChecker{"WrapperReorder", (*VartypeCheck).WrapperReorder}
-       CheckvarWrapperTransform       = &VarChecker{"WrapperTransform", (*VartypeCheck).WrapperTransform}
-       CheckvarWrkdirSubdirectory     = &VarChecker{"WrkdirSubdirectory", (*VartypeCheck).WrkdirSubdirectory}
-       CheckvarWrksrcSubdirectory     = &VarChecker{"WrksrcSubdirectory", (*VartypeCheck).WrksrcSubdirectory}
-       CheckvarYes                    = &VarChecker{"Yes", (*VartypeCheck).Yes}
-       CheckvarYesNo                  = &VarChecker{"YesNo", (*VartypeCheck).YesNo}
-       CheckvarYesNoIndirectly        = &VarChecker{"YesNoIndirectly", (*VartypeCheck).YesNoIndirectly}
+       BtAwkCommand             = &BasicType{"AwkCommand", (*VartypeCheck).AwkCommand}
+       BtBasicRegularExpression = &BasicType{"BasicRegularExpression", (*VartypeCheck).BasicRegularExpression}
+       BtBuildlinkDepmethod     = &BasicType{"BuildlinkDepmethod", (*VartypeCheck).BuildlinkDepmethod}
+       BtCategory               = &BasicType{"Category", (*VartypeCheck).Category}
+       BtCFlag                  = &BasicType{"CFlag", (*VartypeCheck).CFlag}
+       BtComment                = &BasicType{"Comment", (*VartypeCheck).Comment}
+       BtDependency             = &BasicType{"Dependency", (*VartypeCheck).Dependency}
+       BtDependencyWithPath     = &BasicType{"DependencyWithPath", (*VartypeCheck).DependencyWithPath}
+       BtDistSuffix             = &BasicType{"DistSuffix", (*VartypeCheck).DistSuffix}
+       BtEmulPlatform           = &BasicType{"EmulPlatform", (*VartypeCheck).EmulPlatform}
+       BtFetchURL               = &BasicType{"FetchURL", (*VartypeCheck).FetchURL}
+       BtFilename               = &BasicType{"Filename", (*VartypeCheck).Filename}
+       BtFilemask               = &BasicType{"Filemask", (*VartypeCheck).Filemask}
+       BtFileMode               = &BasicType{"FileMode", (*VartypeCheck).FileMode}
+       BtHomepage               = &BasicType{"Homepage", (*VartypeCheck).Homepage}
+       BtIdentifier             = &BasicType{"Identifier", (*VartypeCheck).Identifier}
+       BtInteger                = &BasicType{"Integer", (*VartypeCheck).Integer}
+       BtLdFlag                 = &BasicType{"LdFlag", (*VartypeCheck).LdFlag}
+       BtLicense                = &BasicType{"License", (*VartypeCheck).License}
+       BtMachineGnuPlatform     = &BasicType{"MachineGnuPlatform", (*VartypeCheck).MachineGnuPlatform}
+       BtMachinePlatform        = &BasicType{"MachinePlatform", (*VartypeCheck).MachinePlatform}
+       BtMachinePlatformPattern = &BasicType{"MachinePlatformPattern", (*VartypeCheck).MachinePlatformPattern}
+       BtMailAddress            = &BasicType{"MailAddress", (*VartypeCheck).MailAddress}
+       BtMessage                = &BasicType{"Message", (*VartypeCheck).Message}
+       BtOption                 = &BasicType{"Option", (*VartypeCheck).Option}
+       BtPathlist               = &BasicType{"Pathlist", (*VartypeCheck).Pathlist}
+       BtPathmask               = &BasicType{"Pathmask", (*VartypeCheck).Pathmask}
+       BtPathname               = &BasicType{"Pathname", (*VartypeCheck).Pathname}
+       BtPerl5Packlist          = &BasicType{"Perl5Packlist", (*VartypeCheck).Perl5Packlist}
+       BtPerms                  = &BasicType{"Perms", (*VartypeCheck).Perms}
+       BtPkgName                = &BasicType{"PkgName", (*VartypeCheck).PkgName}
+       BtPkgPath                = &BasicType{"PkgPath", (*VartypeCheck).PkgPath}
+       BtPkgOptionsVar          = &BasicType{"PkgOptionsVar", (*VartypeCheck).PkgOptionsVar}
+       BtPkgRevision            = &BasicType{"PkgRevision", (*VartypeCheck).PkgRevision}
+       BtPrefixPathname         = &BasicType{"PrefixPathname", (*VartypeCheck).PrefixPathname}
+       BtPythonDependency       = &BasicType{"PythonDependency", (*VartypeCheck).PythonDependency}
+       BtRelativePkgDir         = &BasicType{"RelativePkgDir", (*VartypeCheck).RelativePkgDir}
+       BtRelativePkgPath        = &BasicType{"RelativePkgPath", (*VartypeCheck).RelativePkgPath}
+       BtRestricted             = &BasicType{"Restricted", (*VartypeCheck).Restricted}
+       BtSedCommand             = &BasicType{"SedCommand", (*VartypeCheck).SedCommand}
+       BtSedCommands            = &BasicType{"SedCommands", (*VartypeCheck).SedCommands}
+       BtShellCommand           = &BasicType{"ShellCommand", nil}
+       BtShellCommands          = &BasicType{"ShellCommands", nil}
+       BtShellWord              = &BasicType{"ShellWord", nil}
+       BtStage                  = &BasicType{"Stage", (*VartypeCheck).Stage}
+       BtTool                   = &BasicType{"Tool", (*VartypeCheck).Tool}
+       BtUnknown                = &BasicType{"Unknown", (*VartypeCheck).Unknown}
+       BtURL                    = &BasicType{"URL", (*VartypeCheck).URL}
+       BtUserGroupName          = &BasicType{"UserGroupName", (*VartypeCheck).UserGroupName}
+       BtVariableName           = &BasicType{"VariableName", (*VartypeCheck).VariableName}
+       BtVersion                = &BasicType{"Version", (*VartypeCheck).Version}
+       BtWrapperReorder         = &BasicType{"WrapperReorder", (*VartypeCheck).WrapperReorder}
+       BtWrapperTransform       = &BasicType{"WrapperTransform", (*VartypeCheck).WrapperTransform}
+       BtWrkdirSubdirectory     = &BasicType{"WrkdirSubdirectory", (*VartypeCheck).WrkdirSubdirectory}
+       BtWrksrcSubdirectory     = &BasicType{"WrksrcSubdirectory", (*VartypeCheck).WrksrcSubdirectory}
+       BtYes                    = &BasicType{"Yes", (*VartypeCheck).Yes}
+       BtYesNo                  = &BasicType{"YesNo", (*VartypeCheck).YesNo}
+       BtYesNoIndirectly        = &BasicType{"YesNoIndirectly", (*VartypeCheck).YesNoIndirectly}
 )
 
 func init() { // Necessary due to circular dependency
-       CheckvarSedCommands.checker = (*VartypeCheck).SedCommands
-       CheckvarShellCommand.checker = (*VartypeCheck).ShellCommand
-       CheckvarShellCommands.checker = (*VartypeCheck).ShellCommands
-       CheckvarShellWord.checker = (*VartypeCheck).ShellWord
+       BtShellCommand.checker = (*VartypeCheck).ShellCommand
+       BtShellCommands.checker = (*VartypeCheck).ShellCommands
+       BtShellWord.checker = (*VartypeCheck).ShellWord
 }

Index: pkgsrc/pkgtools/pkglint/files/vartypecheck.go
diff -u pkgsrc/pkgtools/pkglint/files/vartypecheck.go:1.17 pkgsrc/pkgtools/pkglint/files/vartypecheck.go:1.18
--- pkgsrc/pkgtools/pkglint/files/vartypecheck.go:1.17  Sun Jul 10 11:37:27 2016
+++ pkgsrc/pkgtools/pkglint/files/vartypecheck.go       Sun Jul 10 21:24:47 2016
@@ -83,7 +83,7 @@ const (
        reEmulArch = reMachineArch // Just a wild guess.
 )
 
-func enumFromRe(re string) *VarChecker {
+func enumFromRe(re string) *BasicType {
        values := strings.Split(re, "|")
        sort.Strings(values)
        seen := make(map[string]bool)
@@ -274,7 +274,7 @@ func (cv *VartypeCheck) DependencyWithPa
                        line.Warn0("Please use USE_TOOLS+=gmake instead of this dependency.")
                }
 
-               cv.MkLine.CheckVartypePrimitive(cv.Varname, CheckvarDependency, cv.Op, pattern, cv.MkComment, cv.Guessed)
+               cv.MkLine.CheckVartypePrimitive(cv.Varname, BtDependency, cv.Op, pattern, cv.MkComment, cv.Guessed)
                return
        }
 
@@ -339,7 +339,7 @@ func (cv *VartypeCheck) EmulPlatform() {
 }
 
 func (cv *VartypeCheck) FetchURL() {
-       cv.MkLine.CheckVartypePrimitive(cv.Varname, CheckvarURL, cv.Op, cv.Value, cv.MkComment, cv.Guessed)
+       cv.MkLine.CheckVartypePrimitive(cv.Varname, BtURL, cv.Op, cv.Value, cv.MkComment, cv.Guessed)
 
        for siteURL, siteName := range G.globalData.MasterSiteURLToVar {
                if hasPrefix(cv.Value, siteURL) {
@@ -399,7 +399,7 @@ func (cv *VartypeCheck) FileMode() {
 }
 
 func (cv *VartypeCheck) Homepage() {
-       cv.MkLine.CheckVartypePrimitive(cv.Varname, CheckvarURL, cv.Op, cv.Value, cv.MkComment, cv.Guessed)
+       cv.MkLine.CheckVartypePrimitive(cv.Varname, BtURL, cv.Op, cv.Value, cv.MkComment, cv.Guessed)
 
        if m, wrong, sitename, subdir := match3(cv.Value, `^(\$\{(MASTER_SITE\w+)(?::=([\w\-/]+))?\})`); m {
                baseURL := G.globalData.MasterSiteVarToURL[sitename]
@@ -486,7 +486,8 @@ func (cv *VartypeCheck) LdFlag() {
 }
 
 func (cv *VartypeCheck) License() {
-       checklineLicense(cv.MkLine, cv.Value)
+       licenseChecker := &LicenseChecker{cv.MkLine}
+       licenseChecker.Check(cv.Value, cv.Op)
 }
 
 func (cv *VartypeCheck) MachineGnuPlatform() {
@@ -608,7 +609,7 @@ func (cv *VartypeCheck) Option() {
 // The PATH environment variable
 func (cv *VartypeCheck) Pathlist() {
        if !contains(cv.Value, ":") && cv.Guessed {
-               cv.MkLine.CheckVartypePrimitive(cv.Varname, CheckvarPathname, cv.Op, cv.Value, cv.MkComment, cv.Guessed)
+               cv.MkLine.CheckVartypePrimitive(cv.Varname, BtPathname, cv.Op, cv.Value, cv.MkComment, cv.Guessed)
                return
        }
 
@@ -671,7 +672,7 @@ func (cv *VartypeCheck) PkgName() {
 }
 
 func (cv *VartypeCheck) PkgOptionsVar() {
-       cv.MkLine.CheckVartypePrimitive(cv.Varname, CheckvarVariableName, cv.Op, cv.Value, cv.MkComment, cv.Guessed)
+       cv.MkLine.CheckVartypePrimitive(cv.Varname, BtVariableName, cv.Op, cv.Value, cv.MkComment, cv.Guessed)
        if matches(cv.Value, `\$\{PKGBASE[:\}]`) {
                cv.Line.Error0("PKGBASE must not be used in PKG_OPTIONS_VAR.")
                Explain3(
@@ -846,7 +847,7 @@ func (cv *VartypeCheck) SedCommands() {
                                                "",
                                                "This way, short sed commands cannot be hidden at the end of a line.")
                                }
-                               mkline.CheckVartypePrimitive(cv.Varname, CheckvarSedCommand, cv.Op, tokens[i], cv.MkComment, cv.Guessed)
+                               mkline.CheckVartypePrimitive(cv.Varname, BtSedCommand, cv.Op, tokens[i], cv.MkComment, cv.Guessed)
                        } else {
                                line.Error0("The -e option to sed requires an argument.")
                        }
@@ -888,10 +889,6 @@ func (cv *VartypeCheck) Stage() {
        }
 }
 
-func (cv *VartypeCheck) String() {
-       // No further checks possible.
-}
-
 func (cv *VartypeCheck) Tool() {
        if cv.Varname == "TOOLS_NOOP" && cv.Op == opAssignAppend {
                // no warning for package-defined tool definitions
@@ -910,8 +907,8 @@ func (cv *VartypeCheck) Tool() {
        }
 }
 
-func (cv *VartypeCheck) Unchecked() {
-       // Do nothing, as the name says.
+func (cv *VartypeCheck) Unknown() {
+       // Do nothing.
 }
 
 func (cv *VartypeCheck) URL() {
@@ -994,7 +991,7 @@ func (cv *VartypeCheck) WrapperTransform
 }
 
 func (cv *VartypeCheck) WrkdirSubdirectory() {
-       cv.MkLine.CheckVartypePrimitive(cv.Varname, CheckvarPathname, cv.Op, cv.Value, cv.MkComment, cv.Guessed)
+       cv.MkLine.CheckVartypePrimitive(cv.Varname, BtPathname, cv.Op, cv.Value, cv.MkComment, cv.Guessed)
 }
 
 // A directory relative to ${WRKSRC}, for use in CONFIGURE_DIRS and similar variables.

Added files:

Index: pkgsrc/pkgtools/pkglint/files/license.y
diff -u /dev/null pkgsrc/pkgtools/pkglint/files/license.y:1.1
--- /dev/null   Sun Jul 10 21:24:47 2016
+++ pkgsrc/pkgtools/pkglint/files/license.y     Sun Jul 10 21:24:47 2016
@@ -0,0 +1,35 @@
+%{
+package main
+%}
+
+%token <Node> ltNAME
+%token ltAND ltOR ltOPEN ltCLOSE
+
+%union {
+       Node *LicenseCondition
+}
+
+%type <Node> start list condition
+
+%%
+
+start : list {
+       liyylex.(*licenseLexer).result = $$
+}
+
+list : condition {
+       $$ = $1
+}
+list : list ltAND condition {
+       $$.And = append($$.And, $3)
+}
+list : list ltOR condition {
+       $$.Or = append($$.Or, $3)
+}
+
+condition : ltNAME {
+       $$ = $1
+}
+condition : ltOPEN list ltCLOSE {
+       $$ = &LicenseCondition{Main: $2}
+}
Index: pkgsrc/pkgtools/pkglint/files/mkshtypes_test.go
diff -u /dev/null pkgsrc/pkgtools/pkglint/files/mkshtypes_test.go:1.1
--- /dev/null   Sun Jul 10 21:24:47 2016
+++ pkgsrc/pkgtools/pkglint/files/mkshtypes_test.go     Sun Jul 10 21:24:47 2016
@@ -0,0 +1,5 @@
+package main
+
+func (list *MkShList) AddSemicolon() *MkShList  { return list.AddSeparator(sepSemicolon) }
+func (list *MkShList) AddBackground() *MkShList { return list.AddSeparator(sepBackground) }
+func (list *MkShList) AddNewline() *MkShList    { return list.AddSeparator(sepNewline) }



Home | Main Index | Thread Index | Old Index