Merge lp:~townsend/libertine/drop-click-support into lp:libertine

Proposed by Christopher Townsend
Status: Merged
Approved by: Larry Price
Approved revision: 347
Merge reported by: Larry Price
Merged at revision: not available
Proposed branch: lp:~townsend/libertine/drop-click-support
Merge into: lp:libertine
Diff against target: 255 lines (+2/-198)
7 files modified
data/CMakeLists.txt (+0/-4)
data/python3-libertine-chroot.click-hook.in (+0/-4)
debian/control (+1/-2)
debian/python3-libertine-chroot.install (+0/-1)
debian/rules (+1/-1)
tools/CMakeLists.txt (+0/-3)
tools/update-puritine-containers (+0/-183)
To merge this branch: bzr merge lp:~townsend/libertine/drop-click-support
Reviewer Review Type Date Requested Status
Larry Price Approve
Libertine CI Bot continuous-integration Approve
Review via email: mp+312599@code.launchpad.net

Commit message

Drop support for the Puritine click package as that is Vivid only and a Vivid Libertine branch exists.

To post a comment you must log in.
Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

PASSED: Continuous integration, rev:347
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/257/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/527
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=default/419
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=default/419
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=zesty,testname=default/419
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=vivid+overlay,testname=default/419
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=default/419
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=zesty,testname=default/419
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/537
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/520
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/520/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/520
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/520/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/520
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/520/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/520
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/520/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/520
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/520/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/520
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/520/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/257/rebuild

review: Approve (continuous-integration)
Revision history for this message
Larry Price (larryprice) wrote :

