Merge lp:~chipaca/snapweb/old-branches into lp:~snappy-dev/snapweb/trunk

Proposed by John Lenton
Status: Needs review
Proposed branch: lp:~chipaca/snapweb/old-branches
Merge into: lp:~snappy-dev/snapweb/trunk
Diff against target: 360 lines (+63/-108)
8 files modified
build.sh (+35/-9)
dependencies.tsv (+3/-2)
oem/oem.go (+4/-3)
package.json (+1/-1)
pkg/meta/hooks/config (+0/-70)
pkg/meta/package.yaml (+2/-2)
pkg/snappyd (+6/-1)
snappy/converge.go (+12/-20)
To merge this branch: bzr merge lp:~chipaca/snapweb/old-branches
Reviewer Review Type Date Requested Status
Sergio Schvezov Approve
Review via email: mp+275739@code.launchpad.net

Commit message

Misc fixes to get it working again, most of it already shipped as 0.9.2.

To post a comment you must log in.
Revision history for this message
Sergio Schvezov (sergiusens) :
review: Approve
Revision history for this message
Snappy Tarmac (snappydevtarmac) wrote :
Download full text (3.7 KiB)

The attempt to merge lp:~chipaca/webdm/old-branches into lp:webdm failed. Below is the output from the failed tests.

Checking formatting
Installing godeps
Install golint
Obtaining dependencies
update github.com/blakesmith/ar failed; trying to fetch newer version
update github.com/cheggaaa/pb failed; trying to fetch newer version
github.com/blakesmith/ar now at c9a977dd0cc1392b023382c7bfa5a22af8d3b730
update github.com/gorilla/context failed; trying to fetch newer version
github.com/cheggaaa/pb now at e8c7cc515bfde3e267957a3b110080ceed51354e
update github.com/mvo5/uboot-go failed; trying to fetch newer version
github.com/gorilla/context now at 50c25fb3b2b3b3cc724e9b6ac75fb44b3bccd0da
update gopkg.in/check.v1 failed; trying to fetch newer version
github.com/mvo5/uboot-go now at 69978a3e4b05cca9d7cfee489b3453dfed45e72c
update gopkg.in/yaml.v2 failed; trying to fetch newer version
gopkg.in/check.v1 now at 64131543e7896d5bcc6bd5a76287eb75ea96c673
update launchpad.net/snappy failed; trying to fetch newer version
gopkg.in/yaml.v2 now at 49c95bdc21843256fb6c4e0d370a05f24a0bf213
update github.com/davecheney/gmx failed; trying to fetch newer version
launchpad.net/snappy now at snappy_tarmac-20151026170354-jjpx8mpqyss1ne5p
update github.com/davecheney/mdns failed; trying to fetch newer version
github.com/davecheney/gmx now at d765420e7fbaccecb2a38cf2a02701fe3e0888a3
update github.com/gorilla/mux failed; trying to fetch newer version
github.com/davecheney/mdns now at de174d86a3d3e87bfad9cb66cedd0433380b67b0
update github.com/gosexy/gettext failed; trying to fetch newer version
github.com/gorilla/mux now at e444e69cbd2e2e3e0749a2f3c717cec491552bbf
update github.com/miekg/dns failed; trying to fetch newer version
github.com/gosexy/gettext now at 98b7b91596d20b96909e6b60d57411547dd9959c
update github.com/mvo5/goconfigparser failed; trying to fetch newer version
github.com/miekg/dns now at 5a357a6fc5e85268b929350aa6423e2d56dcc4ff
github.com/mvo5/goconfigparser now at 26426272dda20cc76aa1fa44286dc743d2972fe8
Building
Running tests from /tmp/tmp.uzvVgkq6aG/src/launchpad.net/webdm
=== RUN Test
OK: 4 passed
--- PASS: Test (0.00 seconds)
PASS
coverage: 60.0% of statements
ok launchpad.net/webdm/avahi 0.008s coverage: 60.0% of statements
? launchpad.net/webdm/cmd/snappyd [no test files]
? launchpad.net/webdm/oem [no test files]
FAIL launchpad.net/webdm/snappy [build failed]
? launchpad.net/webdm/webprogress [no test files]

