Merge lp:~mterry/unity-scope-click/snap-root into lp:unity-scope-click

Proposed by Michael Terry
Status: Rejected
Rejected by: dobey
Proposed branch: lp:~mterry/unity-scope-click/snap-root
Merge into: lp:unity-scope-click
Diff against target: 44 lines (+8/-2)
3 files modified
libclickscope/click/configuration.cpp (+3/-1)
libclickscope/click/configuration.h (+1/-0)
scope/clickapps/apps-query.cpp (+4/-1)
To merge this branch: bzr merge lp:~mterry/unity-scope-click/snap-root
Reviewer Review Type Date Requested Status
dobey (community) Disapprove
unity-api-1-bot continuous-integration Approve
Review via email: mp+307970@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 :
review: Needs Fixing (continuous-integration)
493. By Michael Terry

Handle null getenv return

494. By Michael Terry

And prefix store art too

Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:493
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scope-click-ci/118/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/839
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/846
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/653
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/653/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/653
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/653/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/653
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/653/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/653
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/653/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/653
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/653/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/653
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/653/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/653
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/653/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/653
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/653/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/653
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/653/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scope-click-ci/118/rebuild

review: Approve (continuous-integration)
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:494
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scope-click-ci/119/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/840
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/847
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/654
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/654/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/654
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/654/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/654
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/654/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/654
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/654/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/654
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/654/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/654
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/654/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/654
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/654/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/654
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/654/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/654
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/654/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scope-click-ci/119/rebuild

review: Approve (continuous-integration)
Revision history for this message
dobey (dobey) wrote :

We do not even ship the store scope or show the store result in the apps scope in yakkety/xenial any more, so this seems a bit irrelevant at the moment. We're currently working on a way to get a snap based store enabled, but it will be separate from unity-scope-click, and I'm not sure this will be relevant (at least all of it won't be).

review: Needs Information
Revision history for this message
Michael Terry (mterry) wrote :

Agreed, this is mostly fixing click & store specific stuff. If it's not going to be used going forward, you don't need this.

Revision history for this message
dobey (dobey) wrote :

OK. I'm going to reject this for now, since we don't support a click store any longer in yakkety or xenial+overlay, and have no intentions of bringing the click store scope back on those. We may re-enable the big store result in the apps scope, depending on whether we stick with the apps scope or switch to a possible app drawer in unity8 itself, and I'll keep the need to deal with $SNAP in mind if we do. Thanks.

review: Disapprove
Revision history for this message
Michael Terry (mterry) wrote :

I'm running the in-progress unity8 desktop snap (with fixes in silo 2129), and I'm seeing the tall orange store button (which goes to the snap store, not the click store). But it's missing the logo -- which this MP fixes.

Are we using some of this scope's code to jump into the snap store? In which case we do need this still. (I couldn't find code in the snappy scope to present the orange store button, but I didn't look hard.)

Revision history for this message
dobey (dobey) wrote :

On Mon, 2016-11-07 at 20:19 +0000, Michael Terry wrote:
> I'm running the in-progress unity8 desktop snap (with fixes in silo
> 2129), and I'm seeing the tall orange store button (which goes to the
> snap store, not the click store).  But it's missing the logo -- which
> this MP fixes.
>
> Are we using some of this scope's code to jump into the snap
> store?  In which case we do need this still.  (I couldn't find code
> in the snappy scope to present the orange store button, but I didn't
> look hard.)

Marcus assured me that the scopes API or shell side should be handling
this and prepending the $SNAP value to any paths for artwork and such
that get passed through, and not something we should deal with in the
scope itself.

So it seems like the fix for that is still missing from the other silo
with the api/shell fixes.

Unmerged revisions

494. By Michael Terry

And prefix store art too

493. By Michael Terry

Handle null getenv return

492. By Michael Terry

Respect $SNAP

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libclickscope/click/configuration.cpp'
2--- libclickscope/click/configuration.cpp 2016-02-19 03:35:43 +0000
3+++ libclickscope/click/configuration.cpp 2016-10-07 16:56:28 +0000
4@@ -87,7 +87,9 @@
5 std::vector<std::string> Configuration::get_available_frameworks()
6 {
7 std::vector<std::string> result;
8- for (auto f: list_folder(FRAMEWORKS_FOLDER, FRAMEWORKS_PATTERN)) {
9+ const char* env_snap = std::getenv(SNAP_ENVVAR);
10+ std::string prefix = env_snap ? env_snap : "";
11+ for (auto f: list_folder(prefix + FRAMEWORKS_FOLDER, FRAMEWORKS_PATTERN)) {
12 result.push_back(f.substr(0, f.size()-FRAMEWORKS_EXTENSION_LENGTH));
13 }
14 return result;
15
16=== modified file 'libclickscope/click/configuration.h'
17--- libclickscope/click/configuration.h 2016-08-24 21:36:05 +0000
18+++ libclickscope/click/configuration.h 2016-10-07 16:56:28 +0000
19@@ -43,6 +43,7 @@
20 constexpr static const char* FRAMEWORKS_FOLDER {"/usr/share/click/frameworks/"};
21 constexpr static const char* FRAMEWORKS_PATTERN {"*.framework"};
22 constexpr static const int FRAMEWORKS_EXTENSION_LENGTH = 10; // strlen(".framework")
23+ constexpr static const char* SNAP_ENVVAR {"SNAP"};
24 constexpr static const char* ARCH_ENVVAR {"U1_SEARCH_ARCH"};
25 constexpr static const char* LANGUAGE_ENVVAR {"LANGUAGE"};
26 constexpr static const char* PURCHASES_ENVVAR {"CLICK_STORE_ENABLE_PURCHASES"};
27
28=== modified file 'scope/clickapps/apps-query.cpp'
29--- scope/clickapps/apps-query.cpp 2016-09-22 15:31:55 +0000
30+++ scope/clickapps/apps-query.cpp 2016-10-07 16:56:28 +0000
31@@ -289,9 +289,12 @@
32
33 const unity::scopes::CannedQuery store_scope("com.canonical.scopes.clickstore", querystr, querystr.empty() ? query().department_id() : "");
34
35+ const char* env_snap = getenv("SNAP");
36+ std::string prefix = env_snap ? env_snap : "";
37+
38 scopes::CategorisedResult res(cat);
39 res.set_title(title);
40- res.set_art(STORE_DATA_DIR "/store-scope-icon.svg");
41+ res.set_art(prefix + STORE_DATA_DIR "/store-scope-icon.svg");
42 res.set_uri(store_scope.to_uri());
43 res[click::apps::Query::ResultKeys::NAME] = title;
44 res[click::apps::Query::ResultKeys::DESCRIPTION] = "";

Subscribers

People subscribed via source and target branches

to all changes: