summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2015-12-05 15:51:15 +0000
committerrillig <rillig@pkgsrc.org>2015-12-05 15:51:15 +0000
commit5b01355f749e4aaa41fb9c8ea3210e52d35b6606 (patch)
tree7dead000920b9fc49808647e933531d1e5bcfd27
parentb7d4b717c5b5ddb98109096a363cf456b0234136 (diff)
downloadpkgsrc-5b01355f749e4aaa41fb9c8ea3210e52d35b6606.tar.gz
Updated pkglint to 5.2.2.
Changes since 5.2.1: * Fixed wrong error messages about "Unknown Makefile line format"
-rw-r--r--pkgtools/pkglint/Makefile4
-rw-r--r--pkgtools/pkglint/files/line.go17
-rw-r--r--pkgtools/pkglint/files/mkline.go17
-rw-r--r--pkgtools/pkglint/files/patches.go2
-rw-r--r--pkgtools/pkglint/files/shell.go2
-rw-r--r--pkgtools/pkglint/files/vartypecheck.go4
6 files changed, 23 insertions, 23 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile
index c04fe41b2ac..f538003c414 100644
--- a/pkgtools/pkglint/Makefile
+++ b/pkgtools/pkglint/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.471 2015/12/05 15:16:29 rillig Exp $
+# $NetBSD: Makefile,v 1.472 2015/12/05 15:51:15 rillig Exp $
-PKGNAME= pkglint-5.2.1
+PKGNAME= pkglint-5.2.2
DISTFILES= # none
CATEGORIES= pkgtools
diff --git a/pkgtools/pkglint/files/line.go b/pkgtools/pkglint/files/line.go
index f54f53d5e6e..153277db4a9 100644
--- a/pkgtools/pkglint/files/line.go
+++ b/pkgtools/pkglint/files/line.go
@@ -144,3 +144,20 @@ func (ln *Line) noteAutofix(format string, args ...interface{}) {
}
G.autofixAvailable = true
}
+
+func (ln *Line) checkAbsolutePathname(text string) {
+ defer tracecall("Line.checkAbsolutePathname", text)()
+
+ // In the GNU coding standards, DESTDIR is defined as a (usually
+ // empty) prefix that can be used to install files to a different
+ // location from what they have been built for. Therefore
+ // everything following it is considered an absolute pathname.
+ //
+ // Another context where absolute pathnames usually appear is in
+ // assignments like "bindir=/bin".
+ if m, path := match1(text, `(?:^|\$[{(]DESTDIR[)}]|[\w_]+\s*=\s*)(/(?:[^"'\s]|"[^"*]"|'[^']*')*)`); m {
+ if matches(path, `^/\w`) {
+ checkwordAbsolutePathname(ln, path)
+ }
+ }
+}
diff --git a/pkgtools/pkglint/files/mkline.go b/pkgtools/pkglint/files/mkline.go
index e49bb35dc37..0812fa1ab8f 100644
--- a/pkgtools/pkglint/files/mkline.go
+++ b/pkgtools/pkglint/files/mkline.go
@@ -640,23 +640,6 @@ func (ml *MkLine) checkText(text string) {
}
}
-func (ml *MkLine) checkAbsolutePathname(text string) {
- defer tracecall("MkLine.checkAbsolutePathname", text)()
-
- // In the GNU coding standards, DESTDIR is defined as a (usually
- // empty) prefix that can be used to install files to a different
- // location from what they have been built for. Therefore
- // everything following it is considered an absolute pathname.
- //
- // Another context where absolute pathnames usually appear is in
- // assignments like "bindir=/bin".
- if m, path := match1(text, `(?:^|\$[{(]DESTDIR[)}]|[\w_]+\s*=\s*)(/(?:[^"'\s]|"[^"*]"|'[^']*')*)`); m {
- if matches(path, `^/\w`) {
- checkwordAbsolutePathname(ml.line, path)
- }
- }
-}
-
func (ml *MkLine) checkIf() {
defer tracecall("MkLine.checkIf")()
diff --git a/pkgtools/pkglint/files/patches.go b/pkgtools/pkglint/files/patches.go
index 98811531e14..12129b9578d 100644
--- a/pkgtools/pkglint/files/patches.go
+++ b/pkgtools/pkglint/files/patches.go
@@ -528,7 +528,7 @@ func (ctx *CheckPatchContext) checkAddedContents() {
shellwords, _ := splitIntoShellwords(line, addedText)
for _, shellword := range shellwords {
if !hasPrefix(shellword, "#") {
- NewMkLine(line).checkAbsolutePathname(shellword)
+ line.checkAbsolutePathname(shellword)
}
}
case ftSource:
diff --git a/pkgtools/pkglint/files/shell.go b/pkgtools/pkglint/files/shell.go
index 45bce010e21..ea1e9ad0a44 100644
--- a/pkgtools/pkglint/files/shell.go
+++ b/pkgtools/pkglint/files/shell.go
@@ -410,7 +410,7 @@ func (msline *MkShellLine) checklineMkShelltext(shelltext string) {
st.checkCommandStart()
st.checkConditionalCd()
if state != scstPaxS && state != scstSedE && state != scstCaseLabel {
- NewMkLine(line).checkAbsolutePathname(shellword)
+ line.checkAbsolutePathname(shellword)
}
st.checkAutoMkdirs()
st.checkInstallMulti()
diff --git a/pkgtools/pkglint/files/vartypecheck.go b/pkgtools/pkglint/files/vartypecheck.go
index 88b16d1111a..9b8d8078063 100644
--- a/pkgtools/pkglint/files/vartypecheck.go
+++ b/pkgtools/pkglint/files/vartypecheck.go
@@ -387,7 +387,7 @@ func (cv *VartypeCheck) Pathmask() {
if !matches(cv.valueNovar, `^[#\-0-9A-Za-z._~+%*?/\[\]]*`) {
cv.line.warnf("%q is not a valid pathname mask.", cv.value)
}
- NewMkLine(cv.line).checkAbsolutePathname(cv.value)
+ cv.line.checkAbsolutePathname(cv.value)
}
// Like Filename, but including slashes
@@ -396,7 +396,7 @@ func (cv *VartypeCheck) Pathname() {
if !matches(cv.valueNovar, `^[#\-0-9A-Za-z._~+%/]*$`) {
cv.line.warnf("%q is not a valid pathname.", cv.value)
}
- NewMkLine(cv.line).checkAbsolutePathname(cv.value)
+ cv.line.checkAbsolutePathname(cv.value)
}
func (cv *VartypeCheck) Perl5Packlist() {