Merge lp:~chipaca/snappy/vendor into lp:~snappy-dev/snappy/snappy-moved-to-github

Proposed by John Lenton on 2015-05-05
Status: Merged
Approved by: Sergio Schvezov on 2015-05-05
Approved revision: 443
Merged at revision: 440
Proposed branch: lp:~chipaca/snappy/vendor
Merge into: lp:~snappy-dev/snappy/snappy-moved-to-github
Prerequisite: lp:~chipaca/snappy/deprecated-architectures
Diff against target: 135 lines (+26/-2)
5 files modified
snappy/parts.go (+1/-0)
snappy/snapp.go (+10/-0)
snappy/snapp_test.go (+7/-1)
snappy/systemimage.go (+7/-1)
snappy/systemimage_test.go (+1/-0)
To merge this branch: bzr merge lp:~chipaca/snappy/vendor
Reviewer Review Type Date Requested Status
Sergio Schvezov 2015-05-05 Approve on 2015-05-05
Review via email: mp+258272@code.launchpad.net

This proposal supersedes a proposal from 2015-05-05.

Commit Message

Add Vendor() string to the Parts interface

Description of the Change

Vendor, author, publisher, 'tis all the same, right?

To post a comment you must log in.
Sergio Schvezov (sergiusens) wrote :