# we always run in a fresh dir in tarmac
export GOPATH=$(mktemp -d)
trap 'rm -rf "$GOPATH"' EXIT

# this is a hack, but not sure tarmac is golang friendly
mkdir -p $GOPATH/src/launchpad.net/webdm
cp -a . $GOPATH/src/launchpad.net/webdm/
cd $GOPATH/src/launchpad.net/webdm

./run-checks
github.com/davecheney/gmx
github.com/miekg/dns
gopkg.in/yaml.v2
launchpad.net/snappy/pkg
github.com/mvo5/goconfigparser
launchpad.net/snappy/logger
launchpad.net/snappy/helpers
launchpad.net/snappy/coreconfig
launchpad.net/snappy/dirs
github.com/gosexy/gettext
github.com/davecheney/mdns
launchpad.net/webdm/avahi
launchpad.net/snappy/oauth
github.com/mvo5/uboot-go/uenv
launchpad.net/snappy/partition
launchpad.net/snappy/i18n
github.com/blakesmith/ar
la...

Read more...

Unmerged revisions

165. By John Lenton

bump snappy revision

164. By John Lenton

also nuke the now-useless config

163. By John Lenton

fxi typo

162. By John Lenton

silly tweaks to build and package

161. By John Lenton

update package version

160. By John Lenton

