Merge lp:~doanac/phablet-tools/pkg-inst into lp:phablet-tools

Proposed by Andy Doan
Status: Rejected
Rejected by: Sergio Schvezov
Proposed branch: lp:~doanac/phablet-tools/pkg-inst
Merge into: lp:phablet-tools
Diff against target: 108 lines (+93/-0)
2 files modified
phablet-pkg-install (+92/-0)
setup.py (+1/-0)
To merge this branch: bzr merge lp:~doanac/phablet-tools/pkg-inst
Reviewer Review Type Date Requested Status
Sergio Schvezov Disapprove
PS Jenkins bot continuous-integration Approve
Review via email: mp+163371@code.launchpad.net

Commit message

Add a new script that makes it easy to install a package on the target

Description of the change

This is a simple utility I've been using to install packages on the target. Thought it might be useful to others.

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

FAILED: Continuous integration, rev:93
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/~doanac/phablet-tools/pkg-inst/+merge/163371/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/phablet-tools-ci/46/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-tools-raring-amd64-ci/12
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-tools-raring-armhf-ci/12
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-tools-raring-i386-ci/40

Click here to trigger a rebuild:
http://s-jenkins:8080/job/phablet-tools-ci/46/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

phablet-config and writable-image replaced the need for this

review: Disapprove

Unmerged revisions

93. By Andy Doan

add a utility to make package installation easier

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'phablet-pkg-install'
--- phablet-pkg-install 1970-01-01 00:00:00 +0000
+++ phablet-pkg-install 2013-05-10 21:52:26 +0000
@@ -0,0 +1,92 @@
1#!/bin/sh -e
2# This program is free software: you can redistribute it and/or modify it
3# under the terms of the the GNU General Public License version 3, as
4# published by the Free Software Foundation.
5#
6# This program is distributed in the hope that it will be useful, but
7# WITHOUT ANY WARRANTY; without even the implied warranties of
8# MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
9# PURPOSE. See the applicable version of the GNU General Public
10# License for more details.
11#.
12# You should have received a copy of the GNU General Public License
13# along with this program. If not, see <http://www.gnu.org/licenses/>.
14#
15# Copyright (C) 2013 Canonical, Ltd.
16
17ANDROID_SERIAL=""
18PPAS=""
19
20usage() {
21 cat << EOF
22usage: $0 [-s SERIAL] [-p PPA] package [package...]
23
24 Install the package(s) on the target.
25
26 -s SERIAL Device serial number
27 -p PPA PPA required for the package
28EOF
29}
30
31wait_for_device() {
32 adb -s $ANDROID_SERIAL wait-for-device
33}
34
35exec_with_adb() {
36 adb -s $ANDROID_SERIAL shell chroot /data/ubuntu /usr/bin/env -i PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin "$@"
37}
38
39adb_root() {
40 adb root
41 adb wait-for-device
42}
43
44add_ppas() {
45 for p in $* ; do
46 echo "adding ppa: $p ..."
47 exec_with_adb add-apt-repository -y $p
48 done
49 if [ -n "$PPAS" ] ; then
50 echo "running apt-get update ..."
51 exec_with_adb apt-get -qq update
52 fi
53}
54
55install_pkgs() {
56 echo "install $* ..."
57 exec_with_adb apt-get -y -q --force-yes install $*
58}
59
60while getopts hp:s: opt; do
61 case $opt in
62 h)
63 usage
64 exit 0
65 ;;
66 p)
67 PPAS="$PPAS $OPTARG"
68 ;;
69 s)
70 ANDROID_SERIAL=$OPTARG
71 ;;
72 esac
73done
74
75shift $((OPTIND - 1))
76
77PKGS="$*"
78
79if [ -z "$PKGS" ] ; then
80 echo "ERROR: no packages specified"
81 usage
82 exit 1
83fi
84
85if test -z $ANDROID_SERIAL; then
86 ANDROID_SERIAL=$(adb devices -l | grep usb | cut -f 1 -d " " | head -n1)
87fi
88export ANDROID_SERIAL=$ANDROID_SERIAL
89
90adb_root
91add_ppas $PPAS
92install_pkgs $PKGS
093
=== modified file 'setup.py'
--- setup.py 2013-04-15 18:24:25 +0000
+++ setup.py 2013-05-10 21:52:26 +0000
@@ -15,6 +15,7 @@
15 'phablet-network-setup',15 'phablet-network-setup',
16 'phablet-dev-bootstrap',16 'phablet-dev-bootstrap',
17 'phablet-test-run',17 'phablet-test-run',
18 'phablet-pkg-install',
18 'repo',19 'repo',
19 ],20 ],
20)21)

Subscribers

People subscribed via source and target branches