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 Jan  7 17:08:15 UTC 2018

Modified Files:
        pkgsrc/pkgtools/pkglint: Makefile
        pkgsrc/pkgtools/pkglint/files: buildlink3_test.go distinfo.go mkline.go
            mkline_test.go mklinechecker.go mklines.go mkparser.go
            mkparser_test.go patches.go patches_test.go plist.go plist_test.go
            vardefs.go

Log Message:
Updated pkglint to 5.4.26.

Changes since 5.4.25:

* When autofixing a patch, fix the corresponding distinfo file as well.

* Properly parse ${VARNAME:[\#]};
  the # was interpreted as a comment before.

* Don't add unnecessary :Q to PKG_OPTIONS and related variables.

* Don't warn about missing manual pages. While Debian and other
  distributions do this work, pkgsrc keeps the packages as original as
  possible.

* Autofix redundant ".gz" for manual pages in PLISTs.


To generate a diff of this commit:
cvs rdiff -u -r1.522 -r1.523 pkgsrc/pkgtools/pkglint/Makefile
cvs rdiff -u -r1.8 -r1.9 pkgsrc/pkgtools/pkglint/files/buildlink3_test.go
cvs rdiff -u -r1.15 -r1.16 pkgsrc/pkgtools/pkglint/files/distinfo.go \
    pkgsrc/pkgtools/pkglint/files/mklines.go
cvs rdiff -u -r1.23 -r1.24 pkgsrc/pkgtools/pkglint/files/mkline.go
cvs rdiff -u -r1.26 -r1.27 pkgsrc/pkgtools/pkglint/files/mkline_test.go
cvs rdiff -u -r1.5 -r1.6 pkgsrc/pkgtools/pkglint/files/mklinechecker.go \
    pkgsrc/pkgtools/pkglint/files/mkparser_test.go
cvs rdiff -u -r1.10 -r1.11 pkgsrc/pkgtools/pkglint/files/mkparser.go
cvs rdiff -u -r1.16 -r1.17 pkgsrc/pkgtools/pkglint/files/patches.go \
    pkgsrc/pkgtools/pkglint/files/plist_test.go
cvs rdiff -u -r1.11 -r1.12 pkgsrc/pkgtools/pkglint/files/patches_test.go
cvs rdiff -u -r1.17 -r1.18 pkgsrc/pkgtools/pkglint/files/plist.go
cvs rdiff -u -r1.33 -r1.34 pkgsrc/pkgtools/pkglint/files/vardefs.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.522 pkgsrc/pkgtools/pkglint/Makefile:1.523
--- pkgsrc/pkgtools/pkglint/Makefile:1.522      Sun Jan  7 01:13:21 2018
+++ pkgsrc/pkgtools/pkglint/Makefile    Sun Jan  7 17:08:15 2018
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.522 2018/01/07 01:13:21 rillig Exp $
+# $NetBSD: Makefile,v 1.523 2018/01/07 17:08:15 rillig Exp $
 
-PKGNAME=       pkglint-5.4.25
+PKGNAME=       pkglint-5.4.26
 DISTFILES=     # none
 CATEGORIES=    pkgtools
 

Index: pkgsrc/pkgtools/pkglint/files/buildlink3_test.go
diff -u pkgsrc/pkgtools/pkglint/files/buildlink3_test.go:1.8 pkgsrc/pkgtools/pkglint/files/buildlink3_test.go:1.9
--- pkgsrc/pkgtools/pkglint/files/buildlink3_test.go:1.8        Sun Jan 29 14:27:48 2017
+++ pkgsrc/pkgtools/pkglint/files/buildlink3_test.go    Sun Jan  7 17:08:15 2018
@@ -295,3 +295,42 @@ func (s *Suite) Test_ChecklinesBuildlink
                "WARN: buildlink3.mk:3: Please replace \"${LICENSE}\" with a simple string (also in other variables in this file).",
                "WARN: buildlink3.mk:13: This line should contain the following text: BUILDLINK_TREE+=\t-${LICENSE}-wxWidgets")
 }
