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

Proposed by Sergio Schvezov
Status: Superseded
Proposed branch: lp:~sergiusens/goget-ubuntu-touch/oemFlag
Merge into: lp:goget-ubuntu-touch
Prerequisite: lp:~sergiusens/goget-ubuntu-touch/automan
Diff against target: 46 lines (+12/-10)
1 file modified
ubuntu-device-flash/core.go (+12/-10)
To merge this branch: bzr merge lp:~sergiusens/goget-ubuntu-touch/oemFlag
Reviewer Review Type Date Requested Status
John Lenton (community) Approve
Review via email: mp+256922@code.launchpad.net

This proposal has been superseded by a proposal from 2015-04-21.

Commit message

Use the AllowOEM installation flag for snappy

To post a comment you must log in.
Revision history for this message
John Lenton (chipaca) :
review: Approve
171. By Sergio Schvezov

Use the AllowOEM installation flag for snappy

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu-device-flash/core.go'
2--- ubuntu-device-flash/core.go 2015-04-20 17:04:14 +0000
3+++ ubuntu-device-flash/core.go 2015-04-21 18:16:46 +0000
4@@ -407,11 +407,7 @@
5 snappy.SetRootDir(systemPath)
6 defer snappy.SetRootDir("/")
7
8- flags := snappy.InhibitHooks
9- if coreCmd.Development.DeveloperMode {
10- flags |= snappy.AllowUnauthenticated
11- }
12-
13+ flags := coreCmd.installFlags()
14 oemSoftware := coreCmd.oem.OEM.Software
15 packageCount := len(coreCmd.Deprecated.Install) + len(oemSoftware.BuiltIn) + len(oemSoftware.Preinstalled)
16 if coreCmd.Oem != "" {
17@@ -523,6 +519,16 @@
18 return string(pubKey), err
19 }
20
21+func (coreCmd *CoreCmd) installFlags() snappy.InstallFlags {
22+ flags := snappy.InhibitHooks | snappy.AllowOEM
23+
24+ if coreCmd.Development.DeveloperMode {
25+ flags |= snappy.AllowUnauthenticated
26+ }
27+
28+ return flags
29+}
30+
31 func (coreCmd *CoreCmd) extractOem(oemPackage string) error {
32 if oemPackage == "" {
33 return nil
34@@ -548,11 +554,7 @@
35 Channel: coreCmd.Channel,
36 })
37
38- flags := snappy.InhibitHooks
39- if coreCmd.Development.DeveloperMode {
40- flags |= snappy.AllowUnauthenticated
41- }
42-
43+ flags := coreCmd.installFlags()
44 pb := progress.NewTextProgress(oemPackage)
45 if _, err := snappy.Install(oemPackage, flags, pb); err != nil {
46 return err

Subscribers

People subscribed via source and target branches