Merge lp:~mterry/unity8/snap-root2 into lp:unity8

Proposed by Michael Terry on 2016-10-07
Status: Merged
Approved by: Michael Zanetti on 2016-11-01
Approved revision: 2631
Merged at revision: 2685
Proposed branch: lp:~mterry/unity8/snap-root2
Merge into: lp:unity8
Prerequisite: lp:~mterry/unity8/snap-root
Diff against target: 232 lines (+40/-21)
10 files modified
data/unity8-dash.conf (+1/-1)
data/unity8-filewatcher.conf (+5/-0)
data/unity8-greeter-wrapper (+6/-6)
plugins/LightDM/SessionsModel.cpp (+8/-0)
plugins/Utils/constants.cpp (+6/-1)
plugins/Utils/constants.h (+5/-5)
qml/Shell.qml (+1/-1)
src/ShellApplication.cpp (+1/-1)
tests/mocks/Utils/constants.cpp (+2/-1)
tests/mocks/Utils/constants.h (+5/-5)
To merge this branch: bzr merge lp:~mterry/unity8/snap-root2
Reviewer Review Type Date Requested Status
Michael Zanetti (community) 2016-10-07 Approve on 2016-11-01
Unity8 CI Bot continuous-integration Approve on 2016-10-11
Review via email: mp+307981@code.launchpad.net

Commit Message

More path lookup fixes for running inside of a snap.

Description of the Change

Some more fixes I missed the first time.

- Stop using so many hardcoded binary paths, PATH lookup works just fine there.
- Prefix the default icon lookup paths for session icons in the greeter.
- Fix default wallpaper lookup.

= Checklist =

 * Are there any related MPs required for this MP to build/function as expected? Please list.
 Just pre-req, which isn't *strictly* needed, but makes it easier to test the snappy changes as a whole.

 * Did you perform an exploratory manual test run of your code change and any related functionality?
 Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
 NA

 * If you changed the UI, has there been a design review?
 NA

To post a comment you must log in.
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2630
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2345/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3087
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1733
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1733
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1733
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3115
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2972
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2972/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2972
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2972/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2972
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2972/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2972
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2972/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2972
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2972/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2972
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2972/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2972
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2972/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2972
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2972/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2972
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2972/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2345/rebuild

review: Needs Fixing (continuous-integration)
lp:~mterry/unity8/snap-root2 updated on 2016-10-11
2631. By Michael Terry on 2016-10-11

And update mock plugin too, whoops

Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2631
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2356/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3107
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1753
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1753
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1753
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3135
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2991
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2991/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2991
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2991/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2991
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2991/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2991
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2991/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2991
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2991/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2991
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2991/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2991
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2991/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2991
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2991/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2991
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2991/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2356/rebuild

review: Approve (continuous-integration)
Michael Zanetti (mzanetti) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?

yes. seems to merge and run fine still

 * Did CI run pass? If not, please explain why.

