[BACK]Return to buildlink3.go CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / pkgtools / pkglint / files

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

Diff for /pkgsrc/pkgtools/pkglint/files/Attic/buildlink3.go between version 1.9 and 1.10

version 1.9, 2017/01/17 22:37:27 version 1.10, 2017/01/29 14:27:48
Line 1 
Line 1 
 package main  package main
   
 import (  import (
           "netbsd.org/pkglint/line"
         "netbsd.org/pkglint/pkgver"          "netbsd.org/pkglint/pkgver"
           "netbsd.org/pkglint/textproc"
         "netbsd.org/pkglint/trace"          "netbsd.org/pkglint/trace"
         "strings"          "strings"
 )  )
Line 13  func ChecklinesBuildlink3Mk(mklines *MkL
Line 15  func ChecklinesBuildlink3Mk(mklines *MkL
   
         mklines.Check()          mklines.Check()
   
         exp := NewExpecter(mklines.lines)          exp := textproc.NewExpecter(mklines.lines)
   
         for exp.AdvanceIfPrefix("#") {          for exp.AdvanceIfPrefix("#") {
                 line := exp.PreviousLine()                  line := exp.PreviousLine()
Line 23  func ChecklinesBuildlink3Mk(mklines *MkL
Line 25  func ChecklinesBuildlink3Mk(mklines *MkL
                 }                  }
         }          }
   
         exp.ExpectEmptyLine()          exp.ExpectEmptyLine(G.opts.WarnSpace)
   
         if exp.AdvanceIfMatches(`^BUILDLINK_DEPMETHOD\.(\S+)\?=.*$`) {          if exp.AdvanceIfMatches(`^BUILDLINK_DEPMETHOD\.(\S+)\?=.*$`) {
                 exp.PreviousLine().Warnf("This line belongs inside the .ifdef block.")                  exp.PreviousLine().Warnf("This line belongs inside the .ifdef block.")
Line 32  func ChecklinesBuildlink3Mk(mklines *MkL
Line 34  func ChecklinesBuildlink3Mk(mklines *MkL
         }          }
   
         pkgbaseLine, pkgbase := exp.CurrentLine(), ""          pkgbaseLine, pkgbase := exp.CurrentLine(), ""
         var abiLine, apiLine Line          var abiLine, apiLine line.Line
         var abi, api *DependencyPattern          var abi, api *DependencyPattern
   
         // First paragraph: Introduction of the package identifier          // First paragraph: Introduction of the package identifier
Line 40  func ChecklinesBuildlink3Mk(mklines *MkL
Line 42  func ChecklinesBuildlink3Mk(mklines *MkL
                 exp.CurrentLine().Warnf("Expected a BUILDLINK_TREE line.")                  exp.CurrentLine().Warnf("Expected a BUILDLINK_TREE line.")
                 return                  return
         }          }
         pkgbase = exp.m[1]          pkgbase = exp.Group(1)
         if containsVarRef(pkgbase) {          if containsVarRef(pkgbase) {
                 warned := false                  warned := false
                 for _, pair := range [...]struct{ varuse, simple string }{                  for _, pair := range [...]struct{ varuse, simple string }{
Line 70  func ChecklinesBuildlink3Mk(mklines *MkL
Line 72  func ChecklinesBuildlink3Mk(mklines *MkL
                 }                  }
         }          }
   
         exp.ExpectEmptyLine()          exp.ExpectEmptyLine(G.opts.WarnSpace)
   
         // Second paragraph: multiple inclusion protection and introduction          // Second paragraph: multiple inclusion protection and introduction
         // of the uppercase package identifier.          // of the uppercase package identifier.
         if !exp.AdvanceIfMatches(`^\.if !defined\((\S+)_BUILDLINK3_MK\)$`) {          if !exp.AdvanceIfMatches(`^\.if !defined\((\S+)_BUILDLINK3_MK\)$`) {
                 return                  return
         }          }
         pkgupperLine, pkgupper := exp.PreviousLine(), exp.m[1]          pkgupperLine, pkgupper := exp.PreviousLine(), exp.Group(1)
   
         if !exp.ExpectText(pkgupper + "_BUILDLINK3_MK:=") {          if !exp.ExpectText(pkgupper + "_BUILDLINK3_MK:=") {
                 return                  return
         }          }
         exp.ExpectEmptyLine()          exp.ExpectEmptyLine(G.opts.WarnSpace)
   
         // See pkgtools/createbuildlink/files/createbuildlink, keyword PKGUPPER          // See pkgtools/createbuildlink/files/createbuildlink, keyword PKGUPPER
         ucPkgbase := strings.ToUpper(strings.Replace(pkgbase, "-", "_", -1))          ucPkgbase := strings.ToUpper(strings.Replace(pkgbase, "-", "_", -1))
Line 93  func ChecklinesBuildlink3Mk(mklines *MkL
Line 95  func ChecklinesBuildlink3Mk(mklines *MkL
         if G.Pkg != nil {          if G.Pkg != nil {
                 if mkbase := G.Pkg.EffectivePkgbase; mkbase != "" && mkbase != pkgbase {                  if mkbase := G.Pkg.EffectivePkgbase; mkbase != "" && mkbase != pkgbase {
                         pkgbaseLine.Errorf("Package name mismatch between %q in this file and %q from %s.",                          pkgbaseLine.Errorf("Package name mismatch between %q in this file and %q from %s.",
                                 pkgbase, mkbase, G.Pkg.EffectivePkgnameLine.Line.ReferenceFrom(pkgbaseLine))                                  pkgbase, mkbase, G.Pkg.EffectivePkgnameLine.ReferenceFrom(pkgbaseLine))
                 }                  }
         }          }
   
Line 106  func ChecklinesBuildlink3Mk(mklines *MkL
Line 108  func ChecklinesBuildlink3Mk(mklines *MkL
                 }                  }
   
                 line := exp.CurrentLine()                  line := exp.CurrentLine()
                 mkline := mklines.mklines[exp.index]                  mkline := mklines.mklines[exp.Index()]
   
                 if mkline.IsVarassign() {                  if mkline.IsVarassign() {
                         exp.Advance()                          exp.Advance()
Line 185  func ChecklinesBuildlink3Mk(mklines *MkL
Line 187  func ChecklinesBuildlink3Mk(mklines *MkL
         if apiLine == nil {          if apiLine == nil {
                 exp.CurrentLine().Warnf("Definition of BUILDLINK_API_DEPENDS is missing.")                  exp.CurrentLine().Warnf("Definition of BUILDLINK_API_DEPENDS is missing.")
         }          }
         exp.ExpectEmptyLine()          exp.ExpectEmptyLine(G.opts.WarnSpace)
   
         // Fourth paragraph: Cleanup, corresponding to the first paragraph.          // Fourth paragraph: Cleanup, corresponding to the first paragraph.
         if !exp.ExpectText("BUILDLINK_TREE+=\t-" + pkgbase) {          if !exp.ExpectText("BUILDLINK_TREE+=\t-" + pkgbase) {

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

CVSweb <webmaster@jp.NetBSD.org>