Merge lp:~sergiusens/phablet-tools/series_select into lp:phablet-tools

Proposed by Sergio Schvezov
Status: Rejected
Rejected by: Ricardo Salveti
Proposed branch: lp:~sergiusens/phablet-tools/series_select
Merge into: lp:phablet-tools
Prerequisite: lp:~sergiusens/phablet-tools/fixing_latest
Diff against target: 121 lines (+29/-8)
3 files modified
debian/changelog (+1/-0)
phablet-flash (+23/-6)
phabletutils/settings.py (+5/-2)
To merge this branch: bzr merge lp:~sergiusens/phablet-tools/series_select
Reviewer Review Type Date Requested Status
Ricardo Salveti (community) Disapprove
PS Jenkins bot continuous-integration Approve
Review via email: mp+157710@code.launchpad.net

This proposal supersedes a proposal from 2013-04-08.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

Rejecting based on discussions we had on IRC (we'll have another and better way to handle different series).

review: Disapprove

Unmerged revisions

83. By Sergio Schvezov

fixing pep8 issues with indentation

82. By Sergio Schvezov

Making a preset set of choices for series

81. By Sergio Schvezov

ubuntu_image renamed to ubuntu_img for consistency

80. By Sergio Schvezov

Allow downloading a specific series of the ubuntu image (LP: #1166202)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-04-08 17:46:22 +0000
3+++ debian/changelog 2013-04-08 17:46:22 +0000
4@@ -13,6 +13,7 @@
5 - The -l option is now deprecated
6 * Attempt to start the adb server before executing anything (LP: #1143946)
7 * Don't attempt to re-download if complete (LP: #1163898)
8+ * Allow downloading a specific series of the ubuntu image (LP: #1166202)
9
10 -- Mathieu Trudel-Lapierre <mathieu-tl@ubuntu.com> Mon, 25 Mar 2013 14:31:18 -0400
11
12
13=== modified file 'phablet-flash'
14--- phablet-flash 2013-04-08 17:46:22 +0000
15+++ phablet-flash 2013-04-08 17:46:22 +0000
16@@ -74,6 +74,14 @@
17 default=None,
18 help='Choose a specific build number to download.',
19 )
20+ parser.add_argument('-S',
21+ '--series',
22+ required=False,
23+ default='quantal',
24+ choices=getattr(settings, 'valid_series', 'quantal'),
25+ help='''Choose to download a different series,
26+ default is quantal.'''
27+ )
28 group = parser.add_mutually_exclusive_group()
29 group.add_argument('-l',
30 '--latest',
31@@ -305,6 +313,16 @@
32 exit(1)
33
34
35+def get_ubuntu_image(series):
36+ '''Returns an ubuntu image or None if not found.'''
37+ ubuntu_image = getattr(settings, 'ubuntu_image', None)
38+ try:
39+ ubuntu_image = ubuntu_image % series
40+ except TypeError:
41+ pass
42+ return ubuntu_image
43+
44+
45 def main(args):
46 if not has_accepted(accepted_pathname()) and \
47 not query(settings.legal_notice):
48@@ -316,6 +334,7 @@
49 # Initializes the adb server if it is not running
50 adb.start()
51 device = detect_device(adb, args.device)
52+ ubuntu_img = get_ubuntu_image(args.series)
53 # Determine uri to download from
54 if not args.uri:
55 args.uri = settings.download_uri
56@@ -334,14 +353,14 @@
57 '%s/quantal-ubuntu_stamp' % args.uri)
58 download_dir = setup_download_directory(jenkins_build_id)
59 if args.bootstrap:
60- download_list = [getattr(settings, 'ubuntu_image', None)]
61+ download_list = [ubuntu_img, ]
62 for attr in ('device_file_img', 'recovery_file_img', 'boot_file_img'):
63 value = getattr(settings, attr, None)
64 if value is not None:
65 download_list.append(value % device)
66 else:
67 device_img = settings.device_file % device
68- download_list = [device_img, settings.ubuntu_image]
69+ download_list = [device_img, ubuntu_img]
70 download_mgr = DownloadManager(args.uri, download_dir, download_list, offline)
71 try:
72 log.info('Retrieving files')
73@@ -357,13 +376,12 @@
74 if settings.validate_device:
75 validate_device(adb)
76 if args.bootstrap:
77- push_for_autodeploy(adb,
78- download_mgr.files.get(getattr(settings, 'ubuntu_image', None)))
79+ push_for_autodeploy(adb, download_mgr.files.get(ubuntu_img))
80 bootstrap(adb, download_mgr.files)
81 else:
82 recovery_file = create_recovery_file(adb,
83 download_mgr.files[device_img],
84- download_mgr.files[settings.ubuntu_image])
85+ download_mgr.files[ubuntu_img])
86 deploy_recovery_image(adb, download_mgr.files, recovery_file)
87
88
89@@ -377,6 +395,5 @@
90 if __name__ == "__main__":
91 args = parse_arguments()
92 if args.alternate_settings:
93- print "alternate settings"
94 import_alt_settings(args.alternate_settings)
95 main(args)
96
97=== modified file 'phabletutils/settings.py'
98--- phabletutils/settings.py 2013-04-08 17:46:22 +0000
99+++ phabletutils/settings.py 2013-04-08 17:46:22 +0000
100@@ -16,7 +16,7 @@
101
102 download_uri = 'http://cdimage.ubuntu.com/ubuntu-touch-preview/daily-preinstalled/current'
103 download_dir = 'phablet-flash'
104-ubuntu_image = 'quantal-preinstalled-phablet-armhf.zip'
105+ubuntu_image = '%s-preinstalled-phablet-armhf.zip'
106 device_file = 'quantal-preinstalled-armel+%s.zip'
107 device_file_img = 'quantal-preinstalled-system-armel+%s.img'
108 boot_file_img = 'quantal-preinstalled-boot-armel+%s.img'
109@@ -30,8 +30,11 @@
110 'maguro',
111 'manta',
112 'grouper',
113- )
114+ )
115 validate_device = True
116+valid_series = ('quantal',
117+ 'raring',
118+ )
119 legal_notice = '''"Touch Developer Preview for Ubuntu" is released for free
120 non-commercial use. It is provided without warranty, even the implied
121 warranty of merchantability, satisfaction or fitness for a particular

Subscribers

People subscribed via source and target branches