Merge lp:~popey/phablet-tools/download-only into lp:phablet-tools

Status: Rejected
Rejected by: Alan Pope 🍺🐧🐱 πŸ¦„
Proposed branch: lp:~popey/phablet-tools/download-only
Merge into: lp:phablet-tools
Diff against target: 71 lines (+36/-11)
1 file modified
phablet-flash (+36/-11)
To merge this branch: bzr merge lp:~popey/phablet-tools/download-only
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+152596@code.launchpad.net

Description of the change

Adds a -D option which forces the download to happen without validating the device is attached. Useful if you want to download the image without having the device nearby - e.g. via cron overnight.

-D requires that -d is also used, to specify the device type. So example use:-

phablet-flash -l -D -d grouper

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:64
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~popey/phablet-tools/download-only/+merge/152596/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/phablet-tools-ci/13/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-tools-ci/./build=pbuilder,distribution=quantal,flavor=i386/13/console

Click here to trigger a rebuild:
http://jenkins.qa.ubuntu.com/job/phablet-tools-ci/13//rebuild/?

review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

rejected, will re-work.

Unmerged revisions

64. By Alan Pope 🍺🐧🐱 πŸ¦„

add download-only option

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'phablet-flash'
2--- phablet-flash 2013-02-26 16:04:10 +0000
3+++ phablet-flash 2013-03-10 20:44:21 +0000
4@@ -85,6 +85,13 @@
5 required=False,
6 help='Alternate download uri',
7 )
8+ parser.add_argument('-D',
9+ '--download',
10+ required=False,
11+ help='''Download image only, but do not flash device
12+ Requires target device specified with -d.''',
13+ action='store_true',
14+ )
15 return parser.parse_args()
16
17
18@@ -295,7 +302,24 @@
19 adb = AndroidBridge(args.serial)
20 else:
21 adb = AndroidBridge()
22- device = validate_device(adb, args.device)
23+ if args.download:
24+ download_only = True
25+ if args.bootstrap:
26+ log.error('Bootstrap and download options are exclusive, specify one only')
27+ exit(1)
28+ if args.device:
29+ if args.device not in settings.supported_devices:
30+ log.error('Unsupported device, autodetect fails device')
31+ exit(1)
32+ else:
33+ device = args.device
34+ else:
35+ log.error('Device type must be specified when in download only mode')
36+ exit(1)
37+ else:
38+ download_only = False
39+ if not download_only:
40+ device = validate_device(adb, args.device)
41 # Determine uri to download from
42 if not args.uri:
43 args.uri = settings.download_uri
44@@ -333,16 +357,17 @@
45 except subprocess.CalledProcessError:
46 log.error('Error while downloading, ensure connection')
47 exit(1)
48- if args.bootstrap:
49- push_for_autodeploy(adb, download_mgr.files[settings.ubuntu_image])
50- bootstrap(adb, download_mgr.files[recovery_img],
51- download_mgr.files[device_img],
52- download_mgr.files[boot_img],)
53- else:
54- recovery_file = create_recovery_file(adb,
55- download_mgr.files[device_img],
56- download_mgr.files[settings.ubuntu_image])
57- deploy_recovery_image(adb, download_mgr.files, recovery_file)
58+ if not download_only:
59+ if args.bootstrap:
60+ push_for_autodeploy(adb, download_mgr.files[settings.ubuntu_image])
61+ bootstrap(adb, download_mgr.files[recovery_img],
62+ download_mgr.files[device_img],
63+ download_mgr.files[boot_img],)
64+ else:
65+ recovery_file = create_recovery_file(adb,
66+ download_mgr.files[device_img],
67+ download_mgr.files[settings.ubuntu_image])
68+ deploy_recovery_image(adb, download_mgr.files, recovery_file)
69
70
71 if __name__ == "__main__":

Subscribers

People subscribed via source and target branches