Preparation for query matching: introduce Regexp + PatternMatch.

This commit is contained in:
Andrey Smirnov
2014-07-10 21:16:30 +04:00
parent f0e69144ed
commit d262a131cc
3 changed files with 22 additions and 0 deletions
+5
View File
@@ -224,6 +224,11 @@ func (p *Package) MatchesDependency(dep Dependency) bool {
return r <= 0
case VersionGreaterOrEqual:
return r >= 0
case VersionPatternMatch:
matched, err := filepath.Match(dep.Version, p.Version)
return err == nil && matched
case VersionRegexp:
panic("regexp matching not implemented yet")
}
panic("unknown relation")