+
+// Those .include lines that are not indented at all may stay as-is.
+// This special exception might have been for backwards-compatibility,
+// but ideally should be handled like everywhere else.
+// See MkLineChecker.checkInclude.
+func (s *Suite) Test_ChecklinesBuildlink3Mk_indentation(c *check.C) {
+       s.Init(c)
+       s.UseCommandLine("-Wall")
+       G.globalData.InitVartypes()
+       mklines := s.NewMkLines("buildlink3.mk",
+               mkrcsid,
+               "",
+               ".if ${VAAPI_AVAILABLE} == \"yes\"",
+               "",
+               "BUILDLINK_TREE+=       libva",
+               "",
+               ".  if !defined(LIBVA_BUILDLINK3_MK)",
+               "LIBVA_BUILDLINK3_MK:=",
+               "",
+               "BUILDLINK_API_DEPENDS.libva+=  libva>=1.0.6",
+               "BUILDLINK_PKGSRCDIR.libva?=    ../../multimedia/libva",
+               "",
+               ".include \"../../x11/libX11/buildlink3.mk\"",
+               "",
+               ".  endif       # LIBVA_BUILDLINK3_MK",
+               "",
+               "BUILDLINK_TREE+=       -libva",
+               "",
+               ".endif # VAAPI_AVAILABLE")
+
+       ChecklinesBuildlink3Mk(mklines)
+
+       // No warning about the indentation of the .include lines.
+       s.CheckOutputLines(
+               "ERROR: buildlink3.mk:11: \"/multimedia/libva\" does not exist.",
+               "ERROR: buildlink3.mk:11: There is no package in \"multimedia/libva\".",
+               "ERROR: buildlink3.mk:13: \"/x11/libX11/buildlink3.mk\" does not exist.",
+               "WARN: buildlink3.mk:3: Expected a BUILDLINK_TREE line.")
+}

Index: pkgsrc/pkgtools/pkglint/files/distinfo.go
diff -u pkgsrc/pkgtools/pkglint/files/distinfo.go:1.15 pkgsrc/pkgtools/pkglint/files/distinfo.go:1.16
--- pkgsrc/pkgtools/pkglint/files/distinfo.go:1.15      Mon Jan  1 18:04:15 2018
+++ pkgsrc/pkgtools/pkglint/files/distinfo.go   Sun Jan  7 17:08:15 2018
@@ -106,11 +106,10 @@ func (ck *distinfoLinesChecker) onFilena
        ck.algorithms = nil
 }
 
-func (ck *distinfoLinesChecker) checkPatchSha1(line Line, patchFname, distinfoSha1Hex string) {
-       patchBytes, err := ioutil.ReadFile(G.CurrentDir + "/" + patchFname)
+func computePatchSha1Hex(patchFilename string) (string, error) {
+       patchBytes, err := ioutil.ReadFile(patchFilename)
        if err != nil {
-               line.Errorf("%s does not exist.", patchFname)
-               return
+               return "", err
        }
 
        h := sha1.New()
@@ -120,7 +119,15 @@ func (ck *distinfoLinesChecker) checkPat
                        h.Write(patchLine)
                }
        }
