Merge lp:~robru/phablet-tools/make-useful-again into lp:phablet-tools

Proposed by Robert Bruce Park
Status: Merged
Approved by: Robert Bruce Park
Approved revision: 354
Merged at revision: 345
Proposed branch: lp:~robru/phablet-tools/make-useful-again
Merge into: lp:phablet-tools
Diff against target: 107 lines (+15/-25)
1 file modified
citrain (+15/-25)
To merge this branch: bzr merge lp:~robru/phablet-tools/make-useful-again
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Robert Bruce Park (community) Approve
Review via email: mp+274338@code.launchpad.net

Commit message

Make citrain tool able to install silo packages with deps & without extras.

Description of the change

Hopefully we can restore the usefulness of citrain tool in the face of overlay PPA and "new deps in distro" challenges.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
348. By Robert Bruce Park

Bring back autoremove.

Revision history for this message
Robert Bruce Park (robru) wrote :
Download full text (4.4 KiB)

Ok, I tested this on silo 14 (webbrowser-app), and got the following results:

+ adb shell SUDO_ASKPASS=/tmp/askpass.sh sudo -A apt-get install ubuntu-touch qtdeclarative5-ubuntu-ui-extras-browser-plugin qtdeclarative5-ubuntu-web-plugin webapp-container webbrowser-app --yes
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  qtdeclarative5-ubuntu-web-plugin-assets
Use 'apt-get autoremove' to remove it.
The following extra packages will be installed:
  gstreamer1.0-plugins-ugly-amr indicator-transfer
  indicator-transfer-download-manager libindicator-transfer0
  libopencore-amrnb0 libopencore-amrwb0 liboxideqt-qmlplugin liboxideqtcore0
  liboxideqtquick0 oxideqt-codecs-extra
The following NEW packages will be installed:
  gstreamer1.0-plugins-ugly-amr indicator-transfer-download-manager
  libindicator-transfer0 libopencore-amrnb0 libopencore-amrwb0
The following packages will be upgraded:
  indicator-transfer liboxideqt-qmlplugin liboxideqtcore0 liboxideqtquick0
  oxideqt-codecs-extra qtdeclarative5-ubuntu-ui-extras-browser-plugin
  qtdeclarative5-ubuntu-web-plugin ubuntu-touch webapp-container
  webbrowser-app
10 upgraded, 5 newly installed, 0 to remove and 278 not upgraded.
Need to get 24.4 MB of archives.
After this operation, 909 kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ubuntu-ports/ vivid/universe libopencore-amrnb0 armhf 0.1.3-2.1 [81.8 kB]
Get:2 http://ppa.launchpad.net/ci-train-ppa-service/stable-snapshot/ubuntu/ vivid/main liboxideqtcore0 armhf 1.9.5-0ubuntu0.15.04.1 [22.1 MB]
Get:3 http://ports.ubuntu.com/ubuntu-ports/ vivid/universe libopencore-amrwb0 armhf 0.1.3-2.1 [41.5 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports/ vivid-updates/main liboxideqt-qmlplugin armhf 1.9.5-0ubuntu0.15.04.1 [168 kB]
Get:5 http://ports.ubuntu.com/ubuntu-ports/ vivid-updates/main liboxideqtquick0 armhf 1.9.5-0ubuntu0.15.04.1 [233 kB]
Get:6 http://ports.ubuntu.com/ubuntu-ports/ vivid-updates/main oxideqt-codecs-extra armhf 1.9.5-0ubuntu0.15.04.1 [769 kB]
Get:7 http://ports.ubuntu.com/ubuntu-ports/ vivid/universe gstreamer1.0-plugins-ugly-amr armhf 1.4.5-1ubuntu2 [16.5 kB]
Get:8 http://ppa.launchpad.net/ci-train-ppa-service/landing-014/ubuntu/ vivid/main qtdeclarative5-ubuntu-ui-extras-browser-plugin armhf 0.23+15.04.20151013.1-0ubuntu1 [10.7 kB]
Get:9 http://ppa.launchpad.net/ci-train-ppa-service/landing-014/ubuntu/ vivid/main webapp-container armhf 0.23+15.04.20151013.1-0ubuntu1 [142 kB]
Get:10 http://ppa.launchpad.net/ci-train-ppa-service/landing-014/ubuntu/ vivid/main webbrowser-app armhf 0.23+15.04.20151013.1-0ubuntu1 [722 kB]
Get:11 http://ppa.launchpad.net/ci-train-ppa-service/landing-014/ubuntu/ vivid/main qtdeclarative5-ubuntu-web-plugin armhf 0.23+15.04.20151013.1-0ubuntu1 [17.5 kB]
Get:12 http://ppa.launchpad.net/ci-train-ppa-service/stable-snapshot/ubuntu/ vivid/main libindicator-transfer0 armhf 0.2+15.04.20150929.is.0.2+15.10.20150819-0ubuntu1 [43.2 kB]
Get:13 http://ppa.launchpad.net/ci-train-ppa-service/stable-snapshot/ubuntu/ vivid/main indicator-transfer armhf 0.2+15.04.20150929.is.0.2+1...

