Skip to content

Commit

Permalink
Make a few comments more precise
Browse files Browse the repository at this point in the history
  • Loading branch information
rillig committed Mar 18, 2024
1 parent 688374d commit 4aa913c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions v23/mkline.go
Original file line number Diff line number Diff line change
Expand Up @@ -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("."))
Expand Down
5 changes: 2 additions & 3 deletions v23/mkparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion v23/pkgsrc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4aa913c

Please sign in to comment.