Merge lp:~dooferlad/linaro-fetch-image/android-params into lp:linaro-fetch-image

Proposed by James Tunnicliffe
Status: Merged
Approved by: Milo Casagrande
Approved revision: 21
Merged at revision: 21
Proposed branch: lp:~dooferlad/linaro-fetch-image/android-params
Merge into: lp:linaro-fetch-image
Diff against target: 61 lines (+23/-4)
2 files modified
linaro_fetch_image/fetch_image.py (+20/-1)
linaro_fetch_image/fetch_image_settings.yaml (+3/-3)
To merge this branch: bzr merge lp:~dooferlad/linaro-fetch-image/android-params
Reviewer Review Type Date Requested Status
Milo Casagrande (community) Approve
Deepti B. Kalakeri (community) Approve
Review via email: mp+129138@code.launchpad.net

Description of the change

Minor update to make build and hwpack parameters optional when android is the specified image type.
Make build default to "final" when fetching a release build (it is the only valid option at the moment).

To post a comment you must log in.
Revision history for this message
Deepti B. Kalakeri (deeptik) wrote :

looks good +1.

review: Approve
Revision history for this message
Milo Casagrande (milo) wrote :

Hi James, looks good to me.
+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'linaro_fetch_image/fetch_image.py'
2--- linaro_fetch_image/fetch_image.py 2012-10-10 15:42:01 +0000
3+++ linaro_fetch_image/fetch_image.py 2012-10-11 10:09:22 +0000
4@@ -871,11 +871,16 @@
5
6 choices = self.settings['UI']['descriptions']['choice'].items()
7 for (key, value) in choices:
8+ # We don't require hwpack and build for android builds, so don't
9+ # make them required here.
10+ required = True
11+ if key in ["hwpack", "build"]:
12+ required = False
13 parser.add_argument(
14 "-" + self.settings['UI']['cmdline short names'][key],
15 "--" + key,
16 help=self.settings['UI']['descriptions']['choice'][key],
17- required=True)
18+ required=required)
19
20 parser.add_argument("-x", "--clean-cache",
21 help="Delete all cached downloads",
22@@ -902,6 +907,20 @@
23
24 self.args = vars(parser.parse_args(args))
25
26+ # build defaults to final for release builds (it is, in general,
27+ # the only option)
28+ if self.args["platform"] != "snapshot" and not self.args["build"]:
29+ self.args["build"] = "final"
30+
31+ # hwpack and build are required for non-android configurations
32+ if(self.args["image"] != "android" and
33+ not (self.args["hwpack"] and self.args["build"])):
34+ logging.error(
35+ "For Ubuntu based images hwpack and build are required "
36+ "parameters.")
37+ parser.print_help()
38+ exit(1)
39+
40 def finish_config(self, db):
41 """Fill in settings derived from the database."""
42 self.settings['choice']['platform'] = {}
43
44=== modified file 'linaro_fetch_image/fetch_image_settings.yaml'
45--- linaro_fetch_image/fetch_image_settings.yaml 2012-10-10 15:42:01 +0000
46+++ linaro_fetch_image/fetch_image_settings.yaml 2012-10-11 10:09:22 +0000
47@@ -3,11 +3,11 @@
48 alip: ARM Internet Platform
49 choice:
50 build: The build (alpha-1 / beta / final) or date of snapshot (YYYYMMDD:build_number or 'latest')
51- to fetch.
52+ to fetch. For non-snapshot builds, defaults to final.
53 hardware: The board you are building the image to run on.
54 hwpack: The hardware pack to use when building the image.
55- image: A distribuion image, e.g. ubuntu-desktop.
56- platform: Which Linaro platform to build an image from. Specify 'snapshot' to
57+ image: A distribuion image, such as ubuntu-desktop, android or nano.
58+ platform: Which Linaro platform to build an image from (for example, 12.04). Specify 'snapshot' to
59 use a snapshot rather than a release.
60 developer: Developer Tools
61 o-developer: Developer Tools

Subscribers

People subscribed via source and target branches

to all changes: