Dependency resolution engine with tests.

This commit is contained in:
Andrey Smirnov
2014-01-09 13:12:32 +04:00
parent 5dbb771ba8
commit e37fe33203
3 changed files with 138 additions and 3 deletions
+5
View File
@@ -188,6 +188,11 @@ type Dependency struct {
Architecture string
}
// Hash calculates some predefined unique ID of Dependency
func (d *Dependency) Hash() string {
return fmt.Sprintf("%s:%s:%d:%s", d.Architecture, d.Pkg, d.Relation, d.Version)
}
// parseDependency parses dependency in format "pkg (>= 1.35)" into parts
func parseDependency(dep string) (d Dependency, err error) {
if !strings.HasSuffix(dep, ")") {