Read more...

349. By Robert Bruce Park

Stop forcing ubuntu-touch.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
350. By Robert Bruce Park

Appease static code checker.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

> And, liboxideqt-qmlplugin, liboxideqtquick0, oxideqt-codecs-extra,
> gstreamer1.0-plugins-ugly-amr were installed from vivid archive, but
> it's not clear to me if those are needed by the silo or not. oxide is
> related to webbrowser-app.

Silo 14 doesn’t require an oxide version bump, so the version that was already installed on the device you tested on was sufficient. Therefore I think that the upgrade shouldn’t have happened, if the tool was meant to install only packages from the silo.

Revision history for this message
Robert Bruce Park (robru) wrote :

Ugh.

Thanks for clarifying.

Revision history for this message
Olivier Tilloy (osomon) wrote :

> The autoremove is seemingly correct in the sense that it didn't
> uninstall the entire world, but I'm not sure if this removal is
> correct or not.

The removal is expected, that package doesn’t exist anymore (it was removed in the ota7 dev cycle).

351. By Robert Bruce Park

Use dist-upgrade again with clever pinning.

Revision history for this message
Robert Bruce Park (robru) wrote :
Download full text (3.3 KiB)

Ok, I think I've got this, here's the results on silo 56:

The following packages will be upgraded:
  libaccounts-qt5-1 libonline-accounts-client1 libsignon-extension1
  libsignon-plugins-common1 libsignon-qt5-1 qml-module-ubuntu-onlineaccounts
  qml-module-ubuntu-onlineaccounts-client qtdeclarative5-accounts-plugin
  qtdeclarative5-online-accounts-client0.1 signon-plugin-oauth2
  signon-plugin-password signond
12 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 407 kB of archives.
After this operation, 2,048 B of additional disk space will be used.
Get:1 http://ppa.launchpad.net/ci-train-ppa-service/landing-056/ubuntu/ vivid/main libaccounts-qt5-1 armhf 1.14+15.04.20150930-0ubuntu1 [28.7 kB]
Get:2 http://ppa.launchpad.net/ci-train-ppa-service/landing-056/ubuntu/ vivid/main libonline-accounts-client1 armhf 0.7+15.04.20151009.2-0ubuntu1 [13.7 kB]
Get:3 http://ppa.launchpad.net/ci-train-ppa-service/landing-056/ubuntu/ vivid/main libsignon-extension1 armhf 8.58+15.04.20151001-0ubuntu1 [18.8 kB]
Get:4 http://ppa.launchpad.net/ci-train-ppa-service/landing-056/ubuntu/ vivid/main libsignon-plugins-common1 armhf 8.58+15.04.20151001-0ubuntu1 [16.2 kB]
Get:5 http://ppa.launchpad.net/ci-train-ppa-service/landing-056/ubuntu/ vivid/main libsignon-qt5-1 armhf 8.58+15.04.20151001-0ubuntu1 [54.3 kB]
Get:6 http://ppa.launchpad.net/ci-train-ppa-service/landing-056/ubuntu/ vivid/main qml-module-ubuntu-onlineaccounts armhf 0.6+15.04.20151007-0ubuntu1 [47.7 kB]
Get:7 http://ppa.launchpad.net/ci-train-ppa-service/landing-056/ubuntu/ vivid/main qml-module-ubuntu-onlineaccounts-client armhf 0.7+15.04.20151009.2-0ubuntu1 [6,988 B]
Get:8 http://ppa.launchpad.net/ci-train-ppa-service/landing-056/ubuntu/ vivid/main qtdeclarative5-accounts-plugin armhf 0.6+15.04.20151007-0ubuntu1 [1,390 B]
Get:9 http://ppa.launchpad.net/ci-train-ppa-service/landing-056/ubuntu/ vivid/main qtdeclarative5-online-accounts-client0.1 armhf 0.7+15.04.20151009.2-0ubuntu1 [1,462 B]
Get:10 http://ppa.launchpad.net/ci-train-ppa-service/landing-056/ubuntu/ vivid/main signon-plugin-oauth2 armhf 0.23+15.04.20151001.1-0ubuntu1 [52.4 kB]
Get:11 http://ppa.launchpad.net/ci-train-ppa-service/landing-056/ubuntu/ vivid/main signond armhf 8.58+15.04.20151001-0ubuntu1 [153 kB]
Get:12 http://ppa.launchpad.net/ci-train-ppa-service/landing-056/ubuntu/ vivid/main signon-plugin-password armhf 8.58+15.04.20151001-0ubuntu1 [11.9 kB]
Fetched 407 kB in 4s (99.6 kB/s)

