Change package key to be more groupable: arch goes first.

This commit is contained in:
Andrey Smirnov
2014-01-13 20:27:01 +04:00
parent d66fe47def
commit e70517b9ca
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -114,7 +114,7 @@ func NewPackageFromControlFile(input Stanza) *Package {
// Key returns unique key identifying package // Key returns unique key identifying package
func (p *Package) Key() []byte { func (p *Package) Key() []byte {
return []byte("P" + p.Name + " " + p.Version + " " + p.Architecture) return []byte("P" + p.Architecture + " " + p.Name + " " + p.Version)
} }
// Encode does msgpack encoding of Package // Encode does msgpack encoding of Package
+1 -1
View File
@@ -82,7 +82,7 @@ func (s *PackageSuite) TestWithProvides(c *C) {
func (s *PackageSuite) TestKey(c *C) { func (s *PackageSuite) TestKey(c *C) {
p := NewPackageFromControlFile(s.stanza) p := NewPackageFromControlFile(s.stanza)
c.Check(p.Key(), DeepEquals, []byte("Palien-arena-common 7.40-2 i386")) c.Check(p.Key(), DeepEquals, []byte("Pi386 alien-arena-common 7.40-2"))
} }
func (s *PackageSuite) TestEncodeDecode(c *C) { func (s *PackageSuite) TestEncodeDecode(c *C) {