Introduce Package.ShortKey(): packages should have no conflict on that key in one list. #60

This commit is contained in:
Andrey Smirnov
2014-05-29 18:00:14 +04:00
parent dc248c5603
commit 90bba977d7
2 changed files with 12 additions and 0 deletions
+5
View File
@@ -175,6 +175,11 @@ func (p *Package) Key(prefix string) []byte {
return []byte(fmt.Sprintf("%sP%s %s %s %08x", prefix, p.Architecture, p.Name, p.Version, p.FilesHash))
}
return p.ShortKey(prefix)
}
// ShortKey returns key for the package that should be unique in one list
func (p *Package) ShortKey(prefix string) []byte {
return []byte(fmt.Sprintf("%sP%s %s %s", prefix, p.Architecture, p.Name, p.Version))
}