Merge lp:~mterry/unity-scopes-shell/snap-root into lp:unity-scopes-shell

Proposed by Michael Terry
Status: Merged
Approved by: Marcus Tomlinson
Approved revision: 346
Merged at revision: 352
Proposed branch: lp:~mterry/unity-scopes-shell/snap-root
Merge into: lp:unity-scopes-shell
Diff against target: 14 lines (+2/-1)
1 file modified
src/Unity/scopes.cpp (+2/-1)
To merge this branch: bzr merge lp:~mterry/unity-scopes-shell/snap-root
Reviewer Review Type Date Requested Status
Marcus Tomlinson (community) Approve
unity-api-1-bot continuous-integration Approve
Review via email: mp+307850@code.launchpad.net

Commit message

Handle running inside a snap by paying attention to the $SNAP prefix.

Description of the change

Handle running inside a snap by paying attention to the $SNAP prefix.

To post a comment you must log in.
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:346
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scopes-shell-ci/3/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/835
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/842
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/649
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/649/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/649
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/649/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/649
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/649/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/649
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/649/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/649
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/649/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/649
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/649/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/649
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/649/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/649
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/649/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/649
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/649/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scopes-shell-ci/3/rebuild

review: Approve (continuous-integration)
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Unity/scopes.cpp'
2--- src/Unity/scopes.cpp 2016-06-23 12:53:21 +0000
3+++ src/Unity/scopes.cpp 2016-10-06 14:45:52 +0000
4@@ -212,8 +212,9 @@
5 {QStringLiteral("libunity-scopes"), QStringLiteral("scopes-api")}});
6
7 // determine versions of unity8, unity-plugin-scopes and libunity-scopes1.0
8+ QString snapRoot = QFile::decodeName(qgetenv("SNAP"));
9 for (QMap<QString, QString>::const_iterator pkg = versions.constBegin(); pkg != versions.constEnd(); pkg++) {
10- QFile versionFile("/var/lib/" + pkg.key() + "/version");
11+ QFile versionFile(snapRoot + "/var/lib/" + pkg.key() + "/version");
12 if (versionFile.open(QIODevice::ReadOnly)) {
13 QTextStream str(&versionFile);
14 QString ver;

Subscribers

People subscribed via source and target branches

to all changes: