Merge lp:~michihenning/unity-scopes-api/create-applications-dir into lp:unity-scopes-api/devel

Proposed by Michi Henning
Status: Merged
Approved by: Marcus Tomlinson
Approved revision: 696
Merged at revision: 695
Proposed branch: lp:~michihenning/unity-scopes-api/create-applications-dir
Merge into: lp:unity-scopes-api/devel
Diff against target: 117 lines (+32/-5)
5 files modified
debian/changelog (+6/-0)
include/unity/scopes/internal/RegistryObject.h (+2/-1)
scoperegistry/scoperegistry.cpp (+7/-0)
src/scopes/internal/RegistryObject.cpp (+3/-3)
test/gtest/scopes/Registry/Registry_test.cpp (+14/-1)
To merge this branch: bzr merge lp:~michihenning/unity-scopes-api/create-applications-dir
Reviewer Review Type Date Requested Status
unity-api-1-bot continuous-integration Needs Fixing
Marcus Tomlinson (community) Approve
Review via email: mp+312607@code.launchpad.net

Commit message

Create $HOME/.local/share/applications if it does not exist.

Description of the change

Create $HOME/.local/share/applications if it does not exist.

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

FAILED: Continuous integration, rev:696
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scopes-api-ci/66/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build/1232/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/1239
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1022
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1022/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1022
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1022/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1022/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1022/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1022
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1022/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1022
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1022/artifact/output/*zip*/output.zip

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

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

PASSED: Continuous integration, rev:696
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scopes-api-ci/68/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/1237
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/1244
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1027
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1027/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1027
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1027/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1027
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1027/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1027
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1027/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1027
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1027/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1027
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1027/artifact/output/*zip*/output.zip

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

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

Thanks Michi

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

FAILED: Autolanding.
More details in the following jenkins job:
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scopes-api-autoland/6/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build/1251/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/1258
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1041
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1041/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1041
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1041/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1041/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1041/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1041
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1041/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1041
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1041/artifact/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2016-11-15 06:09:04 +0000
3+++ debian/changelog 2016-12-07 00:57:19 +0000
4@@ -1,3 +1,9 @@
5+unity-scopes-api (1.0.8) UNRELEASED; urgency=medium
6+
7+ * Create $HOME/.local/share/applications if it does not exist. lp:1645798
8+
9+ -- Michi Henning <michi.henning@canonical.com> Wed, 07 Dec 2016 10:54:55 +1000
10+
11 unity-scopes-api (1.0.7+17.04.20161115-0ubuntu1) zesty; urgency=medium
12
13 * Be stricter on user-configurable idle timeout (1s to 5min).
14
15=== modified file 'include/unity/scopes/internal/RegistryObject.h'
16--- include/unity/scopes/internal/RegistryObject.h 2016-02-22 00:19:46 +0000
17+++ include/unity/scopes/internal/RegistryObject.h 2016-12-07 00:57:19 +0000
18@@ -78,11 +78,12 @@
19
20 StateReceiverObject::SPtr state_receiver();
21
22+ static std::string desktop_files_dir();
23+
24 private:
25 void on_process_death(core::posix::ChildProcess const& process);
26 void on_state_received(std::string const& scope_id, StateReceiverObject::State const& state);
27
28- static std::string desktop_files_dir();
29 void create_desktop_file(ScopeMetadata const& metadata);
30 void remove_desktop_file(std::string const& scope_id);
31
32
33=== modified file 'scoperegistry/scoperegistry.cpp'
34--- scoperegistry/scoperegistry.cpp 2016-04-01 06:05:09 +0000
35+++ scoperegistry/scoperegistry.cpp 2016-12-07 00:57:19 +0000
36@@ -496,6 +496,13 @@
37 string tmp_dir = string("/run/user/") + std::to_string(geteuid()) + "/scopes/leaf-net";
38 make_directories(tmp_dir, 0700);
39
40+ // Make sure that the directory for .desktop files exists.
41+ string desktop_files_dir = RegistryObject::desktop_files_dir();
42+ if (!desktop_files_dir.empty())
43+ {
44+ make_directories(desktop_files_dir, 0700);
45+ }
46+
47 // Collect the registry config data.
48
49 string mw_kind;
50
51=== modified file 'src/scopes/internal/RegistryObject.cpp'
52--- src/scopes/internal/RegistryObject.cpp 2016-02-22 01:29:01 +0000
53+++ src/scopes/internal/RegistryObject.cpp 2016-12-07 00:57:19 +0000
54@@ -404,13 +404,13 @@
55
56 void RegistryObject::create_desktop_file(ScopeMetadata const& metadata)
57 {
58- std::string desktop_file_path = desktop_files_dir();
59- if (!generate_desktop_files_ || desktop_file_path.empty())
60+ static std::string const desktop_files_dir = RegistryObject::desktop_files_dir();
61+ if (!generate_desktop_files_ || desktop_files_dir.empty())
62 {
63 return;
64 }
65
66- desktop_file_path += "/" + metadata.scope_id() + ".desktop";
67+ std::string const desktop_file_path = desktop_files_dir + "/" + metadata.scope_id() + ".desktop";
68
69 std::ofstream desktop_file(desktop_file_path.c_str());
70 if (!desktop_file)
71
72=== modified file 'test/gtest/scopes/Registry/Registry_test.cpp'
73--- test/gtest/scopes/Registry/Registry_test.cpp 2016-11-24 13:28:37 +0000
74+++ test/gtest/scopes/Registry/Registry_test.cpp 2016-12-07 00:57:19 +0000
75@@ -83,6 +83,12 @@
76 std::condition_variable cond_;
77 };
78
79+TEST(Registry, desktop_dir_does_not_exist)
80+{
81+ // Directory does not exist to start with.
82+ EXPECT_FALSE(filesystem::is_directory(TEST_RUNTIME_PATH "/applications"));
83+}
84+
85 TEST(Registry, metadata)
86 {
87 Runtime::UPtr rt = Runtime::create(TEST_RUNTIME_FILE);
88@@ -156,6 +162,12 @@
89 EXPECT_FALSE(meta.is_aggregator());
90 }
91
92+TEST(Registry, desktop_dir_exists)
93+{
94+ // Directory must have been created.
95+ EXPECT_TRUE(filesystem::is_directory(TEST_RUNTIME_PATH "/applications"));
96+}
97+
98 auto const wait_for_update_time = std::chrono::milliseconds(5000);
99
100 TEST(Registry, scope_state_notify)
101@@ -694,6 +706,7 @@
102
103 // Unlink in case we left the link behind from an earlier interrupted run.
104 system::error_code ec;
105+ filesystem::remove_all(TEST_RUNTIME_PATH "/applications", ec);
106 filesystem::remove_all(TEST_RUNTIME_PATH "/scopes/testscopeC", ec);
107 filesystem::remove_all(TEST_RUNTIME_PATH "/click",ec);
108 filesystem::remove(TEST_RUNTIME_PATH "/scopes/testscopeD", ec);
109@@ -701,7 +714,7 @@
110 filesystem::remove(TEST_RUNTIME_PATH "/scopes/testscopeB/testscopeB-settings.ini", ec);
111
112 // Set the "TEST_DESKTOP_FILES_DIR" env var before forking as not to create desktop files in ~/.local
113- putenv(const_cast<char*>("TEST_DESKTOP_FILES_DIR=" TEST_RUNTIME_PATH));
114+ putenv(const_cast<char*>("TEST_DESKTOP_FILES_DIR=" TEST_RUNTIME_PATH "/applications"));
115
116 auto rpid = fork();
117 if (rpid == 0)

Subscribers

People subscribed via source and target branches

to all changes: