[BACK]Return to mkvarusechecker.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/mkvarusechecker.go between version 1.2 and 1.3

version 1.2, 2019/12/08 22:03:38 version 1.3, 2019/12/09 20:38:16
Line 25  func (ck *MkVarUseChecker) Check(vuc *Va
Line 25  func (ck *MkVarUseChecker) Check(vuc *Va
         ck.checkUndefined()          ck.checkUndefined()
         ck.checkPermissions(vuc)          ck.checkPermissions(vuc)
   
         ck.checkVarname()          ck.checkVarname(vuc.time)
         ck.checkModifiers()          ck.checkModifiers()
         ck.checkQuoting(vuc)          ck.checkQuoting(vuc)
   
Line 130  func (ck *MkVarUseChecker) checkModifier
Line 130  func (ck *MkVarUseChecker) checkModifier
         fix.Apply()          fix.Apply()
 }  }
   
 func (ck *MkVarUseChecker) checkVarname() {  func (ck *MkVarUseChecker) checkVarname(time VucTime) {
         varname := ck.use.varname          varname := ck.use.varname
         if varname == "@" {          if varname == "@" {
                 ck.MkLine.Warnf("Please use %q instead of %q.", "${.TARGET}", "$@")                  ck.MkLine.Warnf("Please use %q instead of %q.", "${.TARGET}", "$@")
Line 139  func (ck *MkVarUseChecker) checkVarname(
Line 139  func (ck *MkVarUseChecker) checkVarname(
                         "of the same name.")                          "of the same name.")
         }          }
   
         if varname == "LOCALBASE" && !G.Infrastructure {          if varname == "LOCALBASE" && !G.Infrastructure && time == VucRunTime {
                 fix := ck.MkLine.Autofix()                  fix := ck.MkLine.Autofix()
                 fix.Warnf("Please use PREFIX instead of LOCALBASE.")                  fix.Warnf("Please use PREFIX instead of LOCALBASE.")
                 fix.ReplaceRegex(`\$\{LOCALBASE\b`, "${PREFIX", 1)                  fix.ReplaceRegex(`\$\{LOCALBASE\b`, "${PREFIX", 1)
Line 380  func (ck *MkVarUseChecker) checkUseAtLoa
Line 380  func (ck *MkVarUseChecker) checkUseAtLoa
                 return                  return
         }          }
   
         if ck.vartype.IsPackageSettable() &&          if ck.vartype.IsPackageSettable() {
                 basename != "Makefile" && basename != "options.mk" {                  // For package-settable variables, the explanation below
                   // doesn't make sense since including bsd.prefs.mk won't
                 // For package-settable variables, the explanation doesn't                  // define any package-settable variables.
                 // make sense since it talks about completely different  
                 // types of variables.  
                 return                  return
         }          }
   

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

CVSweb <webmaster@jp.NetBSD.org>