lgtm!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/CMakeLists.txt'
2--- data/CMakeLists.txt 2016-11-01 20:10:58 +0000
3+++ data/CMakeLists.txt 2016-12-06 20:55:22 +0000
4@@ -10,7 +10,3 @@
5 DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/sudoers.d)
6 install(FILES com.canonical.libertine.LxcManager.service com.canonical.libertine.ContainerManager.service
7 DESTINATION ${CMAKE_INSTALL_DATADIR}/dbus-1/services)
8-
9-configure_file("python3-libertine-chroot.click-hook.in"
10- "${CMAKE_SOURCE_DIR}/debian/python3-libertine-chroot.click-hook"
11- @ONLY)
12
13=== removed file 'data/python3-libertine-chroot.click-hook.in'
14--- data/python3-libertine-chroot.click-hook.in 2016-09-06 12:36:47 +0000
15+++ data/python3-libertine-chroot.click-hook.in 1970-01-01 00:00:00 +0000
16@@ -1,4 +0,0 @@
17-Pattern: ${home}/.cache/libertine/puritine/${id}
18-Exec: @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/libertine/update-puritine-containers
19-User-Level: yes
20-Hook-Name: puritine
21
22=== modified file 'debian/control'
23--- debian/control 2016-11-22 17:47:05 +0000
24+++ debian/control 2016-12-06 20:55:22 +0000
25@@ -2,8 +2,7 @@
26 Section: utils
27 Priority: extra
28 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
29-Build-Depends: click-dev,
30- cmake,
31+Build-Depends: cmake,
32 cmake-extras,
33 debhelper (>= 9),
34 dh-translations,
35
36=== modified file 'debian/python3-libertine-chroot.install'
37--- debian/python3-libertine-chroot.install 2016-10-07 21:09:41 +0000
38+++ debian/python3-libertine-chroot.install 2016-12-06 20:55:22 +0000
39@@ -1,2 +1,1 @@
40-usr/lib/*/libertine/update-puritine-containers
41 usr/lib/python*/*/libertine/ChrootContainer.py
42
43=== modified file 'debian/rules'
44--- debian/rules 2016-12-05 15:32:46 +0000
45+++ debian/rules 2016-12-06 20:55:22 +0000
46@@ -1,7 +1,7 @@
47 #!/usr/bin/make -f
48
49 %:
50- dh $@ --with python3,gir,click
51+ dh $@ --with python3,gir
52
53 override_dh_auto_test:
54 dbus-run-session -- dh_auto_test
55
56=== modified file 'tools/CMakeLists.txt'
57--- tools/CMakeLists.txt 2016-10-28 19:39:13 +0000
58+++ tools/CMakeLists.txt 2016-12-06 20:55:22 +0000
59@@ -3,8 +3,5 @@
60 install(FILES libertine-launch.1 libertine-container-manager.1 libertine-lxc-manager.1 libertine-xmir.1
61 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
62 COMPONENT doc)
63-install(PROGRAMS update-puritine-containers
64- DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libertine)
65-
66 install(FILES completions/libertine-container-manager
67 DESTINATION ${DESTDIR}/usr/share/bash-completion/completions/)
68
69=== removed file 'tools/update-puritine-containers'
70--- tools/update-puritine-containers 2016-10-25 15:24:08 +0000
71+++ tools/update-puritine-containers 1970-01-01 00:00:00 +0000
72@@ -1,183 +0,0 @@
73-#!/usr/bin/python3
74-# -*- coding: utf-8 -*-
75-
76-# Copyright (C) 2016 Canonical Ltd.
77-# Author: Christopher Townsend <christopher.townsend@canonical.com>
78-
79-# This program is free software: you can redistribute it and/or modify
80-# it under the terms of the GNU General Public License as published by
81-# the Free Software Foundation; version 3 of the License.
82-#
83-# This program is distributed in the hope that it will be useful,
84-# but WITHOUT ANY WARRANTY; without even the implied warranty of
85-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
86-# GNU General Public License for more details.
87-#
88-# You should have received a copy of the GNU General Public License
89-# along with this program. If not, see <http://www.gnu.org/licenses/>.
90-
91-import json
92-import libertine.utils
93-import os
94-import shlex
95-import shutil
96-import subprocess
97-
98-from gi.repository import GLib, Gio
99-
100-puritine_hook_dir = os.path.join(os.environ['HOME'], '.cache', 'libertine', 'puritine')
101-puritine_symlink_farm_file = os.path.join(puritine_hook_dir, 'PuritineSymlinkFarm.json')
102-puritine_click_config_file = os.path.join('libertine-config', 'libertine', 'ContainersConfig.json')
103-
104-
105-def symlink_farm_entries_count():
106- if (puritine_symlink_farm_list and
107- puritine_symlink_farm_list['customContainers']):
108- return len(puritine_symlink_farm_list['customContainers'])
109-
110- return 0
111-
112-
113-def puritine_symlink_exists(symlink):
114- for file in os.listdir(puritine_hook_dir):
115- if file == symlink:
116- return True
117-
118- return False
119-
120-
121-def get_symlink_name(puritine_symlink_farm_list, container_id):
122- if puritine_symlink_farm_list:
123- for container in puritine_symlink_farm_list['customContainers']:
124- if container['id'] == container_id:
125- return (puritine_symlink_farm_list['customContainers'].index(container), container['symlinkName'])
126-
127- return (0, None)
128-
129-
130-def find_removed_puritine_symlinks(puritine_symlink_farm_list):
131- for container in puritine_symlink_farm_list['customContainers']:
132- if puritine_symlink_exists(container['symlinkName']):
133- continue
134- else:
135- manager_cmd = "libertine-container-manager destroy -i " + container['id']
136- cmd = shlex.split(manager_cmd)
137- subprocess.Popen(cmd).wait()
138- puritine_symlink_farm_list['customContainers'].remove(container)
139-
140- return puritine_symlink_farm_list
141-
142-
143-def find_new_or_updated_puritine_symlinks(puritine_symlink_farm_list):
144- symlinks = os.listdir(puritine_hook_dir)
145-
146- for symlink in symlinks:
147- puritine_click_path = os.path.join(puritine_hook_dir, symlink)
148- if not os.path.islink(puritine_click_path):
149- continue
150-
151- config_file_path = os.path.join(puritine_click_path, puritine_click_config_file)
152-
153- with open(config_file_path, 'r') as fd:
154- container_list = json.load(fd)
155-
156- container_id = container_list['containerList'][0]['id']
157-
158- (index, symlink_name) = get_symlink_name(puritine_symlink_farm_list, container_id)
159-
160- if symlink_name:
161- # Package exists and symlink name is the same- no update
162- if symlink_name == symlink:
163- continue
164- else:
165- puritine_symlink_farm_list['customContainers'][index]['symlinkName'] = symlink
166- else:
167- symlink_obj = {'symlinkName': symlink, 'id': container_id}
168- if 'customContainers' not in puritine_symlink_farm_list:
169- puritine_symlink_farm_list['customContainers'] = [symlink_obj]
170- else:
171- puritine_symlink_farm_list['customContainers'].append(symlink_obj)
172-
173- puritine_click_rootfs_path = os.path.join(puritine_click_path, 'libertine-data', 'libertine-container',
174- container_id, 'rootfs')
175-
176- libertine_containers_path = libertine.utils.get_libertine_containers_dir_path()
177- puritine_container_path = os.path.join(libertine_containers_path, container_id)
178- puritine_container_rootfs_path = os.path.join(puritine_container_path, 'rootfs')
179-
180- if not os.path.exists(puritine_container_path):
181- os.makedirs(puritine_container_path)
182- else:
183- os.remove(puritine_container_rootfs_path)
184-
185- # Link to the click packages container
186- os.symlink(puritine_click_rootfs_path, puritine_container_rootfs_path)
187-
188- # Copy any user data that does not exist
189- libertine_user_data_path = libertine.utils.get_libertine_container_userdata_dir_path(container_id)
190- if not os.path.exists(libertine_user_data_path):
191- puritine_click_user_data_path = os.path.join(puritine_click_path, 'libertine-config', 'libertine-container',
192- 'user-data', container_id)
193- shutil.copytree(puritine_click_user_data_path, libertine_user_data_path)
194-
195- # Update the main ContainerConfig.json
196- manager_cmd = "libertine-container-manager merge-configs -f " + config_file_path
197- cmd = shlex.split(manager_cmd)
198- subprocess.Popen(cmd).wait()
199-
200- return puritine_symlink_farm_list
201-
202-
203-def favorite_libertine_scope():
204- libertine_scope_value = 'scope://libertine-scope.ubuntu_libertine-scope'
205- click_scope_value = 'scope://clickscope'
206- schema = 'com.canonical.Unity.Dash'
207- schema_key = 'favorite-scopes'
208-
209- settings = Gio.Settings.new(schema)
210-
211- favorites = settings.get_value(schema_key)
212-
213- array = favorites.dup_strv()
214-
215- if not libertine_scope_value in array:
216- array.insert(array.index(click_scope_value) + 1, libertine_scope_value)
217- new_favorites = GLib.Variant.new_strv(array)
218- settings.set_value(schema_key, new_favorites)
219- del new_favorites
220-
221- del array
222- del favorites
223- del settings
224-
225-
226-if __name__ == '__main__':
227- puritine_symlink_farm_list = {}
228- update_libertine_scope = libertine.utils.set_session_dbus_env_var()
229-
230- if not os.path.exists(puritine_hook_dir):
231- os.makedirs(puritine_hook_dir)
232-
233- if (os.path.exists(puritine_symlink_farm_file) and
234- os.path.getsize(puritine_symlink_farm_file) != 0):
235- with open(puritine_symlink_farm_file, 'r') as fd:
236- puritine_symlink_farm_list = json.load(fd)
237-
238- count_at_start = symlink_farm_entries_count()
239-
240- puritine_symlink_farm_list = find_new_or_updated_puritine_symlinks(puritine_symlink_farm_list)
241-
242- if puritine_symlink_farm_list:
243- puritine_symlink_farm_list = find_removed_puritine_symlinks(puritine_symlink_farm_list)
244-
245- count_at_finish = symlink_farm_entries_count()
246-
247- with open(puritine_symlink_farm_file, 'w') as fd:
248- json.dump(puritine_symlink_farm_list, fd, sort_keys=True, indent=4)
249- fd.write('\n')
250-
251- if count_at_start == 0 and count_at_finish > 0 and update_libertine_scope:
252- favorite_libertine_scope()
253-
254- if update_libertine_scope:
255- libertine.utils.refresh_libertine_scope()

Subscribers

People subscribed via source and target branches