So it's only installed packages from silo 56, nothing from vivid and nothing from stable snapshot ppa.

$ adb shell apt-cache policy signond
signond:
  Installed: 8.58+15.04.20151001-0ubuntu1
  Candidate: 8.58+15.04.20151001-0ubuntu1
  Version table:
 *** 8.58+15.04.20151001-0ubuntu1 0
       1100 http://ppa.launchpad.net/ci-train-ppa-service/landing-056/ubuntu/ vivid/main armhf Packages
        100 /var/lib/dpkg/status
     8.57+15.04.20150616-0ubuntu1 0
         50 http://ppa.launchpad.net/ci-train-ppa-service/stable-snapshot/ubuntu/ vivid/main armhf Packages
     8.57+15.04.20150204.1-0ubuntu1 0
         50 http://ports.ubuntu.com/ubuntu-ports/ vivid/main armhf Packages

this shows the correct silo pinned at 1100...

Read more...

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
352. By Robert Bruce Park

Drop unused var.

353. By Robert Bruce Park

Appease shellcheck & check-bashisms simultaneously.

354. By Robert Bruce Park

Simplify lsb-release parsing.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
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
Robert Bruce Park (robru) wrote :

Saviq reports this is working for him also.

355. By Robert Bruce Park

Use --force-yes for maximum yesness.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'citrain'
2--- citrain 2015-09-25 18:10:53 +0000
3+++ citrain 2015-10-14 22:35:53 +0000
4@@ -8,7 +8,7 @@
5 # MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
6 # PURPOSE. See the applicable version of the GNU General Public
7 # License for more details.
8-#.
9+#
10 # You should have received a copy of the GNU General Public License
11 # along with this program. If not, see <http://www.gnu.org/licenses/>.
12 #
13@@ -16,7 +16,7 @@
14
15 usage () {
16 cat <<EOF
17-usage: $0 COMMAND SILO-NUMBER [DEVICE-PASSWORD] [DISTRIBUTION]
18+usage: $0 COMMAND SILO-NUMBER [DEVICE-PASSWORD]
19 $1
20
21 COMMANDS:
22@@ -26,10 +26,6 @@
23 device-upgrade Upgrades your connected device with packages from the silo.
24 host-purge Uses ppa-purge to uninstall the silo contents from the host machine.
25 device-purge Not implemented.
26-
27-DISTRIBUTION: (optional)
28- ubuntu
29- ubuntu-rtm
30 EOF
31 exit 1
32 }
33@@ -37,8 +33,9 @@
34 [ -x /usr/bin/sudo ] || { echo "Please install 'sudo'"; exit 1; }
35 [ -x /usr/bin/add-apt-repository ] || { echo "Please install 'software-properties-common'"; exit 1; }
36
37-if [ -f "$(dirname $0)/shell-adb-common.sh" ]; then
38- . "$(dirname $0)/shell-adb-common.sh"
39+DIR=$(dirname "$0")
40+if [ -f "$DIR/shell-adb-common.sh" ]; then
41+ . "$DIR/shell-adb-common.sh"
42 else
43 . "/usr/share/phabletutils/shell-adb-common.sh"
44 fi
45@@ -60,7 +57,7 @@
46 case "$COMMAND" in
47 host-upgrade)
48 set -x
49- sudo add-apt-repository $PPA/$SILO
50+ sudo add-apt-repository "$PPA/$SILO"
51 sudo apt-get update -qq
52 sudo apt-get dist-upgrade --yes
53 ;;
54@@ -72,36 +69,29 @@
55 [ $# -gt 0 ] && shift || usage "Missing DEVICE-PASSWORD"
56
57 set -x
58+ SERIES=$(adb shell lsb_release -cs | tr -d '\r')
59+ DISTRO=$(adb shell lsb_release -is | tr -d '\r' | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
60+
61 adb shell egrep ^deb /etc/apt/sources.list.d/\*.list
62- DISTRO="$1"
63- if [ -z $DISTRO ]; then
64- # In case no distro specified, guess
65- if adb shell system-image-cli -i | grep -q ubuntu-rtm; then
66- DISTRO="ubuntu-rtm"
67- else
68- DISTRO="ubuntu"
69- fi
70- fi
71 adb shell "echo -e '#\x21/bin/sh\necho $PASSWORD' >/tmp/askpass.sh"
72 adb shell chmod +x /tmp/askpass.sh
73 adb shell SUDO_ASKPASS=/tmp/askpass.sh sudo -A touch /userdata/.adb_onlock
74 adb shell SUDO_ASKPASS=/tmp/askpass.sh sudo -A mount -o remount,rw /
75- adb shell SUDO_ASKPASS=/tmp/askpass.sh sudo -A add-apt-repository -y $PPA/$DISTRO/$SILO
76+ adb shell SUDO_ASKPASS=/tmp/askpass.sh sudo -A add-apt-repository -y "$PPA/$DISTRO/$SILO"
77
78 adb shell "test -e /usr/sbin/policy-rc.d && cp /usr/sbin/policy-rc.d /tmp/policy-rc.d"
79 adb shell "echo 'exit 101' | SUDO_ASKPASS=/tmp/askpass.sh sudo -A tee /usr/sbin/policy-rc.d"
80 adb shell SUDO_ASKPASS=/tmp/askpass.sh sudo -A chmod +x /usr/sbin/policy-rc.d
81- adb shell "echo -e 'Package: *\nPin: release o=LP-PPA-ci-train-ppa-service-$SILO\nPin-Priority: 1100' | SUDO_ASKPASS=/tmp/askpass.sh sudo -A tee /etc/apt/preferences.d/silo-$SILO.pref"
82- adb shell SUDO_ASKPASS=/tmp/askpass.sh sudo -A apt-get -o Dir::Etc::SourceList=/dev/null update
83+ adb shell "echo -e 'Package: *\nPin: release o=*$SILO*\nPin-Priority: 1100\n\nPackage: *\nPin: release a=$SERIES*\nPin-Priority: 50' | SUDO_ASKPASS=/tmp/askpass.sh sudo -A tee /etc/apt/preferences.d/extra-ppas.pref"
84+ adb shell SUDO_ASKPASS=/tmp/askpass.sh sudo -A apt-get update
85
86 # We need to put lxc-android-config on hold here as it's the only
87 # package which must be upgrade by hand through the recovery. See
88 # https://wiki.ubuntu.com/Touch/Testing/lxc-android-config for details.
89 adb shell SUDO_ASKPASS=/tmp/askpass.sh sudo -A apt-mark hold lxc-android-config
90
91- adb shell SUDO_ASKPASS=/tmp/askpass.sh sudo -A apt-get dist-upgrade --yes
92- adb shell SUDO_ASKPASS=/tmp/askpass.sh sudo -A apt-get update
93- adb shell SUDO_ASKPASS=/tmp/askpass.sh sudo -A apt-get autoremove --yes
94+ adb shell SUDO_ASKPASS=/tmp/askpass.sh sudo -A apt-get dist-upgrade --yes --force-yes
95+ adb shell SUDO_ASKPASS=/tmp/askpass.sh sudo -A apt-get autoremove --yes --force-yes
96
97 adb shell "test ! -e /tmp/policy-rc.d && SUDO_ASKPASS=/tmp/askpass.sh sudo -A rm /usr/sbin/policy-rc.d"
98 adb shell "test -e /tmp/policy-rc.d && SUDO_ASKPASS=/tmp/askpass.sh sudo -A mv /tmp/policy-rc.d /usr/sbin/policy-rc.d"
99@@ -113,7 +103,7 @@
100
101 host-purge)
102 set -x
103- sudo ppa-purge $PPA/$SILO
104+ sudo ppa-purge "$PPA/$SILO"
105 ;;
106
107 device-purge)

Subscribers

People subscribed via source and target branches