From 4aa913c2c3ec876c0f46fe49f098c7d4c97f4a70 Mon Sep 17 00:00:00 2001 From: Roland Illig Date: Mon, 18 Mar 2024 22:45:26 +0100 Subject: [PATCH] Make a few comments more precise --- v23/mkline.go | 5 +++-- v23/mkparser.go | 5 ++--- v23/pkgsrc.go | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/v23/mkline.go b/v23/mkline.go index eba72973..b5310088 100644 --- a/v23/mkline.go +++ b/v23/mkline.go @@ -644,8 +644,9 @@ func (mkline *MkLine) ResolveExprsInRelPath(rel RelPath, pkg *Package) RelPath { if G.Testing { // Relative pkgsrc paths usually only contain two or three levels. - // A possible reason for reaching this assertion is a pkglint unit test - // that uses t.NewMkLines instead of the correct t.SetUpFileMkLines. + // If this assertion fails during a pkglint unit test, + // it is typically caused by calling t.NewMkLines + // instead of the correct t.SetUpFileMkLines. assertf(!pkgsrcdir.ContainsPath("../../../../.."), "Relative path %q for %q is too deep below the pkgsrc root %q.", pkgsrcdir, basedir, G.Pkgsrc.File(".")) diff --git a/v23/mkparser.go b/v23/mkparser.go index 2353429e..f99b8295 100644 --- a/v23/mkparser.go +++ b/v23/mkparser.go @@ -436,9 +436,8 @@ func ToExpr(str string) *MkExpr { // MkCond is a condition in a makefile, such as ${OPSYS} == NetBSD. // // The representation is somewhere between syntactic and semantic. -// Unnecessary parentheses are omitted in this representation, -// (TODO: double-check; the 'paren(paren(paren()))' tests contradict) -// but !empty(VARNAME) is represented differently from ${VARNAME} != "". +// The condition '!empty(VARNAME)' is represented differently from the +// condition '${VARNAME} != ""'. // For higher level analysis, a unified representation might be better. // See MkParser.MkCond. type MkCond struct { diff --git a/v23/pkgsrc.go b/v23/pkgsrc.go index 47a06105..154b3f6e 100644 --- a/v23/pkgsrc.go +++ b/v23/pkgsrc.go @@ -943,7 +943,8 @@ func (src *Pkgsrc) Load(filename PkgsrcPath, options LoadOptions) *Lines { // // The relative path is built by going from the "from" directory up to the // pkgsrc root and from there to the "to" filename. This produces the form -// "../../category/package" that is found in DEPENDS and .include lines. +// "../../category/package" that is found in DEPENDS lines, as well as +// .include lines from a package directory. // // This function should only be used if the relative path from one file to // another cannot be computed in another way. The preferred way is to take