build again, ok? ta

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'build.sh'
2--- build.sh 2015-05-26 13:34:13 +0000
3+++ build.sh 2015-10-26 17:15:30 +0000
4@@ -9,14 +9,17 @@
5 arch=$1
6
7 case $arch in
8+ 386)
9+ plat_abi=i386-linux-gnu
10+ ;;
11 amd64)
12 plat_abi=x86_64-linux-gnu
13 ;;
14 arm)
15 plat_abi=arm-linux-gnueabihf
16 ;;
17- armhf)
18- plat_abi=arm-linux-gnueabihf
19+ arm64)
20+ plat_abi=aarch64-linux-gnu
21 ;;
22 *)
23 echo "unknown platform for snappy-magic: $arch remember to file a bug or better yet: fix it :)"
24@@ -28,13 +31,33 @@
25 }
26
27 gobuild() {
28- arch=$1
29-
30- plat_abi=$(get_platform_abi $arch)
31+ local arch=$1
32+ local plat_abi=$(get_platform_abi $arch)
33
34 mkdir -p "bin/$plat_abi"
35 cd "bin/$plat_abi"
36- GOARCH=$arch GOARM=7 CGO_ENABLED=1 CC=${plat_abi}-gcc go build -ldflags "-extld=${plat_abi}-gcc" launchpad.net/webdm/cmd/snappyd
37+
38+ local GOARCH CGO_ENABLED CC GO386 FLAGS
39+
40+ export GOARCH=$arch
41+ export CGO_ENABLED=1
42+
43+ if [ "$arch" = "386" ]; then
44+ # 386 is a special snowflake, etc
45+ # also, the edison doesn't have SSE, which we might care about
46+ export GO386=387
47+ else
48+ export CC=${plat_abi}-gcc
49+ if ! which $CC > /dev/null; then
50+ echo "Could not find $CC. Maybe you need to install gcc-${plat_abi}?"
51+ exit 1
52+ fi
53+
54+ FLAGS="-ldflags -extld=$CC"
55+ fi
56+
57+ go build $FLAGS launchpad.net/webdm/cmd/snappyd
58+
59 cd - > /dev/null
60 }
61
62@@ -55,11 +78,14 @@
63 cp -r www/public www/templates $builddir/www
64 cd $builddir
65
66-sed -i 's/\(architecture: \)UNKNOWN_ARCH/\1[amd64, armhf]/' \
67+sed -i 's/\(architectures: \)UNKNOWN_ARCH/\1[i386, amd64, armhf, arm64]/' \
68 $builddir/meta/package.yaml
69
70-gobuild arm
71-gobuild amd64
72+for arch in 386 amd64 arm arm64; do
73+ echo -n Building for $arch...
74+ gobuild $arch
75+ echo done
76+done
77
78 cd "$orig_pwd"
79
80
81=== modified file 'dependencies.tsv'
82--- dependencies.tsv 2015-05-07 18:53:42 +0000
83+++ dependencies.tsv 2015-10-26 17:15:30 +0000
84@@ -4,9 +4,10 @@
85 github.com/davecheney/mdns git de174d86a3d3e87bfad9cb66cedd0433380b67b0 2014-09-13T23:56:41Z
86 github.com/gorilla/context git 50c25fb3b2b3b3cc724e9b6ac75fb44b3bccd0da 2014-11-26T16:34:05Z
87 github.com/gorilla/mux git e444e69cbd2e2e3e0749a2f3c717cec491552bbf 2014-09-26T15:38:14Z
88-github.com/juju/loggo git 4c7cbce140ca070eeb59a28f4bf9507e511711f9 2015-02-26T05:51:10Z
89+github.com/gosexy/gettext git 98b7b91596d20b96909e6b60d57411547dd9959c 2013-02-21T11:21:43Z
90 github.com/miekg/dns git 5a357a6fc5e85268b929350aa6423e2d56dcc4ff 2015-04-18T05:52:30Z
91 github.com/mvo5/goconfigparser git 26426272dda20cc76aa1fa44286dc743d2972fe8 2015-02-12T09:37:50Z
92+github.com/mvo5/uboot-go git 69978a3e4b05cca9d7cfee489b3453dfed45e72c 2015-07-23T08:17:10Z
93 gopkg.in/check.v1 git 64131543e7896d5bcc6bd5a76287eb75ea96c673 2014-10-24T13:38:53Z
94 gopkg.in/yaml.v2 git 49c95bdc21843256fb6c4e0d370a05f24a0bf213 2015-02-24T22:57:58Z
95-launchpad.net/snappy bzr snappy_tarmac-20150507103214-pgd90adryua6v6wi 444
96+launchpad.net/snappy bzr snappy_tarmac-20151026170354-jjpx8mpqyss1ne5p 798
97
98=== modified file 'oem/oem.go'
99--- oem/oem.go 2015-05-08 19:21:46 +0000
100+++ oem/oem.go 2015-10-26 17:15:30 +0000
101@@ -22,12 +22,13 @@
102 "io/ioutil"
103 "path/filepath"
104
105+ "launchpad.net/snappy/pkg"
106 "launchpad.net/snappy/snappy"
107
108 "gopkg.in/yaml.v2"
109 )
110
111-// Snap holds the package.yaml for a snappy.SnapTypeOem package.
112+// Snap holds the package.yaml for a pkg.TypeOem package.
113 type Snap struct {
114 Name string `yaml:"name" json:"name"`
115 Vendor string `yaml:"vendor" json:"vendor"`
116@@ -46,7 +47,7 @@
117 // ErrNotFound indicates that there is no oem package.
118 var ErrNotFound = errors.New("no oem package installed")
119
120-// ErrTooMany indicates that there are too many active snappy.SnapTypeOem packages, which
121+// ErrTooMany indicates that there are too many active pkg.TypeOem packages, which
122 // should never happen on a snappy managed system.
123 var ErrTooMany = errors.New("too many oem packages found")
124
125@@ -56,7 +57,7 @@
126
127 // Oem returns an oem package
128 func Oem() (*Snap, error) {
129- oem, err := snappy.ActiveSnapsByType(snappy.SnapTypeOem)
130+ oem, err := snappy.ActiveSnapsByType(pkg.TypeOem)
131 if err != nil {
132 return nil, err
133 } else if len(oem) > 1 {
134
135=== modified file 'package.json'
136--- package.json 2015-05-29 18:45:45 +0000
137+++ package.json 2015-10-26 17:15:30 +0000
138@@ -37,7 +37,7 @@
139 "lodash": "~3.3.1",
140 "moment": "^2.10.3",
141 "normalize.css": "^3.0.3",
142- "postcss-bem-linter": "git://github.com/necolas/postcss-bem-linter",
143+ "postcss-bem-linter": "^0.6.0",
144 "postcss-custom-media": "^3.0.0",
145 "pretty-bytes": "^2.0.1",
146 "vinyl-buffer": "~1.0.0",
147
148=== removed directory 'pkg/meta/hooks'
149=== removed file 'pkg/meta/hooks/config'
150--- pkg/meta/hooks/config 2015-02-27 16:35:54 +0000
151+++ pkg/meta/hooks/config 1970-01-01 00:00:00 +0000
152@@ -1,70 +0,0 @@
153-#!/usr/bin/python3
154-"""python3 hook for webdm"""
155-
156-import configparser
157-import os
158-import subprocess
159-import sys
160-import yaml
161-
162-
163-WEBDM_DATA_PATH = os.environ['SNAP_APP_DATA_PATH']
164-WEBDM_VERSION = os.environ['SNAP_VERSION']
165-AVAHI_CONFIG_FILE = os.path.join(WEBDM_DATA_PATH, 'avahi-daemon.conf')
166-
167-def main():
168- """main is the main function"""
169-
170- config_yaml = yaml.load(sys.stdin)
171- if config_yaml:
172- avahi_config = set_config(config_yaml)
173-
174- with open(AVAHI_CONFIG_FILE, 'w') as config:
175- avahi_config.write(config, space_around_delimiters=False)
176-
177- yaml.dump(get_config(), stream=sys.stdout, default_flow_style=False)
178- sys.exit(0)
179-
180-
181-def set_config(config_yaml):
182- """set_config sets a configuration and returns avahi_config"""
183-
184- restart_avahi = False
185-
186- config = config_yaml['config']['webdm']
187-
188- avahi_config = configparser.ConfigParser()
189- avahi_config.read(AVAHI_CONFIG_FILE)
190-
191- if 'avahi-hostname' in config:
192- avahi_config['server']['host-name'] = config['avahi-hostname']
193- restart_avahi = True
194-
195- if restart_avahi:
196- avahi_unit = 'webdm_avahi_%s.service' % WEBDM_VERSION
197- try:
198- subprocess.check_call(['systemctl', 'restart', avahi_unit])
199- except subprocess.CalledProcessError:
200- print("Cannot restart required services to fully apply "
201- "the configuration changes")
202-
203- return avahi_config
204-
205-
206-def get_config():
207- """get_config returns config with the current configuration"""
208-
209- config = {}
210- config['config'] = {}
211- config['config']['webdm'] = {}
212-
213- avahi_config = configparser.ConfigParser()
214- avahi_config.read(AVAHI_CONFIG_FILE)
215-
216- hostname = avahi_config['server']['host-name']
217- config['config']['webdm']['avahi-hostname'] = hostname
218-
219- return config
220-
221-if __name__ == '__main__':
222- main()
223
224=== modified file 'pkg/meta/package.yaml'
225--- pkg/meta/package.yaml 2015-06-10 14:41:19 +0000
226+++ pkg/meta/package.yaml 2015-10-26 17:15:30 +0000
227@@ -3,8 +3,8 @@
228 icon: meta/webdm-icon.png
229 source: lp:webdm
230 type: framework
231-version: 0.9
232-architecture: UNKNOWN_ARCH
233+version: 0.9.3
234+architectures: UNKNOWN_ARCH
235 services:
236 - name: snappyd
237 start: snappyd
238
239=== modified file 'pkg/snappyd'
240--- pkg/snappyd 2015-05-21 22:24:32 +0000
241+++ pkg/snappyd 2015-10-26 17:15:30 +0000
242@@ -4,6 +4,12 @@
243 platform=$(uname -i)
244
245 case $platform in
246+ i386)
247+ plat_abi=i386-linux-gnu
248+ ;;
249+ aarch64)
250+ plat_abi=aarch64-linux-gnu
251+ ;;
252 x86_64)
253 plat_abi=x86_64-linux-gnu
254 ;;
255@@ -15,7 +21,6 @@
256 ;;
257 esac
258
259-mkdir -m1777 -p $SNAP_APP_TMPDIR
260 exec $SNAP_APP_PATH/bin/$plat_abi/snappyd
261
262 # never reach this
263
264=== modified file 'snappy/converge.go'
265--- snappy/converge.go 2015-05-08 15:22:21 +0000
266+++ snappy/converge.go 2015-10-26 17:15:30 +0000
267@@ -25,6 +25,7 @@
268
269 "log"
270
271+ "launchpad.net/snappy/pkg"
272 "launchpad.net/snappy/snappy"
273 "launchpad.net/webdm/webprogress"
274 )
275@@ -43,7 +44,7 @@
276 Progress float64 `json:"progress,omitempty"`
277 InstalledSize int64 `json:"installed_size,omitempty"`
278 DownloadSize int64 `json:"download_size,omitempty"`
279- Type snappy.SnapType `json:"type,omitempty"`
280+ Type pkg.Type `json:"type,omitempty"`
281 UIPort uint64 `json:"ui_port,omitempty"`
282 UIUri string `json:"ui_uri,omitempty"`
283 }
284@@ -63,10 +64,10 @@
285 var activeSnapByName = snappy.ActiveSnapByName
286
287 func (h *Handler) packagePayload(resource string) (snapPkg, error) {
288- var pkgName, namespace string
289+ var pkgName, origin string
290 if s := strings.Split(resource, "."); len(s) == 2 {
291 pkgName = s[0]
292- namespace = s[1]
293+ origin = s[1]
294 } else {
295 pkgName = resource
296 }
297@@ -74,13 +75,13 @@
298 snapQ := activeSnapByName(pkgName)
299 if snapQ != nil {
300 // the second check is for locally installed snaps that lose their origin.
301- if snapQ.Namespace() == namespace || snapQ.Type() != snappy.SnapTypeApp {
302+ if snapQ.Origin() == origin || snapQ.Type() != pkg.TypeApp {
303 return h.snapQueryToPayload(snapQ), nil
304 }
305 }
306
307 mStore := snappy.NewMetaStoreRepository()
308- found, err := mStore.Details(resource)
309+ found, err := mStore.Details(pkgName, origin)
310 if err == nil && len(found) != 0 {
311 return h.snapQueryToPayload(found[0]), nil
312 }
313@@ -225,33 +226,24 @@
314 return snapPkgs
315 }
316
317-func isNamespaceless(snap snappy.Part) bool {
318- return snap.Type() == snappy.SnapTypeOem || snap.Type() == snappy.SnapTypeFramework
319-}
320-
321 func hasPortInformation(snap snappy.Part) bool {
322- return snap.Type() == snappy.SnapTypeApp || snap.Type() == snappy.SnapTypeFramework
323+ return snap.Type() == pkg.TypeApp || snap.Type() == pkg.TypeFramework
324 }
325
326 func (h *Handler) snapQueryToPayload(snapQ snappy.Part) snapPkg {
327 snap := snapPkg{
328 Name: snapQ.Name(),
329- Origin: snapQ.Namespace(),
330+ Origin: snapQ.Origin(),
331 Version: snapQ.Version(),
332 Vendor: snapQ.Vendor(),
333 Description: snapQ.Description(),
334 Type: snapQ.Type(),
335- }
336-
337- if isNamespaceless(snapQ) {
338- snap.ID = snapQ.Name()
339- } else {
340- snap.ID = snapQ.Name() + "." + snapQ.Namespace()
341+ ID: snappy.QualifiedName(snapQ),
342 }
343
344 if hasPortInformation(snapQ) {
345- if snapInstalled, ok := snapQ.(snappy.Services); ok {
346- port, uri := uiAccess(snapInstalled.Services())
347+ if snapInstalled, ok := snapQ.(snappy.ServiceYamler); ok {
348+ port, uri := uiAccess(snapInstalled.ServiceYamls())
349 snap.UIPort = port
350 snap.UIUri = uri
351 }
352@@ -293,7 +285,7 @@
353 return snap
354 }
355
356-func uiAccess(services []snappy.Service) (port uint64, uri string) {
357+func uiAccess(services []snappy.ServiceYaml) (port uint64, uri string) {
358 for i := range services {
359 if services[i].Ports == nil {
360 continue

Subscribers

People subscribed via source and target branches

to all changes: