summaryrefslogtreecommitdiff
path: root/pkgtools/pkglint/files/shell.go
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2019-04-23 21:20:49 +0000
committerrillig <rillig@pkgsrc.org>2019-04-23 21:20:49 +0000
commitd50be1dc2fa3e4c99154eb15ac97ce7df736809a (patch)
tree329bba382e1a134908d85f039459d6bf34171c26 /pkgtools/pkglint/files/shell.go
parent7cb37d09249797022830e5044decac258c91699d (diff)
downloadpkgsrc-d50be1dc2fa3e4c99154eb15ac97ce7df736809a.tar.gz
pkgtools/pkglint: update to 5.7.6
Changes since 5.7.5: * The explanation for distfile hashes is only given when the distfiles actually need to be downloaded. If they are already there, no explanation is necessary. * Makefile lines that are commented and have line continuations are properly parsed. This affects the autofix for variable value realignment. * Variable permissions are not checked in hacks.mk since pkgsrc developers who know about hacks.mk probably know what they are doing. From hacks.mk files, builtin.mk files may be included directly, for the same reason. * Expressions of the form !empty(PKGPATH:Mpattern), when PKGPATH is not a list variable and pattern has no wildcards, can be written in a simpler form, and pkglint autofixes this. For example the above expression is transformed into ${PKGPATH} == pattern. This transformation reduces the amount of double negations (!empty) in the code. * Duplicate warnings about invalid relative ../package have been merged. * TOOLS_ALIASES are properly resolved. The line USE_TOOLS=ggrep makes the tools grep, egrep and fgrep known to pkglint, in the same way as in the pkgsrc infrastructure. * The diagnostics for missing or unnecessary distinfo files have been improved to provide some guidance. * Packages that use MESSAGE_SRC to build the message from multiple files no longer produce a warning for malformed message files. These files are simply skipped.
Diffstat (limited to 'pkgtools/pkglint/files/shell.go')
-rw-r--r--pkgtools/pkglint/files/shell.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/pkgtools/pkglint/files/shell.go b/pkgtools/pkglint/files/shell.go
index b7cb7a3d085..98e50c70c36 100644
--- a/pkgtools/pkglint/files/shell.go
+++ b/pkgtools/pkglint/files/shell.go
@@ -51,8 +51,7 @@ func (ck *ShellLineChecker) CheckWord(token string, checkQuoting bool, time Tool
// Delegate check for shell words consisting of a single variable use
// to the MkLineChecker. Examples for these are ${VAR:Mpattern} or $@.
- p := NewMkParser(nil, token, false)
- if varuse := p.VarUse(); varuse != nil && p.EOF() {
+ if varuse := ToVarUse(token); varuse != nil {
if ck.checkVarUse {
MkLineChecker{ck.MkLines, ck.mkline}.CheckVaruse(varuse, shellWordVuc)
}
@@ -541,8 +540,7 @@ func (scc *SimpleCommandChecker) handleCommandVariable() bool {
}
shellword := scc.strcmd.Name
- parser := NewMkParser(nil, shellword, false)
- if varuse := parser.VarUse(); varuse != nil && parser.EOF() {
+ if varuse := ToVarUse(shellword); varuse != nil {
varname := varuse.varname
if vartype := G.Pkgsrc.VariableType(scc.MkLines, varname); vartype != nil && vartype.basicType.name == "ShellCommand" {