Nice

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'snappy/parts.go'
2--- snappy/parts.go 2015-04-30 16:56:15 +0000
3+++ snappy/parts.go 2015-05-05 15:44:10 +0000
4@@ -68,6 +68,7 @@
5 Version() string
6 Description() string
7 Namespace() string
8+ Vendor() string
9
10 Hash() string
11 IsActive() bool
12
13=== modified file 'snappy/snapp.go'
14--- snappy/snapp.go 2015-05-05 15:44:10 +0000
15+++ snappy/snapp.go 2015-05-05 15:44:10 +0000
16@@ -522,6 +522,11 @@
17 return s.namespace
18 }
19
20+// Vendor returns the author. Or viceversa.
21+func (s *SnapPart) Vendor() string {
22+ return s.m.Vendor
23+}
24+
25 // Hash returns the hash
26 func (s *SnapPart) Hash() string {
27 return s.hash
28@@ -886,6 +891,11 @@
29 return s.pkg.Namespace
30 }
31
32+// Vendor is the publisher. Author. Whatever.
33+func (s *RemoteSnapPart) Vendor() string {
34+ return s.pkg.Publisher
35+}
36+
37 // Hash returns the hash
38 func (s *RemoteSnapPart) Hash() string {
39 return s.pkg.DownloadSha512
40
41=== modified file 'snappy/snapp_test.go'
42--- snappy/snapp_test.go 2015-05-05 15:44:10 +0000
43+++ snappy/snapp_test.go 2015-05-05 15:44:10 +0000
44@@ -219,6 +219,7 @@
45 const (
46 funkyAppName = "8nzc1x4iim2xj1g2ul64"
47 funkyAppOrigin = "chipaca"
48+ funkyAppVendor = "John Lenton"
49 )
50
51 /* acquired via:
52@@ -464,6 +465,7 @@
53 c.Assert(parts, HasLen, 1)
54 c.Check(parts[0].Name(), Equals, funkyAppName)
55 c.Check(parts[0].Namespace(), Equals, funkyAppOrigin)
56+ c.Check(parts[0].Vendor(), Equals, funkyAppVendor)
57 c.Check(parts[0].Version(), Equals, "42")
58 c.Check(parts[0].Description(), Equals, "Returns for store credit only.")
59
60@@ -494,6 +496,8 @@
61 c.Check(parts[1].Name(), Equals, "hello-world")
62 c.Check(parts[0].Namespace(), Equals, "canonical")
63 c.Check(parts[1].Namespace(), Equals, "jdstrand")
64+ c.Check(parts[0].Vendor(), Equals, "Canonical")
65+ c.Check(parts[1].Vendor(), Equals, "Jamie Strandboge")
66 c.Check(parts[0].Version(), Equals, "1.0.8")
67 c.Check(parts[1].Version(), Equals, "1.4")
68 c.Check(parts[0].Description(), Equals, "hello-world")
69@@ -592,6 +596,7 @@
70 c.Assert(results, HasLen, 1)
71 c.Check(results[0].Name(), Equals, funkyAppName)
72 c.Check(results[0].Namespace(), Equals, funkyAppOrigin)
73+ c.Check(results[0].Vendor(), Equals, funkyAppVendor)
74 c.Check(results[0].Version(), Equals, "42")
75 c.Check(results[0].Hash(), Equals, "5364253e4a988f4f5c04380086d542f410455b97d48cc6c69ca2a5877d8aef2a6b2b2f83ec4f688cae61ebc8a6bf2cdbd4dbd8f743f0522fc76540429b79df42")
76 c.Check(results[0].Date().String(), Equals, "2015-04-15 18:30:16 +0000 UTC")
77@@ -708,7 +713,7 @@
78 func (s *SnapTestSuite) TestServicesWithPorts(c *C) {
79 const packageHello = `name: hello-app
80 version: 1.10
81-vendor: Michael Vogt <mvo@ubuntu.com>
82+vendor: Michael Vogt
83 icon: meta/hello.svg
84 binaries:
85 - name: bin/hello
86@@ -735,6 +740,7 @@
87
88 c.Assert(snap.Name(), Equals, "hello-app")
89 c.Assert(snap.Namespace(), Equals, testNamespace)
90+ c.Assert(snap.Vendor(), Equals, "Michael Vogt")
91 c.Assert(snap.Version(), Equals, "1.10")
92 c.Assert(snap.IsActive(), Equals, false)
93
94
95=== modified file 'snappy/systemimage.go'
96--- snappy/systemimage.go 2015-04-15 20:39:24 +0000
97+++ snappy/systemimage.go 2015-05-05 15:44:10 +0000
98@@ -38,6 +38,7 @@
99 const (
100 systemImagePartName = "ubuntu-core"
101 systemImagePartNamespace = "ubuntu"
102+ systemImagePartVendor = "Canonical Ltd."
103
104 // location of the channel config on the filesystem.
105 //
106@@ -103,11 +104,16 @@
107 return systemImagePartName
108 }
109
110-// Namespace returns the name
111+// Namespace returns the namespace ("ubuntu")
112 func (s *SystemImagePart) Namespace() string {
113 return systemImagePartNamespace
114 }
115
116+// Vendor returns the vendor ("Canonical Ltd.")
117+func (s *SystemImagePart) Vendor() string {
118+ return systemImagePartVendor
119+}
120+
121 // Version returns the version
122 func (s *SystemImagePart) Version() string {
123 return s.version
124
125=== modified file 'snappy/systemimage_test.go'
126--- snappy/systemimage_test.go 2015-04-22 10:35:09 +0000
127+++ snappy/systemimage_test.go 2015-05-05 15:44:10 +0000
128@@ -113,6 +113,7 @@
129 c.Assert(parts, HasLen, 2)
130 c.Assert(parts[0].Name(), Equals, systemImagePartName)
131 c.Assert(parts[0].Namespace(), Equals, systemImagePartNamespace)
132+ c.Assert(parts[0].Vendor(), Equals, systemImagePartVendor)
133 c.Assert(parts[0].Version(), Equals, "1")
134 c.Assert(parts[0].Hash(), Equals, "e09c13f68fccef3b2fe0f5c8ff5c61acf2173b170b1f2a3646487147690b0970ef6f2c555d7bcb072035f29ee4ea66a6df7f6bb320d358d3a7d78a0c37a8a549")
135 c.Assert(parts[0].IsActive(), Equals, true)

Subscribers

People subscribed via source and target branches