Skip to content

Commit e58571d

Browse files
committed
Recognize build expressions that use Any() for a version requirement.
1 parent cef79f8 commit e58571d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

pkg/buildscript/marshal.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const (
2222
ltFuncName = "Lt"
2323
lteFuncName = "Lte"
2424
andFuncName = "And"
25+
anyFuncName = "Any"
2526
)
2627

2728
// Marshal returns this structure in AScript, suitable for writing to disk.

pkg/buildscript/marshal_buildexpression.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ func marshalReq(fn *funcCall) ([]byte, error) {
153153
return errs.Wrap(err, "Could not marshal additional requirement")
154154
}
155155
}
156+
case anyFuncName:
157+
// We can ignore the `version = Any()` argument; omitting it is an equivalent statement.
158+
// As mentioned in this function's comment, once buildexpressions support requirements as
159+
// functions, we won't need to do any of this anymore.
156160
default:
157161
return errs.New("Unknown version comparator: %s", name)
158162
}

0 commit comments

Comments
 (0)