Merge lp:~azzar1/unity/unity-active-plugins--safety-check into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 4158
Proposed branch: lp:~azzar1/unity/unity-active-plugins--safety-check
Merge into: lp:unity
Diff against target: 204 lines (+120/-2)
9 files modified
CMakeLists.txt (+6/-0)
debian/control (+1/-0)
debian/libunity-core-6.0-9.install (+1/-1)
debian/unity-services.install (+1/-1)
debian/unity.install (+1/-0)
plugins/unityshell/unityshell.xml.in (+2/-0)
tools/CMakeLists.txt (+22/-0)
tools/unity_active_plugins_safety_check.cpp (+83/-0)
unity7.conf.in (+3/-0)
To merge this branch: bzr merge lp:~azzar1/unity/unity-active-plugins--safety-check
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+300368@code.launchpad.net

Commit message

Add tools to enforce unityshell plugin for the current profile and add "move" and "resize" plugins as requirements.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Remember to include this into the debian/unity.install file.

Revision history for this message
Andrea Azzarone (azzar1) wrote :

Done. I also moved unity7.conf outside debian dir in order to properly generate the correct paths.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Thanks for the change, but there's still something to fix inside the unity.install file

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Fine

review: Approve
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

After this we've this issue on install:

Preparing to unpack .../unity_7.5.0+16.10.20160726.2-0ubuntu1_amd64.deb ...
Unpacking unity (7.5.0+16.10.20160726.2-0ubuntu1) over (7.5.0+16.10.20160715-0ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/unity_7.5.0+16.10.20160726.2-0ubuntu1_amd64.deb (--unpack):
 trying to overwrite '/usr/share/upstart/sessions/unity7.conf', which is also in package unity-services 7.5.0+16.10.20160726.2-0ubuntu1
Processing triggers for man-db (2.7.5-1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/unity_7.5.0+16.10.20160726.2-0ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

So, please apply this too: http://pastebin.ubuntu.com/21005082/

review: Needs Fixing
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Thanks

review: Approve
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

I still get some issues when upgrading... I think we need to set the debian breaks/replaces properly in core file or, we keep the unity7.conf in the libunity-core-6.0-9.install as it used to be...

review: Needs Fixing
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2016-05-15 02:22:05 +0000
+++ CMakeLists.txt 2016-07-26 16:45:52 +0000
@@ -425,3 +425,9 @@
425 ADDITIONAL_MAKE_CLEAN_FILES api-doc)425 ADDITIONAL_MAKE_CLEAN_FILES api-doc)
426426
427endif (DOXYGEN_FOUND STREQUAL "YES")427endif (DOXYGEN_FOUND STREQUAL "YES")
428
429#
430# Upstart
431#
432configure_file(unity7.conf.in ${CMAKE_CURRENT_BINARY_DIR}/unity7.conf)
433install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unity7.conf DESTINATION ${CMAKE_INSTALL_DATADIR}/upstart/sessions)
428434
=== modified file 'debian/control'
--- debian/control 2016-03-21 15:38:17 +0000
+++ debian/control 2016-07-26 16:45:52 +0000
@@ -18,6 +18,7 @@
18 libbamf3-dev (>= 0.5.3~bzr0),18 libbamf3-dev (>= 0.5.3~bzr0),
19 libboost-dev,19 libboost-dev,
20 libcairo2-dev,20 libcairo2-dev,
21 libcompizconfig0-dev,
21 libdbus-1-dev,22 libdbus-1-dev,
22 libdbusmenu-glib-dev (>= 0.3.91),23 libdbusmenu-glib-dev (>= 0.3.91),
23 libdee-dev (>= 1.2.6),24 libdee-dev (>= 1.2.6),
2425
=== modified file 'debian/libunity-core-6.0-9.install'
--- debian/libunity-core-6.0-9.install 2016-02-09 01:26:22 +0000
+++ debian/libunity-core-6.0-9.install 2016-07-26 16:45:52 +0000
@@ -3,7 +3,7 @@
3usr/share/ccsm3usr/share/ccsm
4usr/share/gnome-control-center/4usr/share/gnome-control-center/
5usr/share/unity5usr/share/unity
6usr/share/upstart/sessions/unity7.conf
6debian/unity-crashdb.conf etc/apport/crashdb.conf.d/7debian/unity-crashdb.conf etc/apport/crashdb.conf.d/
7debian/source_unity.py usr/share/apport/package-hooks8debian/source_unity.py usr/share/apport/package-hooks
8debian/unity7.conf usr/share/upstart/sessions
9tools/convert-files/* usr/lib/compiz/migration/9tools/convert-files/* usr/lib/compiz/migration/
1010
=== modified file 'debian/unity-services.install'
--- debian/unity-services.install 2016-02-09 01:26:22 +0000
+++ debian/unity-services.install 2016-07-26 16:45:52 +0000
@@ -1,3 +1,3 @@
1usr/lib/*/unity/*service1usr/lib/*/unity/*service
2usr/share/upstart2usr/share/upstart/sessions/unity-panel-service*.conf
3usr/share/man/*/unity-panel-service.13usr/share/man/*/unity-panel-service.1
44
=== modified file 'debian/unity.install'
--- debian/unity.install 2016-02-09 01:26:22 +0000
+++ debian/unity.install 2016-07-26 16:45:52 +0000
@@ -1,6 +1,7 @@
1etc/pam.d1etc/pam.d
2usr/bin2usr/bin
3usr/lib/*/compiz/libunity*.so3usr/lib/*/compiz/libunity*.so
4usr/lib/*/unity/unity-active-plugins-safety-check
4usr/share/man/*/unity.15usr/share/man/*/unity.1
5usr/share/compiz6usr/share/compiz
6usr/share/locale7usr/share/locale
78
=== modified file 'plugins/unityshell/unityshell.xml.in'
--- plugins/unityshell/unityshell.xml.in 2016-04-05 13:23:27 +0000
+++ plugins/unityshell/unityshell.xml.in 2016-07-26 16:45:52 +0000
@@ -39,6 +39,8 @@
39 <plugin>compiztoolbox</plugin>39 <plugin>compiztoolbox</plugin>
40 <plugin>scale</plugin>40 <plugin>scale</plugin>
41 <plugin>expo</plugin>41 <plugin>expo</plugin>
42 <plugin>move</plugin>
43 <plugin>resize</plugin>
42 </requirement>44 </requirement>
43 <conflict>45 <conflict>
44 <plugin>decor</plugin>46 <plugin>decor</plugin>
4547
=== modified file 'tools/CMakeLists.txt'
--- tools/CMakeLists.txt 2016-02-09 01:26:22 +0000
+++ tools/CMakeLists.txt 2016-07-26 16:45:52 +0000
@@ -6,3 +6,25 @@
6configure_file (${CMAKE_CURRENT_SOURCE_DIR}/unity.cmake ${CMAKE_BINARY_DIR}/bin/unity)6configure_file (${CMAKE_CURRENT_SOURCE_DIR}/unity.cmake ${CMAKE_BINARY_DIR}/bin/unity)
7install(FILES ${CMAKE_BINARY_DIR}/bin/unity PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ7install(FILES ${CMAKE_BINARY_DIR}/bin/unity PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
8GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION ${CMAKE_INSTALL_BINDIR})8GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION ${CMAKE_INSTALL_BINDIR})
9
10#
11# unity-active-plugins-safety-check
12#
13pkg_check_modules(UAPSC_DEPS REQUIRED libcompizconfig)
14
15set(CFLAGS
16 ${UAPSC_DEPS_CFLAGS}
17 ${UAPSC_DEPS_CFLAGS_OTHER}
18 )
19
20string (REPLACE ";" " " CFLAGS "${CFLAGS}")
21set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CFLAGS}")
22
23set(LIBS ${UAPSC_DEPS_LIBRARIES})
24
25set(LIB_PATHS ${UAPSC_DEPS_LIBRARY_DIRS})
26link_directories(${LIB_PATHS})
27
28add_executable(unity-active-plugins-safety-check unity_active_plugins_safety_check.cpp)
29target_link_libraries(unity-active-plugins-safety-check ${LIBS})
30install(TARGETS unity-active-plugins-safety-check DESTINATION ${CMAKE_INSTALL_LIBDIR}/unity/)
931
=== added file 'tools/unity_active_plugins_safety_check.cpp'
--- tools/unity_active_plugins_safety_check.cpp 1970-01-01 00:00:00 +0000
+++ tools/unity_active_plugins_safety_check.cpp 2016-07-26 16:45:52 +0000
@@ -0,0 +1,83 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Andrea Azzarone <andrea.azzarone@canonical.com>
17 */
18
19#include <ccs.h>
20#include <gio/gio.h>
21
22#include <iostream>
23#include <string>
24
25extern const CCSInterfaceTable ccsDefaultInterfaceTable;
26
27void PluginSetActiveWithDeps(CCSContext* context, std::string const& plugin_name)
28{
29 if (plugin_name.empty())
30 return;
31
32 auto plugin = ccsFindPlugin(context, plugin_name.c_str());
33
34 if (!plugin)
35 return;
36
37 auto reqs = ccsPluginGetRequiresPlugins(plugin);
38 for (auto req = reqs; req; req = req->next)
39 {
40 if (req->data && req->data->value)
41 {
42 std::string name = req->data->value;
43 PluginSetActiveWithDeps(context, name.c_str());
44 }
45 }
46
47 if (!ccsPluginIsActive(context, plugin_name.c_str())) {
48 std::cout << "Setting plugin '" << plugin_name << "' to active" << std::endl;
49 ccsPluginSetActive(plugin, true);
50 }
51
52 auto conflicts = ccsPluginGetConflictPlugins(plugin);
53 for (auto con = conflicts; con; con = con->next)
54 {
55 if (con->data && con->data->value)
56 {
57 std::string name = con->data->value;
58 auto plugin = ccsFindPlugin(context, name.c_str());
59
60 if (ccsPluginIsActive(context, name.c_str()))
61 {
62 std::cout << "Setting plugin '" << name << "' to non-active" << std::endl;
63 ccsPluginSetActive(plugin, false);
64 }
65 }
66 }
67}
68
69int main()
70{
71 auto context = ccsContextNew (0, &ccsDefaultInterfaceTable);
72
73 if (!context)
74 return -1;
75
76 PluginSetActiveWithDeps(context, "unityshell");
77
78 ccsWriteChangedSettings(context);
79 g_settings_sync();
80 ccsFreeContext(context);
81
82 return 0;
83}
084
=== renamed file 'debian/unity7.conf' => 'unity7.conf.in'
--- debian/unity7.conf 2016-07-05 01:26:04 +0000
+++ unity7.conf.in 2016-07-26 16:45:52 +0000
@@ -21,6 +21,9 @@
2121
22 echo "Using compiz profile '$compiz_profile'"22 echo "Using compiz profile '$compiz_profile'"
23 initctl set-env -g COMPIZ_CONFIG_PROFILE="$compiz_profile"23 initctl set-env -g COMPIZ_CONFIG_PROFILE="$compiz_profile"
24 export COMPIZ_CONFIG_PROFILE="$compiz_profile"
25
26 ${CMAKE_INSTALL_FULL_LIBDIR}/unity/unity-active-plugins-safety-check
24end script27end script
2528
26respawn29respawn