mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-06 05:30:57 +00:00
Allow uppercase package name in package query expressions
Fixes: #636 Before this fix, aptly was always treating strings starting with uppercase letter as field name, which was breaking package queries like `VMware-Horizon-Client_4.5.0_all`. Now aptly accepts only fields which don't contain underscore, and everything else would be parsed as package reference.
This commit is contained in:
+1
-1
@@ -135,7 +135,7 @@ func (p *parser) D() deb.PackageQuery {
|
||||
operator, value := p.Condition()
|
||||
|
||||
r, _ := utf8.DecodeRuneInString(field)
|
||||
if strings.HasPrefix(field, "$") || unicode.IsUpper(r) {
|
||||
if strings.HasPrefix(field, "$") || (unicode.IsUpper(r) && !strings.ContainsRune(field, '_')) {
|
||||
// special field or regular field
|
||||
q := &deb.FieldQuery{Field: field, Relation: operatorToRelation(operator), Value: value}
|
||||
if q.Relation == deb.VersionRegexp {
|
||||
|
||||
Reference in New Issue
Block a user