-       fileSha1Hex := fmt.Sprintf("%x", h.Sum(nil))
+       return fmt.Sprintf("%x", h.Sum(nil)), nil
+}
+
+func (ck *distinfoLinesChecker) checkPatchSha1(line Line, patchFname, distinfoSha1Hex string) {
+       fileSha1Hex, err := computePatchSha1Hex(G.CurrentDir + "/" + patchFname)
+       if err != nil {
+               line.Errorf("%s does not exist.", patchFname)
+               return
+       }
        if distinfoSha1Hex != fileSha1Hex {
                if !line.AutofixReplace(distinfoSha1Hex, fileSha1Hex) {
                        line.Errorf("%s hash of %s differs (distinfo has %s, patch file has %s). Run \"%s makepatchsum\".", "SHA1", patchFname, distinfoSha1Hex, fileSha1Hex, confMake)
@@ -171,3 +178,13 @@ func (ck *distinfoLinesChecker) checkUnc
                ck.patches[patchName] = true
        }
 }
+
+func AutofixDistinfo(oldSha1, newSha1 string) {
+       distinfoFilename := G.CurrentDir + "/" + G.Pkg.DistinfoFile
+       if lines, err := readLines(distinfoFilename, false); err == nil {
+               for _, line := range lines {
+                       line.AutofixReplace(oldSha1, newSha1)
+               }
+               SaveAutofixChanges(lines)
+       }
+}
Index: pkgsrc/pkgtools/pkglint/files/mklines.go
diff -u pkgsrc/pkgtools/pkglint/files/mklines.go:1.15 pkgsrc/pkgtools/pkglint/files/mklines.go:1.16
--- pkgsrc/pkgtools/pkglint/files/mklines.go:1.15       Mon Jan  1 18:04:15 2018
+++ pkgsrc/pkgtools/pkglint/files/mklines.go    Sun Jan  7 17:08:15 2018
@@ -130,7 +130,7 @@ func (mklines *MkLines) Check() {
                        }
 
                case mkline.IsCond():
-                       ck.checkCond(mklines.forVars)
+                       ck.checkCond(mklines.forVars, indentation)
 
                case mkline.IsDependency():
                        ck.checkDependencyRule(allowedTargets)

Index: pkgsrc/pkgtools/pkglint/files/mkline.go
diff -u pkgsrc/pkgtools/pkglint/files/mkline.go:1.23 pkgsrc/pkgtools/pkglint/files/mkline.go:1.24
--- pkgsrc/pkgtools/pkglint/files/mkline.go:1.23        Mon Jan  1 18:04:15 2018
+++ pkgsrc/pkgtools/pkglint/files/mkline.go     Sun Jan  7 17:08:15 2018
@@ -102,12 +102,13 @@ func NewMkLine(line Line) (mkline *MkLin
                return
        }
 
-       if index := strings.IndexByte(text, '#'); index != -1 && strings.TrimSpace(text[:index]) == "" {
+       trimmedText := strings.TrimSpace(text)
+       if strings.HasPrefix(trimmedText, "#") {
                mkline.data = mkLineComment{}
                return
        }
 
-       if strings.TrimSpace(text) == "" {
+       if trimmedText == "" {
                mkline.data = mkLineEmpty{}
                return
        }
@@ -312,7 +313,7 @@ func matchMkCond(text string) (m bool, i
        }
 
        argsStart := i
-       for i < n && text[i] != '#' {
+       for i < n && (text[i] != '#' || text[i-1] == '\\') {
                i++
        }
        for i > argsStart && (text[i-1] == ' ' || text[i-1] == '\t') {
@@ -322,7 +323,7 @@ func matchMkCond(text string) (m bool, i
 
        m = true
        indent = text[indentStart:indentEnd]
-       args = text[argsStart:argsEnd]
+       args = strings.Replace(text[argsStart:argsEnd], "\\#", "#", -1)
        return
 }
 

Index: pkgsrc/pkgtools/pkglint/files/mkline_test.go
diff -u pkgsrc/pkgtools/pkglint/files/mkline_test.go:1.26 pkgsrc/pkgtools/pkglint/files/mkline_test.go:1.27
--- pkgsrc/pkgtools/pkglint/files/mkline_test.go:1.26   Sun Jan  7 01:13:21 2018
+++ pkgsrc/pkgtools/pkglint/files/mkline_test.go        Sun Jan  7 17:08:15 2018
@@ -133,7 +133,7 @@ func (s *Suite) Test_NewMkLine(c *check.
                "\tshell command # shell comment",
                "# whole line comment",
                "",
-               ".  if !empty(PKGNAME:M*-*) # cond comment",
+               ".  if !empty(PKGNAME:M*-*) && ${RUBY_RAILS_SUPPORTED:[\\#]} == 1 # cond comment",
                ".    include \"../../mk/bsd.prefs.mk\" # include comment",
                ".    include <subdir.mk> # sysinclude comment",
                "target1 target2: source1 source2",
@@ -159,7 +159,7 @@ func (s *Suite) Test_NewMkLine(c *check.
        c.Check(ln[4].IsCond(), equals, true)
        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].Args(), equals, "!empty(PKGNAME:M*-*) && ${RUBY_RAILS_SUPPORTED:[#]} == 1")
 
        c.Check(ln[5].IsInclude(), equals, true)
        c.Check(ln[5].Indent(), equals, "    ")
@@ -480,6 +480,25 @@ func (s *Suite) Test_MkLine_variableNeed
                "WARN: x11/mlterm/Makefile:2: Please move ${LDFLAGS:M*:Q} outside of any quoting characters.")
 }
 
+// No quoting is necessary here.
+// PKG_OPTIONS are declared as "lkShell" although they are processed
+// using make's .for loop, which splits them at whitespace and usually
+// requires the variable to be declared as "lkSpace".
+// In this case it doesn't matter though since each option is an identifier,
+// and these do not pose any quoting problems.
+func (s *Suite) Test_MkLine_variableNeedsQuoting__package_options(c *check.C) {
+       s.Init(c)
+       s.UseCommandLine("-Wall")
+       G.globalData.InitVartypes()
+       G.Mk = s.NewMkLines("Makefile",
+               mkrcsid,
+               "PKG_SUGGESTED_OPTIONS+=\t${PKG_DEFAULT_OPTIONS:Mcdecimal} ${PKG_OPTIONS.py-trytond:Mcdecimal}")
+
+       MkLineChecker{G.Mk.mklines[1]}.Check()
+
+       s.CheckOutputEmpty()
+}
+
 func (s *Suite) Test_MkLines_Check__MASTER_SITE_in_HOMEPAGE(c *check.C) {
        s.Init(c)
        s.UseCommandLine("-Wall")

Index: pkgsrc/pkgtools/pkglint/files/mklinechecker.go
diff -u pkgsrc/pkgtools/pkglint/files/mklinechecker.go:1.5 pkgsrc/pkgtools/pkglint/files/mklinechecker.go:1.6
--- pkgsrc/pkgtools/pkglint/files/mklinechecker.go:1.5  Sun Jan  7 01:13:21 2018
+++ pkgsrc/pkgtools/pkglint/files/mklinechecker.go      Sun Jan  7 17:08:15 2018
@@ -92,12 +92,11 @@ func (ck MkLineChecker) checkInclude() {
        }
 }
 
-func (ck MkLineChecker) checkCond(forVars map[string]bool) {
+func (ck MkLineChecker) checkCond(forVars map[string]bool, indentation *Indentation) {
        mkline := ck.MkLine
 
        directive := mkline.Directive()
        args := mkline.Args()
-       indentation := &G.Mk.indentation
 
        switch directive {
        case "endif", "endfor":
Index: pkgsrc/pkgtools/pkglint/files/mkparser_test.go
diff -u pkgsrc/pkgtools/pkglint/files/mkparser_test.go:1.5 pkgsrc/pkgtools/pkglint/files/mkparser_test.go:1.6
--- pkgsrc/pkgtools/pkglint/files/mkparser_test.go:1.5  Sun Jan 29 14:27:48 2017
+++ pkgsrc/pkgtools/pkglint/files/mkparser_test.go      Sun Jan  7 17:08:15 2018
@@ -13,6 +13,7 @@ func (s *Suite) Test_MkParser_MkTokens(c
                for i, expectedToken := range expectedTokens {
                        if i < len(actualTokens) {
                                c.Check(*actualTokens[i], deepEquals, *expectedToken)
+                               c.Check(actualTokens[i].Varuse, deepEquals, expectedToken.Varuse)
                        }
                }
                c.Check(p.Rest(), equals, expectedRest)
@@ -80,6 +81,7 @@ func (s *Suite) Test_MkParser_MkTokens(c
        check("${ALT_GCC_RTS:S%${LOCALBASE}%%:S%/%%}", varuse("ALT_GCC_RTS", "S%${LOCALBASE}%%", "S%/%%"))
        check("${PREFIX:C;///*;/;g:C;/$;;}", varuse("PREFIX", "C;///*;/;g", "C;/$;;"))
        check("${GZIP_CMD:[1]:Q}", varuse("GZIP_CMD", "[1]", "Q"))
+       check("${RUBY_RAILS_SUPPORTED:[#]}", varuse("RUBY_RAILS_SUPPORTED", "[#]"))
        check("${DISTNAME:C/-[0-9]+$$//:C/_/-/}", varuse("DISTNAME", "C/-[0-9]+$$//", "C/_/-/"))
        check("${DISTNAME:slang%=slang2%}", varuse("DISTNAME", "slang%=slang2%"))
        check("${OSMAP_SUBSTVARS:@v@-e 's,\\@${v}\\@,${${v}},g' @}", varuse("OSMAP_SUBSTVARS", "@v@-e 's,\\@${v}\\@,${${v}},g' @"))

Index: pkgsrc/pkgtools/pkglint/files/mkparser.go
diff -u pkgsrc/pkgtools/pkglint/files/mkparser.go:1.10 pkgsrc/pkgtools/pkglint/files/mkparser.go:1.11
--- pkgsrc/pkgtools/pkglint/files/mkparser.go:1.10      Mon Jan  1 18:04:15 2018
+++ pkgsrc/pkgtools/pkglint/files/mkparser.go   Sun Jan  7 17:08:15 2018
@@ -171,7 +171,7 @@ func (p *MkParser) VarUseModifiers(varna
                        }
 
                case '[':
-                       if repl.AdvanceRegexp(`^\[[-.\d]+\]`) {
+                       if repl.AdvanceRegexp(`^\[(?:[-.\d]+|#)\]`) {
                                modifiers = append(modifiers, repl.Since(modifierMark))
                                continue
                        }

Index: pkgsrc/pkgtools/pkglint/files/patches.go
diff -u pkgsrc/pkgtools/pkglint/files/patches.go:1.16 pkgsrc/pkgtools/pkglint/files/patches.go:1.17
--- pkgsrc/pkgtools/pkglint/files/patches.go:1.16       Mon Jan  1 18:04:15 2018
+++ pkgsrc/pkgtools/pkglint/files/patches.go    Sun Jan  7 17:08:15 2018
@@ -90,7 +90,13 @@ func (ck *PatchChecker) Check() {
        }
 
        ChecklinesTrailingEmptyLines(ck.lines)
-       SaveAutofixChanges(ck.lines)
+       sha1Before, err := computePatchSha1Hex(ck.lines[0].Filename)
+       if SaveAutofixChanges(ck.lines) && G.Pkg != nil && err == nil {
+               sha1After, err := computePatchSha1Hex(ck.lines[0].Filename)
+               if err == nil {
+                       AutofixDistinfo(sha1Before, sha1After)
+               }
+       }
 }
 
 // See http://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html
Index: pkgsrc/pkgtools/pkglint/files/plist_test.go
diff -u pkgsrc/pkgtools/pkglint/files/plist_test.go:1.16 pkgsrc/pkgtools/pkglint/files/plist_test.go:1.17
--- pkgsrc/pkgtools/pkglint/files/plist_test.go:1.16    Sun Jan  7 01:13:21 2018
+++ pkgsrc/pkgtools/pkglint/files/plist_test.go Sun Jan  7 17:08:15 2018
@@ -33,7 +33,6 @@ func (s *Suite) Test_ChecklinesPlist(c *
        s.CheckOutputLines(
                "ERROR: PLIST:1: Expected \"@comment $"+"NetBSD$\".",
                "WARN: PLIST:1: The bin/ directory should not have subdirectories.",
-               "WARN: PLIST:2: Manual page missing for bin/program.",
                "ERROR: PLIST:3: Configuration files must not be registered in the PLIST. Please use the CONF_FILES framework, which is described in mk/pkginstall/bsd.pkginstall.mk.",
                "ERROR: PLIST:4: RCD_SCRIPTS must not be registered in the PLIST. Please use the RCD_SCRIPTS framework.",
                "ERROR: PLIST:6: \"info/dir\" must not be listed. Use install-info to add/remove an entry.",
@@ -44,7 +43,6 @@ func (s *Suite) Test_ChecklinesPlist(c *
                "WARN: PLIST:10: Preformatted manual pages should end in \".0\".",
                "WARN: PLIST:11: IMAKE_MANNEWSUFFIX is not meant to appear in PLISTs.",
                "WARN: PLIST:12: Please remove this line. It is no longer necessary.",
-               "WARN: PLIST:13: Manual page missing for sbin/clockctl.",
                "ERROR: PLIST:14: The package Makefile must include \"../../graphics/gnome-icon-theme/buildlink3.mk\".",
                "WARN: PLIST:14: Packages that install icon theme files should set ICON_THEMES.",
                "ERROR: PLIST:15: Packages that install hicolor icons must include \"../../graphics/hicolor-icon-theme/buildlink3.mk\" in the Makefile.",

Index: pkgsrc/pkgtools/pkglint/files/patches_test.go
diff -u pkgsrc/pkgtools/pkglint/files/patches_test.go:1.11 pkgsrc/pkgtools/pkglint/files/patches_test.go:1.12
--- pkgsrc/pkgtools/pkglint/files/patches_test.go:1.11  Mon Jan  1 18:04:15 2018
+++ pkgsrc/pkgtools/pkglint/files/patches_test.go       Sun Jan  7 17:08:15 2018
@@ -27,11 +27,9 @@ func (s *Suite) Test_ChecklinesPatch__wi
        s.CheckOutputEmpty()
 }
 
-func (s *Suite) Test_ChecklinesPatch__without_empty_line(c *check.C) {
+func (s *Suite) Test_ChecklinesPatch__without_empty_line__autofix(c *check.C) {
        s.Init(c)
-       fname := s.CreateTmpFile("patch-WithoutEmptyLines", "dummy")
-       s.UseCommandLine("-Wall", "--autofix")
-       lines := s.NewLines(fname,
+       patchFilename := s.CreateTmpFileLines("patch-WithoutEmptyLines",
                "$"+"NetBSD$",
                "Text",
                "--- file.orig",
@@ -41,15 +39,27 @@ func (s *Suite) Test_ChecklinesPatch__wi
                "-old line",
                "+old line",
                " context after")
+       distinfoFilename := s.CreateTmpFileLines("distinfo",
+               "$"+"NetBSD$",
+               "",
+               "SHA1 (some patch) = 87ffcaaa0b0677ec679fff612b44df1af05f04df") // Taken from breakpoint at AutofixDistinfo
+
+       s.UseCommandLine("-Wall", "--autofix")
+       lines := LoadExistingLines(patchFilename, false)
+       G.CurrentDir = s.TmpDir()
+       G.Pkg = &Package{DistinfoFile: "distinfo"}
 
        ChecklinesPatch(lines)
 
        s.CheckOutputLines(
                "AUTOFIX: ~/patch-WithoutEmptyLines:2: Inserting a line \"\" before this line.",
                "AUTOFIX: ~/patch-WithoutEmptyLines:3: Inserting a line \"\" before this line.",
-               "AUTOFIX: ~/patch-WithoutEmptyLines: Has been auto-fixed. Please re-run pkglint.")
+               "AUTOFIX: ~/patch-WithoutEmptyLines: Has been auto-fixed. Please re-run pkglint.",
+               "AUTOFIX: ~/distinfo:3: Replacing \"87ffcaaa0b0677ec679fff612b44df1af05f04df\" "+
+                       "with \"a7c35294b3853da0acedf8a972cb266baa9582a3\".",
+               "AUTOFIX: ~/distinfo: Has been auto-fixed. Please re-run pkglint.")
 
-       fixed, err := ioutil.ReadFile(fname)
+       fixed, err := ioutil.ReadFile(patchFilename)
        c.Assert(err, check.IsNil)
        c.Check(string(fixed), equals, ""+
                "$"+"NetBSD$\n"+
@@ -63,6 +73,12 @@ func (s *Suite) Test_ChecklinesPatch__wi
                "-old line\n"+
                "+old line\n"+
                " context after\n")
+       fixedDistinfo, err := ioutil.ReadFile(distinfoFilename)
+       c.Assert(err, check.IsNil)
+       c.Check(string(fixedDistinfo), equals, ""+
+               "$"+"NetBSD$\n"+
+               "\n"+
+               "SHA1 (some patch) = a7c35294b3853da0acedf8a972cb266baa9582a3\n")
 }
 
 func (s *Suite) Test_ChecklinesPatch__without_comment(c *check.C) {

Index: pkgsrc/pkgtools/pkglint/files/plist.go
diff -u pkgsrc/pkgtools/pkglint/files/plist.go:1.17 pkgsrc/pkgtools/pkglint/files/plist.go:1.18
--- pkgsrc/pkgtools/pkglint/files/plist.go:1.17 Sun Jan  7 01:13:21 2018
+++ pkgsrc/pkgtools/pkglint/files/plist.go      Sun Jan  7 17:08:15 2018
@@ -175,8 +175,6 @@ func (ck *PlistChecker) checkpath(pline 
                ck.checkpathLib(pline, dirname, basename)
        case "man":
                ck.checkpathMan(pline)
-       case "sbin":
-               ck.checkpathSbin(pline)
        case "share":
                ck.checkpathShare(pline)
        }
@@ -226,19 +224,6 @@ func (ck *PlistChecker) checkpathBin(pli
                pline.line.Warnf("The bin/ directory should not have subdirectories.")
                return
        }
-
-       if G.opts.WarnExtra &&
-               ck.allFiles["man/man1/"+basename+".1"] == nil &&
-               ck.allFiles["man/man6/"+basename+".6"] == nil &&
-               ck.allFiles["${IMAKE_MAN_DIR}/"+basename+".${IMAKE_MANNEWSUFFIX}"] == nil {
-               pline.line.Warnf("Manual page missing for bin/%s.", basename)
-               Explain(
-                       "All programs that can be run directly by the user should have a",
-                       "manual page for quick reference.  The programs in the bin/ directory",
-                       "should have corresponding manual pages in section 1 (filename",
-                       "program.1), while the programs in the sbin/ directory have their",
-                       "manual pages in section 8.")
-       }
 }
 
 func (ck *PlistChecker) checkpathEtc(pline *PlistLine, dirname, basename string) {
@@ -324,7 +309,7 @@ func (ck *PlistChecker) checkpathMan(pli
                }
        }
 
-       if gz != "" {
+       if gz != "" && !line.AutofixReplaceRegexp(`\.gz$`, "") {
                line.Notef("The .gz extension is unnecessary for manual pages.")
                Explain(
                        "Whether the manual pages are installed in compressed form or not is",
@@ -334,20 +319,6 @@ func (ck *PlistChecker) checkpathMan(pli
        }
 }
 
-func (ck *PlistChecker) checkpathSbin(pline *PlistLine) {
-       binname := pline.text[5:]
-
-       if ck.allFiles["man/man8/"+binname+".8"] == nil && G.opts.WarnExtra {
-               pline.line.Warnf("Manual page missing for sbin/%s.", binname)
-               Explain(
-                       "All programs that can be run directly by the user should have a",
-                       "manual page for quick reference.  The programs in the sbin/",
-                       "directory should have corresponding manual pages in section 8",
-                       "(filename program.8), while the programs in the bin/ directory",
-                       "have their manual pages in section 1.")
-       }
-}
-
 func (ck *PlistChecker) checkpathShare(pline *PlistLine) {
        line, text := pline.line, pline.text
        switch {

Index: pkgsrc/pkgtools/pkglint/files/vardefs.go
diff -u pkgsrc/pkgtools/pkglint/files/vardefs.go:1.33 pkgsrc/pkgtools/pkglint/files/vardefs.go:1.34
--- pkgsrc/pkgtools/pkglint/files/vardefs.go:1.33       Tue Jan  2 08:13:16 2018
+++ pkgsrc/pkgtools/pkglint/files/vardefs.go    Sun Jan  7 17:08:15 2018
@@ -807,16 +807,16 @@ func (gd *GlobalData) InitVartypes() {
        usr("PKG_JVM_DEFAULT", lkNone, jvms)
        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", lkShell, BtOption, "bsd.options.mk: set; *: use-loadtime, use")
+       usr("PKG_OPTIONS.*", lkShell, 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_GROUP.*", lkShell, BtOption, "Makefile, options.mk: set, append")
+       acl("PKG_OPTIONS_LEGACY_OPTS", lkShell, BtUnknown, "Makefile, Makefile.common, options.mk: append")
+       acl("PKG_OPTIONS_LEGACY_VARS", lkShell, BtUnknown, "Makefile, Makefile.common, options.mk: append")
+       acl("PKG_OPTIONS_NONEMPTY_SETS", lkShell, BtIdentifier, "")
+       acl("PKG_OPTIONS_OPTIONAL_GROUPS", lkShell, BtIdentifier, "options.mk: set, append")
+       acl("PKG_OPTIONS_REQUIRED_GROUPS", lkShell, BtIdentifier, "Makefile, options.mk: set")
+       acl("PKG_OPTIONS_SET.*", lkShell, 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")



Home | Main Index | Thread Index | Old Index