Merge lp:~sergiusens/goget-ubuntu-touch/polishit into lp:goget-ubuntu-touch

Proposed by Sergio Schvezov on 2015-04-15
Status: Merged
Approved by: Sergio Schvezov on 2015-04-16
Approved revision: 161
Merged at revision: 160
Proposed branch: lp:~sergiusens/goget-ubuntu-touch/polishit
Merge into: lp:goget-ubuntu-touch
Prerequisite: lp:~sergiusens/goget-ubuntu-touch/notBeingBackwards
Diff against target: 79 lines (+17/-12)
2 files modified
diskimage/common.go (+4/-0)
ubuntu-device-flash/core.go (+13/-12)
To merge this branch: bzr merge lp:~sergiusens/goget-ubuntu-touch/polishit
Reviewer Review Type Date Requested Status
Sergio Schvezov Approve on 2015-04-16
John Lenton Approve on 2015-04-15
Review via email: mp+256358@code.launchpad.net

Commit Message

Polish summary output and update to work with current snappy changes

To post a comment you must log in.
John Lenton (chipaca) wrote :

Woop!

review: Approve
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'diskimage/common.go'
2--- diskimage/common.go 2015-04-07 20:20:15 +0000
3+++ diskimage/common.go 2015-04-15 16:41:24 +0000
4@@ -116,6 +116,10 @@
5 return o.OEM.Hardware.Architecture
6 }
7
8+func (o *OemDescription) SetArchitecture(architecture string) {
9+ o.OEM.Hardware.Architecture = architecture
10+}
11+
12 func (o OemDescription) PartitionLayout() string {
13 return o.OEM.Hardware.PartitionLayout
14 }
15
16=== modified file 'ubuntu-device-flash/core.go'
17--- ubuntu-device-flash/core.go 2015-04-13 13:59:19 +0000
18+++ ubuntu-device-flash/core.go 2015-04-15 16:41:24 +0000
19@@ -24,6 +24,7 @@
20
21 "gopkg.in/yaml.v2"
22 "launchpad.net/snappy/helpers"
23+ "launchpad.net/snappy/progress"
24 "launchpad.net/snappy/snappy"
25
26 "launchpad.net/goget-ubuntu-touch/diskimage"
27@@ -134,13 +135,11 @@
28
29 channel := systemImageChannel(coreCmd.Channel)
30
31- var device string
32- if coreCmd.oem.Architecture() != "" {
33- device = systemImageDeviceChannel(coreCmd.oem.Architecture())
34- } else {
35- device = systemImageDeviceChannel(coreCmd.Deprecated.Device)
36+ if coreCmd.oem.Architecture() == "" {
37+ coreCmd.oem.SetArchitecture(coreCmd.Deprecated.Device)
38 }
39
40+ device := systemImageDeviceChannel(coreCmd.oem.Architecture())
41 deviceChannel, err := channels.GetDeviceChannel(globalArgs.Server, channel, device)
42 if err != nil {
43 return err
44@@ -292,11 +291,11 @@
45 }
46
47 fmt.Println("New image complete")
48- fmt.Println("Summary")
49- fmt.Println("\tOutput:", coreCmd.Output)
50- fmt.Println("\tArchitecture:", coreCmd.oem.Architecture())
51- fmt.Println("\tChannel:", coreCmd.Channel)
52- fmt.Println("\tVersion:", image.Version)
53+ fmt.Println("Summary:")
54+ fmt.Println(" Output:", coreCmd.Output)
55+ fmt.Println(" Architecture:", coreCmd.oem.Architecture())
56+ fmt.Println(" Channel:", coreCmd.Channel)
57+ fmt.Println(" Version:", image.Version)
58
59 if coreCmd.oem.Architecture() != "armhf" {
60 fmt.Println("Launch by running: kvm -m 768", coreCmd.Output)
61@@ -426,7 +425,8 @@
62 for _, snap := range packageQueue {
63 fmt.Println("Installing", snap)
64
65- if _, err := snappy.Install(snap, flags); err != nil {
66+ pb := progress.NewTextProgress(snap)
67+ if _, err := snappy.Install(snap, flags, pb); err != nil {
68 return err
69 }
70 }
71@@ -563,7 +563,8 @@
72 flags |= snappy.AllowUnauthenticated
73 }
74
75- if _, err := snappy.Install(oemPackage, flags); err != nil {
76+ pb := progress.NewTextProgress(oemPackage)
77+ if _, err := snappy.Install(oemPackage, flags, pb); err != nil {
78 return err
79 }
80

Subscribers

People subscribed via source and target branches