it did

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/unity8-dash.conf'
2--- data/unity8-dash.conf 2016-03-09 22:02:37 +0000
3+++ data/unity8-dash.conf 2016-10-11 13:17:22 +0000
4@@ -22,4 +22,4 @@
5 initctl emit scope-ui-starting
6 end script
7
8-exec ${BINARY:-unity8-dash} $ARGS --desktop_file_hint=/usr/share/applications/unity8-dash.desktop
9+exec ${BINARY:-unity8-dash} $ARGS --desktop_file_hint=unity8-dash.desktop
10
11=== modified file 'data/unity8-filewatcher.conf'
12--- data/unity8-filewatcher.conf 2014-08-22 11:19:51 +0000
13+++ data/unity8-filewatcher.conf 2016-10-11 13:17:22 +0000
14@@ -1,6 +1,11 @@
15 description "File system watcher for unity8"
16 author "Michael Zanetti <michael.zanetti@canonical.com>"
17
18+# This method of updating the launcher will not work in our new snappy world,
19+# neither for snaps installed in the system nor if we are running inside a snap.
20+# Plus it hardcodes the phablet user... To be replaced once bug 1630997 is
21+# fixed in ubuntu-app-launch.
22+
23 # Workaround for bug 1360208. ~ and * in one expression doesn't work currently
24 start on (file FILE=/home/phablet/.local/share/applications/*.desktop) or (file FILE=/usr/share/applications/*.desktop)
25
26
27=== modified file 'data/unity8-greeter-wrapper'
28--- data/unity8-greeter-wrapper 2016-07-19 16:40:19 +0000
29+++ data/unity8-greeter-wrapper 2016-10-11 13:17:22 +0000
30@@ -45,8 +45,8 @@
31
32 # If touch session script (which sets up grid units and mir variables) is available, use it
33 TOUCH_WRAPPER=
34-if [ -x /usr/bin/ubuntu-touch-session ]; then
35- TOUCH_WRAPPER=/usr/bin/ubuntu-touch-session
36+if which ubuntu-touch-session >/dev/null; then
37+ TOUCH_WRAPPER=ubuntu-touch-session
38 fi
39
40 # Pretend that we're in an ubuntu-touch session, so that indicator-network
41@@ -63,7 +63,7 @@
42 # creates for them and don't want to start all the services that a normal
43 # session would. So it's inconvenient to live within an upstart session.
44 # But... we still want to use Upstart for some services. So launch here.
45-MIR_SOCKET=$SUB_SOCKET $TOUCH_WRAPPER /sbin/upstart --user --no-startup-event &
46+MIR_SOCKET=$SUB_SOCKET $TOUCH_WRAPPER upstart --user --no-startup-event &
47 INIT_PID=$!
48 while [ ! -e "$XDG_RUNTIME_DIR/upstart/sessions/$INIT_PID.session" ]; do sleep 0.1; done
49 . "$XDG_RUNTIME_DIR/upstart/sessions/$INIT_PID.session"
50@@ -72,11 +72,11 @@
51 # Connect upstart to system, but do first command in a loop to avoid any
52 # race condition between the session file above being written and upstart being
53 # ready to handle requests.
54-while ! /sbin/initctl notify-dbus-address "$DBUS_SESSION_BUS_ADDRESS"; do sleep 0.1; done
55-/sbin/initctl start notify-cgmanager
56+while ! initctl notify-dbus-address "$DBUS_SESSION_BUS_ADDRESS"; do sleep 0.1; done
57+initctl start notify-cgmanager
58
59 # Start any pre-greeter tasks if needed (like wizard)
60-/sbin/initctl emit unity8-greeter-starting
61+initctl emit unity8-greeter-starting
62
63 # Define language here for phone if available. When phone user switches their
64 # language, they expect that to affect the greeter too. But the user doesn't
65
66=== modified file 'plugins/LightDM/SessionsModel.cpp'
67--- plugins/LightDM/SessionsModel.cpp 2016-06-15 20:28:58 +0000
68+++ plugins/LightDM/SessionsModel.cpp 2016-10-11 13:17:22 +0000
69@@ -119,6 +119,14 @@
70 m_roleNames = m_model->roleNames();
71 m_roleNames[IconRole] = "icon_url";
72
73+ // Update search locations to use $SNAP prefix if specified
74+ auto snapRoot = QFile::decodeName(qgetenv("SNAP"));
75+ if (!snapRoot.isEmpty()) {
76+ for (int i = 0; i < m_iconSearchDirectories.size(); i++) {
77+ m_iconSearchDirectories[i] = snapRoot + m_iconSearchDirectories[i].path();
78+ }
79+ }
80+
81 setModel(m_model);
82 setSourceModel(m_model);
83 setSortCaseSensitivity(Qt::CaseInsensitive);
84
85=== modified file 'plugins/Utils/constants.cpp'
86--- plugins/Utils/constants.cpp 2015-11-20 15:01:39 +0000
87+++ plugins/Utils/constants.cpp 2016-10-11 13:17:22 +0000
88@@ -1,5 +1,5 @@
89 /*
90- * Copyright 2015 Canonical Ltd.
91+ * Copyright 2015-2016 Canonical Ltd.
92 *
93 * This program is free software; you can redistribute it and/or modify
94 * it under the terms of the GNU Lesser General Public License as published by
95@@ -16,6 +16,8 @@
96
97 #include "constants.h"
98
99+#include <QFile>
100+
101 Constants::Constants(QObject *parent)
102 : QObject(parent)
103 {
104@@ -24,4 +26,7 @@
105 } else {
106 m_indicatorValueTimeout = 5000;
107 }
108+
109+ QString snapRoot = QFile::decodeName(qgetenv("SNAP"));
110+ m_defaultWallpaper = snapRoot + "/usr/share/backgrounds/warty-final-ubuntu.png";
111 }
112
113=== modified file 'plugins/Utils/constants.h'
114--- plugins/Utils/constants.h 2015-03-11 08:07:31 +0000
115+++ plugins/Utils/constants.h 2016-10-11 13:17:22 +0000
116@@ -1,5 +1,5 @@
117 /*
118- * Copyright 2015 Canonical Ltd.
119+ * Copyright 2015-2016 Canonical Ltd.
120 *
121 * This program is free software; you can redistribute it and/or modify
122 * it under the terms of the GNU Lesser General Public License as published by
123@@ -14,8 +14,7 @@
124 * along with this program. If not, see <http://www.gnu.org/licenses/>.
125 */
126
127-#ifndef CONSTANTS_H
128-#define CONSTANTS_H
129+#pragma once
130
131 #include <QObject>
132
133@@ -30,14 +29,15 @@
134 {
135 Q_OBJECT
136 Q_PROPERTY(int indicatorValueTimeout READ indicatorValueTimeout CONSTANT)
137+ Q_PROPERTY(QString defaultWallpaper READ defaultWallpaper CONSTANT)
138
139 public:
140 Constants(QObject *parent = 0);
141
142 int indicatorValueTimeout() const { return m_indicatorValueTimeout; }
143+ QString defaultWallpaper() const { return m_defaultWallpaper; }
144
145 private:
146 int m_indicatorValueTimeout;
147+ QString m_defaultWallpaper;
148 };
149-
150-#endif
151
152=== modified file 'qml/Shell.qml'
153--- qml/Shell.qml 2016-09-22 07:42:01 +0000
154+++ qml/Shell.qml 2016-10-11 13:17:22 +0000
155@@ -148,7 +148,7 @@
156 id: wallpaperResolver
157 objectName: "wallpaperResolver"
158
159- readonly property url defaultBackground: "file:///usr/share/backgrounds/warty-final-ubuntu.png"
160+ readonly property url defaultBackground: "file://" + Constants.defaultWallpaper
161 readonly property bool hasCustomBackground: background != defaultBackground
162
163 // Use a cached version of the scaled-down wallpaper (as sometimes the
164
165=== modified file 'src/ShellApplication.cpp'
166--- src/ShellApplication.cpp 2016-05-25 22:12:35 +0000
167+++ src/ShellApplication.cpp 2016-10-11 13:17:22 +0000
168@@ -117,7 +117,7 @@
169 m_shellView->setWidth(primaryScreenSize.width());
170 m_shellView->show();
171 m_shellView->requestActivate();
172- if (!QProcess::startDetached("/sbin/initctl emit --no-wait unity8-greeter-started")) {
173+ if (!QProcess::startDetached("initctl emit --no-wait unity8-greeter-started")) {
174 qDebug() << "Unable to send unity8-greeter-started event to Upstart";
175 }
176 } else if (isMirServer || parser.hasFullscreen()) {
177
178=== modified file 'tests/mocks/Utils/constants.cpp'
179--- tests/mocks/Utils/constants.cpp 2015-04-15 14:52:01 +0000
180+++ tests/mocks/Utils/constants.cpp 2016-10-11 13:17:22 +0000
181@@ -1,5 +1,5 @@
182 /*
183- * Copyright 2015 Canonical Ltd.
184+ * Copyright 2015-2016 Canonical Ltd.
185 *
186 * This program is free software; you can redistribute it and/or modify
187 * it under the terms of the GNU Lesser General Public License as published by
188@@ -20,4 +20,5 @@
189 : QObject(parent)
190 {
191 m_indicatorValueTimeout = 5000;
192+ m_defaultWallpaper = "/usr/share/backgrounds/warty-final-ubuntu.png";
193 }
194
195=== modified file 'tests/mocks/Utils/constants.h'
196--- tests/mocks/Utils/constants.h 2015-04-15 14:52:01 +0000
197+++ tests/mocks/Utils/constants.h 2016-10-11 13:17:22 +0000
198@@ -1,5 +1,5 @@
199 /*
200- * Copyright 2015 Canonical Ltd.
201+ * Copyright 2015-2016 Canonical Ltd.
202 *
203 * This program is free software; you can redistribute it and/or modify
204 * it under the terms of the GNU Lesser General Public License as published by
205@@ -14,8 +14,7 @@
206 * along with this program. If not, see <http://www.gnu.org/licenses/>.
207 */
208
209-#ifndef CONSTANTS_H
210-#define CONSTANTS_H
211+#pragma once
212
213 #include <QObject>
214
215@@ -30,14 +29,15 @@
216 {
217 Q_OBJECT
218 Q_PROPERTY(int indicatorValueTimeout READ indicatorValueTimeout CONSTANT)
219+ Q_PROPERTY(QString defaultWallpaper READ defaultWallpaper CONSTANT)
220
221 public:
222 Constants(QObject *parent = 0);
223
224 int indicatorValueTimeout() const { return m_indicatorValueTimeout; }
225+ QString defaultWallpaper() const { return m_defaultWallpaper; }
226
227 private:
228 int m_indicatorValueTimeout;
229+ QString m_defaultWallpaper;
230 };
231-
232-#endif

Subscribers

People subscribed via source and target branches