Merge lp:~townsend/libertine/refactor-lcm into lp:libertine
- refactor-lcm
- Merge into devel
Status: | Merged |
---|---|
Approved by: | Larry Price |
Approved revision: | 258 |
Merged at revision: | 257 |
Proposed branch: | lp:~townsend/libertine/refactor-lcm |
Merge into: | lp:libertine |
Diff against target: |
1274 lines (+561/-586) 2 files modified
python/libertine/ContainersConfig.py (+299/-0) tools/libertine-container-manager (+262/-586) |
To merge this branch: | bzr merge lp:~townsend/libertine/refactor-lcm |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Larry Price | Approve | ||
Libertine CI Bot | continuous-integration | Approve | |
Review via email: mp+298252@code.launchpad.net |
Commit message
Add a new ContainersConfig Python class for managing all things ContainersConfi
Add a new LibertineContai
Description of the change
Libertine CI Bot (libertine-ci-bot) wrote : | # |
Larry Price (larryprice) wrote : | # |
See inline diff comments.
Also, were we in the habit of two newlines between functions? It's all good to me as long as we stay consistent.
- 256. By Christopher Townsend
-
Some more refactoring based on review comments.
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:256
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Christopher Townsend (townsend) wrote : | # |
Thanks!
As discussed on IRC, double space vs. single space is a pyflakes thing of functions outside a class vs. inside a class.
I did not merge _test_key_
- 257. By Christopher Townsend
-
Handle some cases where containers may not exist.
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:257
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Larry Price (larryprice) wrote : | # |
been poking around at some error cases and found a couple of places that need fixing (see inline)
- 258. By Christopher Townsend
-
Add missing sys module.
Fix typo.
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:258
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Larry Price (larryprice) wrote : | # |
lgtm!
i also filed a bug for unrelated issues with accessing the log files of corrupt containers: https:/
Preview Diff
1 | === added file 'python/libertine/ContainersConfig.py' | |||
2 | --- python/libertine/ContainersConfig.py 1970-01-01 00:00:00 +0000 | |||
3 | +++ python/libertine/ContainersConfig.py 2016-06-27 17:59:37 +0000 | |||
4 | @@ -0,0 +1,299 @@ | |||
5 | 1 | # Copyright 2016 Canonical Ltd. | ||
6 | 2 | # | ||
7 | 3 | # This program is free software: you can redistribute it and/or modify it | ||
8 | 4 | # under the terms of the GNU General Public License version 3, as published | ||
9 | 5 | # by the Free Software Foundation. | ||
10 | 6 | # | ||
11 | 7 | # This program is distributed in the hope that it will be useful, but | ||
12 | 8 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
13 | 9 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
14 | 10 | # PURPOSE. See the GNU General Public License for more details. | ||
15 | 11 | # | ||
16 | 12 | # You should have received a copy of the GNU General Public License along | ||
17 | 13 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | 14 | |||
19 | 15 | import fcntl | ||
20 | 16 | import json | ||
21 | 17 | import libertine.utils | ||
22 | 18 | import os | ||
23 | 19 | import sys | ||
24 | 20 | |||
25 | 21 | |||
26 | 22 | def read_container_config_file(): | ||
27 | 23 | container_list = {} | ||
28 | 24 | container_config_file = libertine.utils.get_libertine_database_file_path() | ||
29 | 25 | |||
30 | 26 | if (os.path.exists(container_config_file) and | ||
31 | 27 | os.path.getsize(container_config_file) != 0): | ||
32 | 28 | with open(container_config_file, 'r') as fd: | ||
33 | 29 | container_list = json.load(fd) | ||
34 | 30 | |||
35 | 31 | return container_list | ||
36 | 32 | |||
37 | 33 | |||
38 | 34 | def write_container_config_file(container_list): | ||
39 | 35 | container_config_file = libertine.utils.get_libertine_database_file_path() | ||
40 | 36 | |||
41 | 37 | with open(container_config_file, 'w') as fd: | ||
42 | 38 | fcntl.lockf(fd, fcntl.LOCK_EX) | ||
43 | 39 | json.dump(container_list, fd, sort_keys=True, indent=4) | ||
44 | 40 | fd.write('\n') | ||
45 | 41 | fcntl.lockf(fd, fcntl.LOCK_UN) | ||
46 | 42 | |||
47 | 43 | |||
48 | 44 | class ContainersConfig(object): | ||
49 | 45 | |||
50 | 46 | def __init__(self): | ||
51 | 47 | self.container_list = read_container_config_file() | ||
52 | 48 | |||
53 | 49 | if "defaultContainer" in self.container_list: | ||
54 | 50 | self.default_container_id = self.container_list['defaultContainer'] | ||
55 | 51 | else: | ||
56 | 52 | self.default_container_id = None | ||
57 | 53 | |||
58 | 54 | """ | ||
59 | 55 | Private helper methods | ||
60 | 56 | """ | ||
61 | 57 | def _get_container_entry(self, container_id): | ||
62 | 58 | if not self.container_list: | ||
63 | 59 | return None | ||
64 | 60 | |||
65 | 61 | for container in self.container_list['containerList']: | ||
66 | 62 | if container['id'] == container_id: | ||
67 | 63 | return container | ||
68 | 64 | |||
69 | 65 | return None | ||
70 | 66 | |||
71 | 67 | def _get_value_by_key(self, container_id, key): | ||
72 | 68 | container = self._get_container_entry(container_id) | ||
73 | 69 | |||
74 | 70 | if not container or key not in container: | ||
75 | 71 | return None | ||
76 | 72 | else: | ||
77 | 73 | return container[key] | ||
78 | 74 | |||
79 | 75 | def _get_array_object_value_by_key(self, container_id, array_key, object_key, matcher, key): | ||
80 | 76 | for item in self._get_value_by_key(container_id, array_key): | ||
81 | 77 | if item[object_key] == matcher: | ||
82 | 78 | return item[key] | ||
83 | 79 | |||
84 | 80 | def _set_value_by_key(self, container_id, key, value): | ||
85 | 81 | container = self._get_container_entry(container_id) | ||
86 | 82 | |||
87 | 83 | if not container: | ||
88 | 84 | return | ||
89 | 85 | |||
90 | 86 | if type(value) is str: | ||
91 | 87 | container[key] = value | ||
92 | 88 | elif type(value) is dict: | ||
93 | 89 | if key not in container: | ||
94 | 90 | container[key] = [value] | ||
95 | 91 | else: | ||
96 | 92 | container[key].append(value) | ||
97 | 93 | |||
98 | 94 | write_container_config_file(self.container_list) | ||
99 | 95 | |||
100 | 96 | def _set_array_object_value_by_key(self, container_id, array_key, object_key, matcher, key, value): | ||
101 | 97 | container = self._get_container_entry(container_id) | ||
102 | 98 | |||
103 | 99 | if not container: | ||
104 | 100 | return | ||
105 | 101 | |||
106 | 102 | for item in container[array_key]: | ||
107 | 103 | if item[object_key] == matcher: | ||
108 | 104 | item[key] = value | ||
109 | 105 | write_container_config_file(self.container_list) | ||
110 | 106 | return | ||
111 | 107 | |||
112 | 108 | def _delete_array_object_by_key_value(self, container_id, array_key, object_key, value): | ||
113 | 109 | container = self._get_container_entry(container_id) | ||
114 | 110 | |||
115 | 111 | if not container: | ||
116 | 112 | return | ||
117 | 113 | |||
118 | 114 | for item in container[array_key]: | ||
119 | 115 | if item[object_key] == value: | ||
120 | 116 | container[array_key].remove(item) | ||
121 | 117 | write_container_config_file(self.container_list) | ||
122 | 118 | return | ||
123 | 119 | |||
124 | 120 | def _test_key_value_exists(self, container_id, key, value=None): | ||
125 | 121 | key_value = self._get_value_by_key(container_id, key) | ||
126 | 122 | |||
127 | 123 | if not key_value: | ||
128 | 124 | return False | ||
129 | 125 | elif key == 'id': | ||
130 | 126 | return True | ||
131 | 127 | elif key_value == value: | ||
132 | 128 | return True | ||
133 | 129 | else: | ||
134 | 130 | return False | ||
135 | 131 | |||
136 | 132 | def _test_array_object_key_value_exists(self, container_id, array_key, object_key, value): | ||
137 | 133 | array = self._get_value_by_key(container_id, array_key) | ||
138 | 134 | |||
139 | 135 | if not array: | ||
140 | 136 | return False | ||
141 | 137 | |||
142 | 138 | for item in array: | ||
143 | 139 | if item[object_key] == value: | ||
144 | 140 | return True | ||
145 | 141 | |||
146 | 142 | return False | ||
147 | 143 | |||
148 | 144 | """ | ||
149 | 145 | Miscellaneous ContainersConfig.json operations | ||
150 | 146 | """ | ||
151 | 147 | def _find_duplicate_container_entry(self, container_list, container_id): | ||
152 | 148 | for container in container_list['containerList']: | ||
153 | 149 | if container['id'] == container_id: | ||
154 | 150 | return container | ||
155 | 151 | |||
156 | 152 | return None | ||
157 | 153 | |||
158 | 154 | def merge_container_config_files(self, filepath): | ||
159 | 155 | merged_json = [] | ||
160 | 156 | |||
161 | 157 | with open(filepath, 'r') as fd: | ||
162 | 158 | merge_source = json.load(fd) | ||
163 | 159 | |||
164 | 160 | if "containerList" in self.container_list: | ||
165 | 161 | # Finds any duplicate entries and assumes we want to update the main config | ||
166 | 162 | # with entries from the merge source. | ||
167 | 163 | for i, container in enumerate(self.container_list['containerList']): | ||
168 | 164 | merge_container = self._find_duplicate_container_entry(merge_source, container['id']) | ||
169 | 165 | if merge_container: | ||
170 | 166 | self.container_list['containerList'][i] = merge_container | ||
171 | 167 | merge_source['containerList'].remove(merge_container) | ||
172 | 168 | |||
173 | 169 | # Merges in any remaining non-duplicate entries. | ||
174 | 170 | for container in merge_source['containerList']: | ||
175 | 171 | self.container_list['containerList'].append(container) | ||
176 | 172 | |||
177 | 173 | else: | ||
178 | 174 | self.container_list = merge_source | ||
179 | 175 | |||
180 | 176 | write_container_config_file(self.container_list) | ||
181 | 177 | |||
182 | 178 | def check_container_id(self, container_id): | ||
183 | 179 | if container_id and not self.container_exists(container_id): | ||
184 | 180 | print("Container id \'%s\' does not exist." % container_id, file=sys.stderr) | ||
185 | 181 | sys.exit(1) | ||
186 | 182 | elif not container_id: | ||
187 | 183 | return self.get_default_container_id() | ||
188 | 184 | |||
189 | 185 | return container_id | ||
190 | 186 | |||
191 | 187 | def get_default_container_id(self): | ||
192 | 188 | return self.default_container_id | ||
193 | 189 | |||
194 | 190 | def set_default_container_id(self, container_id, write_json=False): | ||
195 | 191 | self.default_container_id = container_id | ||
196 | 192 | self.container_list['defaultContainer'] = container_id | ||
197 | 193 | |||
198 | 194 | if write_json: | ||
199 | 195 | write_container_config_file(self.container_list) | ||
200 | 196 | |||
201 | 197 | def clear_default_container_id(self, write_json=False): | ||
202 | 198 | self.default_container_id = None | ||
203 | 199 | self.container_list.pop('defaultContainer', None) | ||
204 | 200 | |||
205 | 201 | if write_json: | ||
206 | 202 | write_container_config_file(self.container_list) | ||
207 | 203 | |||
208 | 204 | """ | ||
209 | 205 | Operations for the container itself. | ||
210 | 206 | """ | ||
211 | 207 | def add_new_container(self, container_id, container_name, container_type, container_distro): | ||
212 | 208 | container_obj = {'id': container_id, 'installStatus': 'new', 'type': container_type, | ||
213 | 209 | 'distro': container_distro, 'name': container_name, 'installedApps': []} | ||
214 | 210 | |||
215 | 211 | if "defaultContainer" not in self.container_list: | ||
216 | 212 | self.set_default_container_id(container_id) | ||
217 | 213 | |||
218 | 214 | if "containerList" not in self.container_list: | ||
219 | 215 | self.container_list['containerList'] = [container_obj] | ||
220 | 216 | else: | ||
221 | 217 | self.container_list['containerList'].append(container_obj) | ||
222 | 218 | |||
223 | 219 | write_container_config_file(self.container_list) | ||
224 | 220 | |||
225 | 221 | def delete_container(self, container_id): | ||
226 | 222 | if not self.container_list: | ||
227 | 223 | print("Unable to delete container. No containers defined.") | ||
228 | 224 | sys.exit(1) | ||
229 | 225 | |||
230 | 226 | container = self._get_container_entry(container_id) | ||
231 | 227 | |||
232 | 228 | self.container_list['containerList'].remove(container) | ||
233 | 229 | |||
234 | 230 | # Set a new defaultContainer if the current default is being deleted. | ||
235 | 231 | if self.container_list['defaultContainer'] == container_id and self.container_list['containerList']: | ||
236 | 232 | self.set_default_container_id(self.container_list['containerList'][0]['id']) | ||
237 | 233 | # Remove the defaultContainer if there are no more containers left. | ||
238 | 234 | elif not self.container_list['containerList']: | ||
239 | 235 | self.clear_default_container_id() | ||
240 | 236 | |||
241 | 237 | write_container_config_file(self.container_list) | ||
242 | 238 | |||
243 | 239 | def update_container_install_status(self, container_id, new_status): | ||
244 | 240 | self._set_value_by_key(container_id, 'installStatus', new_status) | ||
245 | 241 | |||
246 | 242 | def container_exists(self, container_id): | ||
247 | 243 | return self._test_key_value_exists(container_id, 'id') | ||
248 | 244 | |||
249 | 245 | def update_container_multiarch_support(self, container_id, multiarch): | ||
250 | 246 | if multiarch == 'enabled' and libertine.utils.get_host_architecture() == 'i386': | ||
251 | 247 | multiarch = 'disabled' | ||
252 | 248 | |||
253 | 249 | self._set_value_by_key(container_id, 'multiarch', multiarch) | ||
254 | 250 | |||
255 | 251 | def get_container_multiarch_support(self, container_id): | ||
256 | 252 | multiarch_support = self._get_value_by_key(container_id, 'multiarch') | ||
257 | 253 | |||
258 | 254 | if multiarch_support == None: | ||
259 | 255 | return 'disabled' | ||
260 | 256 | else: | ||
261 | 257 | return multiarch_support | ||
262 | 258 | |||
263 | 259 | """ | ||
264 | 260 | Operations for archive (PPA) maintenance in a Libertine container. | ||
265 | 261 | """ | ||
266 | 262 | def add_container_archive(self, container_id, archive_name): | ||
267 | 263 | archive_obj = {'archiveName': archive_name, 'archiveStatus': 'new'} | ||
268 | 264 | self._set_value_by_key(container_id, 'extraArchives', archive_obj) | ||
269 | 265 | |||
270 | 266 | def delete_container_archive(self, container_id, archive_name): | ||
271 | 267 | self._delete_array_object_by_key_value(container_id, 'extraArchives', | ||
272 | 268 | 'archiveName', archive_name) | ||
273 | 269 | |||
274 | 270 | def update_archive_install_status(self, container_id, archive_name, new_status): | ||
275 | 271 | self._set_array_object_value_by_key(container_id, 'extraArchives', 'archiveName', | ||
276 | 272 | archive_name, 'archiveStatus', new_status) | ||
277 | 273 | |||
278 | 274 | def archive_exists(self, container_id, archive_name): | ||
279 | 275 | return self._test_array_object_key_value_exists(container_id, 'extraArchives', 'archiveName', | ||
280 | 276 | archive_name) | ||
281 | 277 | |||
282 | 278 | """ | ||
283 | 279 | Operations for package maintenance in a Libertine container. | ||
284 | 280 | """ | ||
285 | 281 | def add_new_package(self, container_id, package_name): | ||
286 | 282 | package_obj = {'packageName': package_name, 'appStatus': 'new'} | ||
287 | 283 | self._set_value_by_key(container_id, 'installedApps', package_obj) | ||
288 | 284 | |||
289 | 285 | def delete_package(self, container_id, package_name): | ||
290 | 286 | self._delete_array_object_by_key_value(container_id, 'installedApps', | ||
291 | 287 | 'packageName', package_name) | ||
292 | 288 | |||
293 | 289 | def update_package_install_status(self, container_id, package_name, new_status): | ||
294 | 290 | self._set_array_object_value_by_key(container_id, 'installedApps', 'packageName', | ||
295 | 291 | package_name, 'appStatus', new_status) | ||
296 | 292 | |||
297 | 293 | def get_package_install_status(self, container_id, package_name): | ||
298 | 294 | return self._get_array_object_value_by_key(container_id, 'installedApps', 'packageName', | ||
299 | 295 | package_name, 'appStatus') | ||
300 | 296 | |||
301 | 297 | def package_exists(self, container_id, package_name): | ||
302 | 298 | return self._test_array_object_key_value_exists(container_id, 'installedApps', 'packageName', | ||
303 | 299 | package_name) | ||
304 | 0 | 300 | ||
305 | === modified file 'tools/libertine-container-manager' | |||
306 | --- tools/libertine-container-manager 2016-06-20 15:15:38 +0000 | |||
307 | +++ tools/libertine-container-manager 2016-06-27 17:59:37 +0000 | |||
308 | @@ -17,8 +17,6 @@ | |||
309 | 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
310 | 18 | 18 | ||
311 | 19 | import argparse | 19 | import argparse |
312 | 20 | import fcntl | ||
313 | 21 | import json | ||
314 | 22 | import libertine.utils | 20 | import libertine.utils |
315 | 23 | import lsb_release | 21 | import lsb_release |
316 | 24 | import getpass | 22 | import getpass |
317 | @@ -27,75 +25,9 @@ | |||
318 | 27 | import sys | 25 | import sys |
319 | 28 | 26 | ||
320 | 29 | from apt.debfile import DebPackage | 27 | from apt.debfile import DebPackage |
322 | 30 | from distro_info import UbuntuDistroInfo, DistroDataOutdated | 28 | from distro_info import UbuntuDistroInfo |
323 | 31 | from libertine import LibertineContainer | 29 | from libertine import LibertineContainer |
391 | 32 | 30 | from libertine.ContainersConfig import ContainersConfig | |
325 | 33 | |||
326 | 34 | def find_duplicate_container_entry(container_list, container_id): | ||
327 | 35 | for container in container_list['containerList']: | ||
328 | 36 | if container['id'] == container_id: | ||
329 | 37 | return container | ||
330 | 38 | |||
331 | 39 | return None | ||
332 | 40 | |||
333 | 41 | |||
334 | 42 | def merge_container_config_files(filepath): | ||
335 | 43 | merged_json = [] | ||
336 | 44 | main_config = read_container_config_file() | ||
337 | 45 | |||
338 | 46 | with open(filepath, 'r') as fd: | ||
339 | 47 | merge_source = json.load(fd) | ||
340 | 48 | |||
341 | 49 | if "containerList" in main_config: | ||
342 | 50 | # Finds any duplicate entries and assumes we want to update the main config | ||
343 | 51 | # with entries from the merge source. | ||
344 | 52 | for i, container in enumerate(main_config['containerList']): | ||
345 | 53 | merge_container = find_duplicate_container_entry(merge_source, container['id']) | ||
346 | 54 | if merge_container: | ||
347 | 55 | main_config['containerList'][i] = merge_container | ||
348 | 56 | merge_source['containerList'].remove(merge_container) | ||
349 | 57 | |||
350 | 58 | # Merges in any remaining non-duplicate entries. | ||
351 | 59 | for container in merge_source['containerList']: | ||
352 | 60 | main_config['containerList'].append(container) | ||
353 | 61 | |||
354 | 62 | else: | ||
355 | 63 | main_config = merge_source | ||
356 | 64 | |||
357 | 65 | write_container_config_file(main_config) | ||
358 | 66 | |||
359 | 67 | |||
360 | 68 | def read_container_config_file(): | ||
361 | 69 | container_list = {} | ||
362 | 70 | container_config_file = libertine.utils.get_libertine_database_file_path() | ||
363 | 71 | |||
364 | 72 | if (os.path.exists(container_config_file) and | ||
365 | 73 | os.path.getsize(container_config_file) != 0): | ||
366 | 74 | with open(container_config_file, 'r') as fd: | ||
367 | 75 | container_list = json.load(fd) | ||
368 | 76 | |||
369 | 77 | return container_list | ||
370 | 78 | |||
371 | 79 | |||
372 | 80 | def write_container_config_file(container_list): | ||
373 | 81 | container_config_file = libertine.utils.get_libertine_database_file_path() | ||
374 | 82 | |||
375 | 83 | with open(container_config_file, 'w') as fd: | ||
376 | 84 | fcntl.lockf(fd, fcntl.LOCK_EX) | ||
377 | 85 | json.dump(container_list, fd, sort_keys=True, indent=4) | ||
378 | 86 | fd.write('\n') | ||
379 | 87 | fcntl.lockf(fd, fcntl.LOCK_UN) | ||
380 | 88 | |||
381 | 89 | |||
382 | 90 | def get_default_container_id(): | ||
383 | 91 | default_container_id = None | ||
384 | 92 | |||
385 | 93 | container_list = read_container_config_file() | ||
386 | 94 | |||
387 | 95 | if "defaultContainer" in container_list: | ||
388 | 96 | default_container_id = container_list['defaultContainer'] | ||
389 | 97 | |||
390 | 98 | return default_container_id | ||
392 | 99 | 31 | ||
393 | 100 | 32 | ||
394 | 101 | def select_container_type(): | 33 | def select_container_type(): |
395 | @@ -142,512 +74,254 @@ | |||
396 | 142 | return None | 74 | return None |
397 | 143 | 75 | ||
398 | 144 | 76 | ||
835 | 145 | def update_container_install_status(container_id, new_status): | 77 | class LibertineContainerManager(object): |
836 | 146 | container_list = read_container_config_file() | 78 | |
837 | 147 | 79 | def __init__(self): | |
838 | 148 | for container in container_list['containerList']: | 80 | self.containers_config = ContainersConfig() |
839 | 149 | if container['id'] == container_id: | 81 | |
840 | 150 | container['installStatus'] = new_status | 82 | def create(self, args): |
841 | 151 | 83 | password = None | |
842 | 152 | write_container_config_file(container_list) | 84 | |
843 | 153 | break | 85 | if args.distro and not is_distro_valid(args.distro, args.force): |
844 | 154 | 86 | print("Invalid distro %s" % args.distro, file=sys.stderr) | |
845 | 155 | 87 | sys.exit(1) | |
846 | 156 | def update_container_multiarch_support(container_id, multiarch): | 88 | |
847 | 157 | container_list = read_container_config_file() | 89 | if args.id and self.containers_config.container_exists(args.id): |
848 | 158 | 90 | print("Container id \'%s\' is already used." % args.id, file=sys.stderr) | |
849 | 159 | if multiarch == 'enabled' and libertine.utils.get_host_architecture() == 'i386': | 91 | sys.exit(1) |
850 | 160 | multiarch = 'disabled' | 92 | elif not args.id: |
851 | 161 | 93 | args.id = get_unique_container_id(distro) | |
852 | 162 | for container in container_list['containerList']: | 94 | |
853 | 163 | if container['id'] == container_id: | 95 | if not args.type: |
854 | 164 | container['multiarch'] = multiarch | 96 | container_type = select_container_type() |
855 | 165 | 97 | else: | |
856 | 166 | write_container_config_file(container_list) | 98 | container_type = args.type |
857 | 167 | break | 99 | |
858 | 168 | 100 | if not args.distro: | |
859 | 169 | 101 | args.distro = get_host_distro_release() | |
860 | 170 | def get_container_multiarch_support(container_id): | 102 | elif container_type == "chroot": |
861 | 171 | container_list = read_container_config_file() | 103 | host_distro = get_host_distro_release() |
862 | 172 | 104 | ||
863 | 173 | for container in container_list['containerList']: | 105 | if args.distro != host_distro: |
864 | 174 | if container['id'] == container_id: | 106 | print("The container distribution needs to match the host ditribution for chroot" |
865 | 175 | if not 'multiarch' in container: | 107 | " based containers. Please either use \'%s\' or omit the -d/--distro option." |
866 | 176 | return 'disabled' | 108 | % host_distro) |
867 | 177 | else: | 109 | sys.exit(1) |
868 | 178 | return container['multiarch'] | 110 | |
869 | 179 | 111 | if not args.name: | |
870 | 180 | 112 | args.name = "Ubuntu \'" + get_distro_codename(args.distro) + "\'" | |
871 | 181 | def update_archive_install_status(container_id, archive_name, new_status): | 113 | |
872 | 182 | container_list = read_container_config_file() | 114 | if container_type == "lxc": |
873 | 183 | 115 | if args.password: | |
874 | 184 | for container in container_list['containerList']: | 116 | password = args.password |
875 | 185 | if container['id'] == container_id: | 117 | elif sys.stdin.isatty(): |
876 | 186 | for archive in container['extraArchives']: | 118 | print("Your user password is required for creating a Libertine container.") |
877 | 187 | if archive['archiveName'] == archive_name: | 119 | password = getpass.getpass() |
878 | 188 | archive['archiveStatus'] = new_status | 120 | else: |
879 | 189 | write_container_config_file(container_list) | 121 | password = sys.stdin.readline().rstrip() |
880 | 190 | return | 122 | |
881 | 191 | 123 | self.containers_config.add_new_container(args.id, args.name, container_type, args.distro) | |
882 | 192 | 124 | ||
447 | 193 | def add_container_archive(container_id, archive_name): | ||
448 | 194 | container_list = read_container_config_file() | ||
449 | 195 | |||
450 | 196 | for container in container_list['containerList']: | ||
451 | 197 | if container['id'] == container_id: | ||
452 | 198 | archive_obj = {'archiveName': archive_name, 'archiveStatus': 'new'} | ||
453 | 199 | |||
454 | 200 | if 'extraArchives' not in container: | ||
455 | 201 | container['extraArchives'] = [archive_obj] | ||
456 | 202 | else: | ||
457 | 203 | container['extraArchives'].append(archive_obj) | ||
458 | 204 | |||
459 | 205 | write_container_config_file(container_list) | ||
460 | 206 | break | ||
461 | 207 | |||
462 | 208 | |||
463 | 209 | def delete_container_archive(container_id, archive_name): | ||
464 | 210 | container_list = read_container_config_file() | ||
465 | 211 | |||
466 | 212 | for container in container_list['containerList']: | ||
467 | 213 | if container['id'] == container_id: | ||
468 | 214 | for archive in container['extraArchives']: | ||
469 | 215 | if archive['archiveName'] == archive_name: | ||
470 | 216 | container['extraArchives'].remove(archive) | ||
471 | 217 | write_container_config_file(container_list) | ||
472 | 218 | return | ||
473 | 219 | |||
474 | 220 | print("%s does not exist." % archive_name) | ||
475 | 221 | sys.exit(1) | ||
476 | 222 | |||
477 | 223 | |||
478 | 224 | def archive_exists(container_id, archive_name): | ||
479 | 225 | container_list = read_container_config_file() | ||
480 | 226 | |||
481 | 227 | for container in container_list['containerList']: | ||
482 | 228 | if container['id'] == container_id: | ||
483 | 229 | if 'extraArchives' not in container: | ||
484 | 230 | return False | ||
485 | 231 | else: | ||
486 | 232 | for archive in container['extraArchives']: | ||
487 | 233 | if archive['archiveName'] == archive_name: | ||
488 | 234 | return True | ||
489 | 235 | |||
490 | 236 | return False | ||
491 | 237 | |||
492 | 238 | |||
493 | 239 | def add_new_container(id, name, type, distro): | ||
494 | 240 | if not os.path.exists(libertine.utils.get_libertine_database_dir_path()): | ||
495 | 241 | os.makedirs(libertine.utils.get_libertine_database_dir_path()) | ||
496 | 242 | |||
497 | 243 | container_list = read_container_config_file() | ||
498 | 244 | |||
499 | 245 | container_obj = {'id': id, 'installStatus': 'new', 'type': type, | ||
500 | 246 | 'distro': distro, 'name': name, 'installedApps': []} | ||
501 | 247 | |||
502 | 248 | if "defaultContainer" not in container_list: | ||
503 | 249 | container_list['defaultContainer'] = id | ||
504 | 250 | |||
505 | 251 | if "containerList" not in container_list: | ||
506 | 252 | container_list['containerList'] = [container_obj] | ||
507 | 253 | else: | ||
508 | 254 | container_list['containerList'].append(container_obj) | ||
509 | 255 | |||
510 | 256 | write_container_config_file(container_list) | ||
511 | 257 | |||
512 | 258 | |||
513 | 259 | def delete_container(container_id): | ||
514 | 260 | container_list = read_container_config_file() | ||
515 | 261 | |||
516 | 262 | if not container_list: | ||
517 | 263 | print("Unable to delete container. No containers defined.") | ||
518 | 264 | sys.exit(1) | ||
519 | 265 | |||
520 | 266 | for container in container_list['containerList']: | ||
521 | 267 | if container['id'] == container_id: | ||
522 | 268 | container_list['containerList'].remove(container) | ||
523 | 269 | |||
524 | 270 | # Set a new defaultContainer if the current default is being deleted. | ||
525 | 271 | if container_list['defaultContainer'] == container_id and container_list['containerList']: | ||
526 | 272 | container_list['defaultContainer'] = container_list['containerList'][0]['id'] | ||
527 | 273 | # Remove the defaultContainer if there are no more containers left. | ||
528 | 274 | elif not container_list['containerList']: | ||
529 | 275 | del container_list['defaultContainer'] | ||
530 | 276 | |||
531 | 277 | write_container_config_file(container_list) | ||
532 | 278 | break | ||
533 | 279 | |||
534 | 280 | |||
535 | 281 | def package_exists(container_id, package_name): | ||
536 | 282 | container_list = read_container_config_file() | ||
537 | 283 | |||
538 | 284 | if not container_list: | ||
539 | 285 | return False | ||
540 | 286 | |||
541 | 287 | for container in container_list['containerList']: | ||
542 | 288 | if container['id'] == container_id: | ||
543 | 289 | for package in container['installedApps']: | ||
544 | 290 | if package['packageName'] == package_name: | ||
545 | 291 | return True | ||
546 | 292 | |||
547 | 293 | return False | ||
548 | 294 | |||
549 | 295 | |||
550 | 296 | def update_package_install_status(container_id, package_name, new_status): | ||
551 | 297 | container_list = read_container_config_file() | ||
552 | 298 | |||
553 | 299 | for container in container_list['containerList']: | ||
554 | 300 | if container['id'] == container_id: | ||
555 | 301 | for package in container['installedApps']: | ||
556 | 302 | if package['packageName'] == package_name: | ||
557 | 303 | package['appStatus'] = new_status | ||
558 | 304 | write_container_config_file(container_list) | ||
559 | 305 | return | ||
560 | 306 | |||
561 | 307 | |||
562 | 308 | def get_package_install_status(container_id, package_name): | ||
563 | 309 | container_list = read_container_config_file() | ||
564 | 310 | |||
565 | 311 | for container in container_list['containerList']: | ||
566 | 312 | if container['id'] == container_id: | ||
567 | 313 | for package in container['installedApps']: | ||
568 | 314 | if package['packageName'] == package_name: | ||
569 | 315 | return package['appStatus'] | ||
570 | 316 | |||
571 | 317 | |||
572 | 318 | def add_new_package(container_id, package_name): | ||
573 | 319 | container_list = read_container_config_file() | ||
574 | 320 | |||
575 | 321 | if not container_list: | ||
576 | 322 | print("No containers defined. Please create a new container before installing a package.") | ||
577 | 323 | sys.exit(1) | ||
578 | 324 | |||
579 | 325 | for container in container_list['containerList']: | ||
580 | 326 | if container['id'] == container_id: | ||
581 | 327 | package_obj = {'packageName': package_name, 'appStatus': 'new'} | ||
582 | 328 | |||
583 | 329 | if not container['installedApps']: | ||
584 | 330 | container['installedApps'] = [package_obj] | ||
585 | 331 | else: | ||
586 | 332 | container['installedApps'].append(package_obj) | ||
587 | 333 | |||
588 | 334 | write_container_config_file(container_list) | ||
589 | 335 | break | ||
590 | 336 | |||
591 | 337 | |||
592 | 338 | def delete_package(container_id, package_name): | ||
593 | 339 | container_list = read_container_config_file() | ||
594 | 340 | |||
595 | 341 | if not container_list: | ||
596 | 342 | print("No containers defined. Please create a new container before installing a package.") | ||
597 | 343 | sys.exit(1) | ||
598 | 344 | |||
599 | 345 | for container in container_list['containerList']: | ||
600 | 346 | if container['id'] == container_id: | ||
601 | 347 | for package in container['installedApps']: | ||
602 | 348 | if package['packageName'] == package_name: | ||
603 | 349 | container['installedApps'].remove(package) | ||
604 | 350 | write_container_config_file(container_list) | ||
605 | 351 | return | ||
606 | 352 | |||
607 | 353 | print("Package \'%s\' does not exist." % package_name) | ||
608 | 354 | sys.exit(1) | ||
609 | 355 | |||
610 | 356 | |||
611 | 357 | def create(args): | ||
612 | 358 | password = None | ||
613 | 359 | |||
614 | 360 | if args.distro and not is_distro_valid(args.distro, args.force): | ||
615 | 361 | print("Invalid distro %s" % args.distro, file=sys.stderr) | ||
616 | 362 | sys.exit(1) | ||
617 | 363 | |||
618 | 364 | if args.id and libertine.utils.container_exists(args.id): | ||
619 | 365 | print("Container id \'%s\' is already used." % args.id, file=sys.stderr) | ||
620 | 366 | sys.exit(1) | ||
621 | 367 | elif not args.id: | ||
622 | 368 | args.id = get_unique_container_id(distro) | ||
623 | 369 | |||
624 | 370 | if not args.type: | ||
625 | 371 | container_type = select_container_type() | ||
626 | 372 | else: | ||
627 | 373 | container_type = args.type | ||
628 | 374 | |||
629 | 375 | if not args.distro: | ||
630 | 376 | args.distro = get_host_distro_release() | ||
631 | 377 | elif container_type == "chroot": | ||
632 | 378 | host_distro = get_host_distro_release() | ||
633 | 379 | |||
634 | 380 | if args.distro != host_distro: | ||
635 | 381 | print("The container distribution needs to match the host ditribution for chroot" | ||
636 | 382 | " based containers. Please either use \'%s\' or omit the -d/--distro option." | ||
637 | 383 | % host_distro) | ||
638 | 384 | sys.exit(1) | ||
639 | 385 | |||
640 | 386 | if not args.name: | ||
641 | 387 | args.name = "Ubuntu \'" + get_distro_codename(args.distro) + "\'" | ||
642 | 388 | |||
643 | 389 | if container_type == "lxc": | ||
644 | 390 | if args.password: | ||
645 | 391 | password = args.password | ||
646 | 392 | elif sys.stdin.isatty(): | ||
647 | 393 | print("Your user password is required for creating a Libertine container.") | ||
648 | 394 | password = getpass.getpass() | ||
649 | 395 | else: | ||
650 | 396 | password = sys.stdin.readline().rstrip() | ||
651 | 397 | |||
652 | 398 | add_new_container(args.id, args.name, container_type, args.distro) | ||
653 | 399 | |||
654 | 400 | multiarch = 'disabled' | ||
655 | 401 | if args.multiarch: | ||
656 | 402 | multiarch = 'enabled' | ||
657 | 403 | update_container_multiarch_support(args.id, multiarch) | ||
658 | 404 | |||
659 | 405 | container = LibertineContainer(args.id) | ||
660 | 406 | update_container_install_status(args.id, "installing") | ||
661 | 407 | if not container.create_libertine_container(password, args.multiarch, args.verbosity): | ||
662 | 408 | delete_container(args.id) | ||
663 | 409 | sys.exit(1) | ||
664 | 410 | update_container_install_status(args.id, "ready") | ||
665 | 411 | |||
666 | 412 | libertine.utils.refresh_libertine_scope() | ||
667 | 413 | |||
668 | 414 | |||
669 | 415 | def destroy_container_by_id(id): | ||
670 | 416 | container = LibertineContainer(id) | ||
671 | 417 | update_container_install_status(id, "removing") | ||
672 | 418 | container.destroy_libertine_container() | ||
673 | 419 | update_container_install_status(id, "removed") | ||
674 | 420 | delete_container(id) | ||
675 | 421 | |||
676 | 422 | |||
677 | 423 | def destroy(args): | ||
678 | 424 | if args.id and not libertine.utils.container_exists(args.id): | ||
679 | 425 | print("Container id \'%s\' does not exist." % args.id, file=sys.stderr) | ||
680 | 426 | sys.exit(1) | ||
681 | 427 | elif not args.id: | ||
682 | 428 | args.id = get_default_container_id() | ||
683 | 429 | |||
684 | 430 | destroy_container_by_id(args.id) | ||
685 | 431 | |||
686 | 432 | libertine.utils.refresh_libertine_scope() | ||
687 | 433 | |||
688 | 434 | |||
689 | 435 | def install_package(args): | ||
690 | 436 | if args.id and not libertine.utils.container_exists(args.id): | ||
691 | 437 | print("Container id \'%s\' does not exist." % args.id, file=sys.stderr) | ||
692 | 438 | sys.exit(1) | ||
693 | 439 | elif not args.id: | ||
694 | 440 | args.id = get_default_container_id() | ||
695 | 441 | |||
696 | 442 | is_debian_package = args.package.endswith('.deb') | ||
697 | 443 | |||
698 | 444 | if is_debian_package: | ||
699 | 445 | if os.path.exists(args.package): | ||
700 | 446 | package = DebPackage(args.package).pkgname | ||
701 | 447 | else: | ||
702 | 448 | print("%s does not exist." % args.package) | ||
703 | 449 | sys.exit(1) | ||
704 | 450 | else: | ||
705 | 451 | package = args.package | ||
706 | 452 | |||
707 | 453 | if package_exists(args.id, package): | ||
708 | 454 | if not is_debian_package: | ||
709 | 455 | print("Package \'%s\' is already installed." % package) | ||
710 | 456 | sys.exit(1) | ||
711 | 457 | else: | ||
712 | 458 | add_new_package(args.id, package) | ||
713 | 459 | |||
714 | 460 | container = LibertineContainer(args.id) | ||
715 | 461 | |||
716 | 462 | update_package_install_status(args.id, package, "installing") | ||
717 | 463 | if not container.install_package(args.package, args.verbosity, args.readline): | ||
718 | 464 | delete_package(args.id, package) | ||
719 | 465 | sys.exit(1) | ||
720 | 466 | |||
721 | 467 | update_package_install_status(args.id, package, "installed") | ||
722 | 468 | |||
723 | 469 | libertine.utils.refresh_libertine_scope() | ||
724 | 470 | |||
725 | 471 | |||
726 | 472 | def remove_package_by_name(container_id, package_name, verbosity=1, readline=False): | ||
727 | 473 | fallback_status = get_package_install_status(container_id, package_name) | ||
728 | 474 | update_package_install_status(container_id, package_name, "removing") | ||
729 | 475 | |||
730 | 476 | container = LibertineContainer(container_id) | ||
731 | 477 | if not container.remove_package(package_name, verbosity, readline): | ||
732 | 478 | update_package_install_status(container_id, package_name, fallback_status) | ||
733 | 479 | return False | ||
734 | 480 | |||
735 | 481 | update_package_install_status(container_id, package_name, "removed") | ||
736 | 482 | delete_package(container_id, package_name) | ||
737 | 483 | |||
738 | 484 | return True | ||
739 | 485 | |||
740 | 486 | |||
741 | 487 | def remove_package(args): | ||
742 | 488 | if args.id and not libertine.utils.container_exists(args.id): | ||
743 | 489 | print("Container id \'%s\' does not exist." % args.id, file=sys.stderr) | ||
744 | 490 | sys.exit(1) | ||
745 | 491 | elif not args.id: | ||
746 | 492 | args.id = get_default_container_id() | ||
747 | 493 | |||
748 | 494 | if get_package_install_status(args.id, args.package) != 'installed': | ||
749 | 495 | print("Package \'%s\' is not installed." % args.package) | ||
750 | 496 | sys.exit(1) | ||
751 | 497 | |||
752 | 498 | if not remove_package_by_name(args.id, args.package, args.verbosity, args.readline): | ||
753 | 499 | sys.exit(1) | ||
754 | 500 | |||
755 | 501 | libertine.utils.refresh_libertine_scope() | ||
756 | 502 | |||
757 | 503 | |||
758 | 504 | def search_cache(args): | ||
759 | 505 | if args.id and not libertine.utils.container_exists(args.id): | ||
760 | 506 | print("Container id \'%s\' does not exist." % args.id, file=sys.stderr) | ||
761 | 507 | sys.exit(1) | ||
762 | 508 | elif not args.id: | ||
763 | 509 | args.id = get_default_container_id() | ||
764 | 510 | |||
765 | 511 | container = LibertineContainer(args.id) | ||
766 | 512 | if container.search_package_cache(args.search_string) is not 0: | ||
767 | 513 | sys.exit(1) | ||
768 | 514 | |||
769 | 515 | |||
770 | 516 | def update(args): | ||
771 | 517 | if args.id and not libertine.utils.container_exists(args.id): | ||
772 | 518 | print("Container id \'%s\' does not exist." % args.id, file=sys.stderr) | ||
773 | 519 | sys.exit(1) | ||
774 | 520 | elif not args.id: | ||
775 | 521 | args.id = get_default_container_id() | ||
776 | 522 | |||
777 | 523 | container = LibertineContainer(args.id) | ||
778 | 524 | |||
779 | 525 | update_container_install_status(args.id, "updating") | ||
780 | 526 | if container.update_libertine_container(args.verbosity) is not 0: | ||
781 | 527 | update_container_install_status(args.id, "ready") | ||
782 | 528 | sys.exit(1) | ||
783 | 529 | |||
784 | 530 | update_container_install_status(args.id, "ready") | ||
785 | 531 | |||
786 | 532 | |||
787 | 533 | def list(args): | ||
788 | 534 | containers = libertine.utils.Libertine.list_containers() | ||
789 | 535 | for container in containers: | ||
790 | 536 | print("%s" % container) | ||
791 | 537 | |||
792 | 538 | |||
793 | 539 | def list_apps(args): | ||
794 | 540 | if args.id and not libertine.utils.container_exists(args.id): | ||
795 | 541 | print("Container id \'%s\' does not exist." % args.id, file=sys.stderr) | ||
796 | 542 | sys.exit(1) | ||
797 | 543 | elif not args.id: | ||
798 | 544 | args.id = get_default_container_id() | ||
799 | 545 | |||
800 | 546 | container = LibertineContainer(args.id) | ||
801 | 547 | print(container.list_app_launchers(use_json=args.json)) | ||
802 | 548 | |||
803 | 549 | |||
804 | 550 | def exec(args): | ||
805 | 551 | if args.id and not libertine.utils.container_exists(args.id): | ||
806 | 552 | print("Container id \'%s\' does not exist." % args.id, file=sys.stderr) | ||
807 | 553 | sys.exit(1) | ||
808 | 554 | elif not args.id: | ||
809 | 555 | args.id = get_default_container_id() | ||
810 | 556 | |||
811 | 557 | container = LibertineContainer(args.id) | ||
812 | 558 | |||
813 | 559 | if not container.exec_command(args.command): | ||
814 | 560 | sys.exit(1) | ||
815 | 561 | |||
816 | 562 | |||
817 | 563 | def delete_archive_by_name(container_id, archive_name): | ||
818 | 564 | update_archive_install_status(container_id, archive_name, 'removing') | ||
819 | 565 | if LibertineContainer(container_id).configure_command('delete-archive', archive_name) is not 0: | ||
820 | 566 | return False | ||
821 | 567 | delete_container_archive(container_id, archive_name) | ||
822 | 568 | return True | ||
823 | 569 | |||
824 | 570 | |||
825 | 571 | def configure(args): | ||
826 | 572 | if args.id and not libertine.utils.container_exists(args.id): | ||
827 | 573 | print("Container id \'%s\' does not exist." % args.id, file=sys.stderr) | ||
828 | 574 | sys.exit(1) | ||
829 | 575 | elif not args.id: | ||
830 | 576 | args.id = get_default_container_id() | ||
831 | 577 | |||
832 | 578 | container = LibertineContainer(args.id) | ||
833 | 579 | |||
834 | 580 | if args.multiarch and libertine.utils.get_host_architecture() == 'amd64': | ||
883 | 581 | multiarch = 'disabled' | 125 | multiarch = 'disabled' |
884 | 582 | if args.multiarch == 'enable': | 126 | if args.multiarch == 'enable': |
885 | 583 | multiarch = 'enabled' | 127 | multiarch = 'enabled' |
953 | 584 | 128 | self.containers_config.update_container_multiarch_support(args.id, multiarch) | |
954 | 585 | current_multiarch = get_container_multiarch_support(args.id) | 129 | |
955 | 586 | if current_multiarch == multiarch: | 130 | container = LibertineContainer(args.id) |
956 | 587 | print("i386 multiarch support is already %s" % multiarch) | 131 | self.containers_config.update_container_install_status(args.id, "installing") |
957 | 588 | sys.exit(1) | 132 | if not container.create_libertine_container(password, args.multiarch, args.verbosity): |
958 | 589 | 133 | self.containers_config.delete_container(args.id) | |
959 | 590 | if container.configure_command('multiarch', args.multiarch) is not 0: | 134 | sys.exit(1) |
960 | 591 | sys.exit(1) | 135 | self.containers_config.update_container_install_status(args.id, "ready") |
961 | 592 | 136 | ||
962 | 593 | update_container_multiarch_support(args.id, multiarch) | 137 | libertine.utils.refresh_libertine_scope() |
963 | 594 | 138 | ||
964 | 595 | elif args.add_archive: | 139 | def destroy_container_by_id(self, id): |
965 | 596 | if archive_exists(args.id, args.add_archive): | 140 | container = LibertineContainer(id) |
966 | 597 | print("%s already added in container." % args.add_archive) | 141 | |
967 | 598 | sys.exit(1) | 142 | self.containers_config.update_container_install_status(id, "removing") |
968 | 599 | 143 | container.destroy_libertine_container() | |
969 | 600 | add_container_archive(args.id, args.add_archive) | 144 | self.containers_config.update_container_install_status(id, "removed") |
970 | 601 | update_archive_install_status(args.id, args.add_archive, 'installing') | 145 | self.containers_config.delete_container(id) |
971 | 602 | if container.configure_command('add-archive', args.add_archive) is not 0: | 146 | |
972 | 603 | delete_container_archive(args.id, args.add_archive) | 147 | def destroy(self, args): |
973 | 604 | sys.exit(1) | 148 | args.id = self.containers_config.check_container_id(args.id) |
974 | 605 | 149 | ||
975 | 606 | update_archive_install_status(args.id, args.add_archive, 'installed') | 150 | self.destroy_container_by_id(args.id) |
976 | 607 | 151 | ||
977 | 608 | elif args.delete_archive: | 152 | libertine.utils.refresh_libertine_scope() |
978 | 609 | if not archive_exists(args.id, args.delete_archive): | 153 | |
979 | 610 | print("%s is not added in container." % args.delete_archive) | 154 | def install_package(self, args): |
980 | 611 | sys.exit(1) | 155 | container_id = self.containers_config.check_container_id(args.id) |
981 | 612 | 156 | ||
982 | 613 | if not delete_archive_by_name(args.id, args.delete_archive): | 157 | is_debian_package = args.package.endswith('.deb') |
983 | 614 | sys.exit(1) | 158 | |
984 | 615 | 159 | if is_debian_package: | |
985 | 616 | 160 | if os.path.exists(args.package): | |
986 | 617 | def merge(args): | 161 | package = DebPackage(args.package).pkgname |
987 | 618 | merge_container_config_files(args.file) | 162 | else: |
988 | 619 | 163 | print("%s does not exist." % args.package) | |
989 | 620 | 164 | sys.exit(1) | |
990 | 621 | def fix_integrity(args): | 165 | else: |
991 | 622 | for container in read_container_config_file()['containerList']: | 166 | package = args.package |
992 | 623 | if container['installStatus'] != 'ready': | 167 | |
993 | 624 | destroy_container_by_id(container['id']) | 168 | if self.containers_config.package_exists(container_id, package): |
994 | 625 | continue | 169 | if not is_debian_package: |
995 | 626 | LibertineContainer(container['id']).exec_command('dpkg --configure -a') | 170 | print("Package \'%s\' is already installed." % package) |
996 | 627 | 171 | sys.exit(1) | |
997 | 628 | for package in container['installedApps']: | 172 | else: |
998 | 629 | if package['appStatus'] != 'installed': | 173 | self.containers_config.add_new_package(container_id, package) |
999 | 630 | remove_package_by_name(container['id'], package['packageName']) | 174 | |
1000 | 631 | if 'extraArchives' in container: | 175 | container = LibertineContainer(container_id) |
1001 | 632 | for archive in container['extraArchives']: | 176 | |
1002 | 633 | if archive['archiveStatus'] != 'installed': | 177 | self.containers_config.update_package_install_status(container_id, package, "installing") |
1003 | 634 | delete_archive_by_name(container['id'], archive['archiveName']) | 178 | if not container.install_package(args.package, args.verbosity, args.readline): |
1004 | 635 | 179 | self.containers_config.delete_package(container_id, package) | |
1005 | 636 | 180 | sys.exit(1) | |
1006 | 637 | def set_default(args): | 181 | |
1007 | 638 | if args.clear: | 182 | self.containers_config.update_package_install_status(container_id, package, "installed") |
1008 | 639 | container_list = read_container_config_file() | 183 | |
1009 | 640 | container_list.pop('defaultContainer', None) | 184 | libertine.utils.refresh_libertine_scope() |
1010 | 641 | write_container_config_file(container_list) | 185 | |
1011 | 642 | sys.exit(0) | 186 | def remove_package_by_name(self, container_id, package_name, verbosity=1, readline=False): |
1012 | 643 | 187 | fallback_status = self.containers_config.get_package_install_status(container_id, package_name) | |
1013 | 644 | if not libertine.utils.container_exists(args.id): | 188 | self.containers_config.update_package_install_status(container_id, package_name, "removing") |
1014 | 645 | print("Container id \'%s\' does not exist." % args.id, file=sys.stderr) | 189 | |
1015 | 646 | sys.exit(1) | 190 | container = LibertineContainer(container_id) |
1016 | 647 | 191 | if not container.remove_package(package_name, verbosity, readline): | |
1017 | 648 | container_list = read_container_config_file() | 192 | self.containers_config.update_package_install_status(container_id, package_name, fallback_status) |
1018 | 649 | container_list['defaultContainer'] = args.id | 193 | return False |
1019 | 650 | write_container_config_file(container_list) | 194 | |
1020 | 195 | self.containers_config.update_package_install_status(container_id, package_name, "removed") | ||
1021 | 196 | self.containers_config.delete_package(container_id, package_name) | ||
1022 | 197 | |||
1023 | 198 | return True | ||
1024 | 199 | |||
1025 | 200 | def remove_package(self, args): | ||
1026 | 201 | container_id = self.containers_config.check_container_id(args.id) | ||
1027 | 202 | |||
1028 | 203 | if self.containers_config.get_package_install_status(container_id, args.package) != 'installed': | ||
1029 | 204 | print("Package \'%s\' is not installed." % args.package) | ||
1030 | 205 | sys.exit(1) | ||
1031 | 206 | |||
1032 | 207 | if not self.remove_package_by_name(container_id, args.package, args.verbosity, args.readline): | ||
1033 | 208 | sys.exit(1) | ||
1034 | 209 | |||
1035 | 210 | libertine.utils.refresh_libertine_scope() | ||
1036 | 211 | |||
1037 | 212 | def search_cache(self, args): | ||
1038 | 213 | container_id = self.containers_config.check_container_id(args.id) | ||
1039 | 214 | |||
1040 | 215 | container = LibertineContainer(container_id) | ||
1041 | 216 | if container.search_package_cache(args.search_string) is not 0: | ||
1042 | 217 | sys.exit(1) | ||
1043 | 218 | |||
1044 | 219 | def update(self, args): | ||
1045 | 220 | container_id = self.containers_config.check_container_id(args.id) | ||
1046 | 221 | |||
1047 | 222 | container = LibertineContainer(container_id) | ||
1048 | 223 | |||
1049 | 224 | self.containers_config.update_container_install_status(container_id, "updating") | ||
1050 | 225 | if container.update_libertine_container(args.verbosity) is not 0: | ||
1051 | 226 | self.containers_config.update_container_install_status(container_id, "ready") | ||
1052 | 227 | sys.exit(1) | ||
1053 | 228 | |||
1054 | 229 | self.containers_config.update_container_install_status(container_id, "ready") | ||
1055 | 230 | |||
1056 | 231 | def list(self, args): | ||
1057 | 232 | containers = libertine.utils.Libertine.list_containers() | ||
1058 | 233 | for container in containers: | ||
1059 | 234 | print("%s" % container) | ||
1060 | 235 | |||
1061 | 236 | def list_apps(self, args): | ||
1062 | 237 | container_id = self.containers_config.check_container_id(args.id) | ||
1063 | 238 | |||
1064 | 239 | container = LibertineContainer(container_id) | ||
1065 | 240 | print(container.list_app_launchers(use_json=args.json)) | ||
1066 | 241 | |||
1067 | 242 | def exec(self, args): | ||
1068 | 243 | container_id = self.containers_config.check_container_id(args.id) | ||
1069 | 244 | |||
1070 | 245 | container = LibertineContainer(container_id) | ||
1071 | 246 | |||
1072 | 247 | if not container.exec_command(args.command): | ||
1073 | 248 | sys.exit(1) | ||
1074 | 249 | |||
1075 | 250 | def delete_archive_by_name(self, container_id, archive_name): | ||
1076 | 251 | self.containers_config.update_archive_install_status(container_id, archive_name, 'removing') | ||
1077 | 252 | if LibertineContainer(container_id).configure_command('delete-archive', archive_name) is not 0: | ||
1078 | 253 | return False | ||
1079 | 254 | self.containers_config.delete_container_archive(container_id, archive_name) | ||
1080 | 255 | return True | ||
1081 | 256 | |||
1082 | 257 | def configure(self, args): | ||
1083 | 258 | container_id = self.containers_config.check_container_id(args.id) | ||
1084 | 259 | |||
1085 | 260 | container = LibertineContainer(container_id) | ||
1086 | 261 | |||
1087 | 262 | if args.multiarch and libertine.utils.get_host_architecture() == 'amd64': | ||
1088 | 263 | multiarch = 'disabled' | ||
1089 | 264 | if args.multiarch == 'enable': | ||
1090 | 265 | multiarch = 'enabled' | ||
1091 | 266 | |||
1092 | 267 | current_multiarch = self.containers_config.get_container_multiarch_support(container_id) | ||
1093 | 268 | if current_multiarch == multiarch: | ||
1094 | 269 | print("i386 multiarch support is already %s" % multiarch) | ||
1095 | 270 | sys.exit(1) | ||
1096 | 271 | |||
1097 | 272 | if container.configure_command('multiarch', args.multiarch) is not 0: | ||
1098 | 273 | sys.exit(1) | ||
1099 | 274 | |||
1100 | 275 | self.containers_config.update_container_multiarch_support(container_id, multiarch) | ||
1101 | 276 | |||
1102 | 277 | elif args.add_archive: | ||
1103 | 278 | if self.containers_config.archive_exists(container_id, args.add_archive): | ||
1104 | 279 | print("%s already added in container." % args.add_archive) | ||
1105 | 280 | sys.exit(1) | ||
1106 | 281 | |||
1107 | 282 | self.containers_config.add_container_archive(container_id, args.add_archive) | ||
1108 | 283 | self.containers_config.update_archive_install_status(container_id, args.add_archive, 'installing') | ||
1109 | 284 | if container.configure_command('add-archive', args.add_archive) is not 0: | ||
1110 | 285 | self.containers_config.delete_container_archive(container_id, args.add_archive) | ||
1111 | 286 | sys.exit(1) | ||
1112 | 287 | |||
1113 | 288 | self.containers_config.update_archive_install_status(container_id, args.add_archive, 'installed') | ||
1114 | 289 | |||
1115 | 290 | elif args.delete_archive: | ||
1116 | 291 | if not self.containers_config.archive_exists(container_id, args.delete_archive): | ||
1117 | 292 | print("%s is not added in container." % args.delete_archive) | ||
1118 | 293 | sys.exit(1) | ||
1119 | 294 | |||
1120 | 295 | if not self.delete_archive_by_name(container_id, args.delete_archive): | ||
1121 | 296 | sys.exit(1) | ||
1122 | 297 | |||
1123 | 298 | def merge(self, args): | ||
1124 | 299 | self.containers_config.merge_container_config_files(args.file) | ||
1125 | 300 | |||
1126 | 301 | def fix_integrity(self, args): | ||
1127 | 302 | for container in self.containers_config.container_list['containerList']: | ||
1128 | 303 | if container['installStatus'] != 'ready': | ||
1129 | 304 | self.destroy_container_by_id(container['id']) | ||
1130 | 305 | continue | ||
1131 | 306 | LibertineContainer(container['id']).exec_command('dpkg --configure -a') | ||
1132 | 307 | |||
1133 | 308 | for package in container['installedApps']: | ||
1134 | 309 | if package['appStatus'] != 'installed': | ||
1135 | 310 | self.remove_package_by_name(container['id'], package['packageName']) | ||
1136 | 311 | |||
1137 | 312 | if 'extraArchives' in container: | ||
1138 | 313 | for archive in container['extraArchives']: | ||
1139 | 314 | if archive['archiveStatus'] != 'installed': | ||
1140 | 315 | self.delete_archive_by_name(container['id'], archive['archiveName']) | ||
1141 | 316 | |||
1142 | 317 | def set_default(self, args): | ||
1143 | 318 | if args.clear: | ||
1144 | 319 | self.containers_config.clear_default_container_id(True) | ||
1145 | 320 | sys.exit(0) | ||
1146 | 321 | |||
1147 | 322 | container_id = self.containers_config.check_container_id(args.id) | ||
1148 | 323 | |||
1149 | 324 | self.containers_config.set_default_container_id(container_id, True) | ||
1150 | 651 | 325 | ||
1151 | 652 | 326 | ||
1152 | 653 | if __name__ == '__main__': | 327 | if __name__ == '__main__': |
1153 | @@ -657,6 +331,8 @@ | |||
1154 | 657 | print("Please do not run %s using sudo" % parser.prog) | 331 | print("Please do not run %s using sudo" % parser.prog) |
1155 | 658 | sys.exit(1) | 332 | sys.exit(1) |
1156 | 659 | 333 | ||
1157 | 334 | container_manager = LibertineContainerManager() | ||
1158 | 335 | |||
1159 | 660 | parser.add_argument('-q', '--quiet', | 336 | parser.add_argument('-q', '--quiet', |
1160 | 661 | action='store_const', dest='verbosity', const=0, | 337 | action='store_const', dest='verbosity', const=0, |
1161 | 662 | help=('do not print status updates on stdout')) | 338 | help=('do not print status updates on stdout')) |
1162 | @@ -696,7 +372,7 @@ | |||
1163 | 696 | '--password', | 372 | '--password', |
1164 | 697 | help=("Pass in the user's password when creating an LXC container. This " | 373 | help=("Pass in the user's password when creating an LXC container. This " |
1165 | 698 | "is intended for testing only and is very insecure.")) | 374 | "is intended for testing only and is very insecure.")) |
1167 | 699 | parser_create.set_defaults(func=create) | 375 | parser_create.set_defaults(func=container_manager.create) |
1168 | 700 | 376 | ||
1169 | 701 | # Handle the destroy command and its options | 377 | # Handle the destroy command and its options |
1170 | 702 | parser_destroy = subparsers.add_parser( | 378 | parser_destroy = subparsers.add_parser( |
1171 | @@ -705,7 +381,7 @@ | |||
1172 | 705 | parser_destroy.add_argument( | 381 | parser_destroy.add_argument( |
1173 | 706 | '-i', '--id', | 382 | '-i', '--id', |
1174 | 707 | help=("Container identifier. Default container is used if omitted.")) | 383 | help=("Container identifier. Default container is used if omitted.")) |
1176 | 708 | parser_destroy.set_defaults(func=destroy) | 384 | parser_destroy.set_defaults(func=container_manager.destroy) |
1177 | 709 | 385 | ||
1178 | 710 | # Handle the install-package command and its options | 386 | # Handle the install-package command and its options |
1179 | 711 | parser_install = subparsers.add_parser( | 387 | parser_install = subparsers.add_parser( |
1180 | @@ -721,7 +397,7 @@ | |||
1181 | 721 | parser_install.add_argument( | 397 | parser_install.add_argument( |
1182 | 722 | '-r', '--readline', action='store_true', | 398 | '-r', '--readline', action='store_true', |
1183 | 723 | help=("Readline mode. Use text-based frontend during debconf interactions.")) | 399 | help=("Readline mode. Use text-based frontend during debconf interactions.")) |
1185 | 724 | parser_install.set_defaults(func=install_package) | 400 | parser_install.set_defaults(func=container_manager.install_package) |
1186 | 725 | 401 | ||
1187 | 726 | # Handle the remove-package command and its options | 402 | # Handle the remove-package command and its options |
1188 | 727 | parser_remove = subparsers.add_parser( | 403 | parser_remove = subparsers.add_parser( |
1189 | @@ -737,7 +413,7 @@ | |||
1190 | 737 | parser_remove.add_argument( | 413 | parser_remove.add_argument( |
1191 | 738 | '-r', '--readline', action='store_true', | 414 | '-r', '--readline', action='store_true', |
1192 | 739 | help=("Readline mode. Use text-based frontend during debconf interactions.")) | 415 | help=("Readline mode. Use text-based frontend during debconf interactions.")) |
1194 | 740 | parser_remove.set_defaults(func=remove_package) | 416 | parser_remove.set_defaults(func=container_manager.remove_package) |
1195 | 741 | 417 | ||
1196 | 742 | # Handle the search-cache command and its options | 418 | # Handle the search-cache command and its options |
1197 | 743 | parser_search = subparsers.add_parser( | 419 | parser_search = subparsers.add_parser( |
1198 | @@ -750,7 +426,7 @@ | |||
1199 | 750 | parser_search.add_argument( | 426 | parser_search.add_argument( |
1200 | 751 | '-i', '--id', | 427 | '-i', '--id', |
1201 | 752 | help=("Container identifier. Default container is used if omitted.")) | 428 | help=("Container identifier. Default container is used if omitted.")) |
1203 | 753 | parser_search.set_defaults(func=search_cache) | 429 | parser_search.set_defaults(func=container_manager.search_cache) |
1204 | 754 | 430 | ||
1205 | 755 | # Handle the update command and its options | 431 | # Handle the update command and its options |
1206 | 756 | parser_update = subparsers.add_parser( | 432 | parser_update = subparsers.add_parser( |
1207 | @@ -759,13 +435,13 @@ | |||
1208 | 759 | parser_update.add_argument( | 435 | parser_update.add_argument( |
1209 | 760 | '-i', '--id', | 436 | '-i', '--id', |
1210 | 761 | help=("Container identifier. Default container is used if omitted.")) | 437 | help=("Container identifier. Default container is used if omitted.")) |
1212 | 762 | parser_update.set_defaults(func=update) | 438 | parser_update.set_defaults(func=container_manager.update) |
1213 | 763 | 439 | ||
1214 | 764 | # Handle the list command | 440 | # Handle the list command |
1215 | 765 | parser_list = subparsers.add_parser( | 441 | parser_list = subparsers.add_parser( |
1216 | 766 | "list", | 442 | "list", |
1217 | 767 | help=("List all Libertine containers.")) | 443 | help=("List all Libertine containers.")) |
1219 | 768 | parser_list.set_defaults(func=list) | 444 | parser_list.set_defaults(func=container_manager.list) |
1220 | 769 | 445 | ||
1221 | 770 | # Handle the list-apps command and its options | 446 | # Handle the list-apps command and its options |
1222 | 771 | parser_list_apps = subparsers.add_parser( | 447 | parser_list_apps = subparsers.add_parser( |
1223 | @@ -778,7 +454,7 @@ | |||
1224 | 778 | '-j', '--json', | 454 | '-j', '--json', |
1225 | 779 | action='store_true', | 455 | action='store_true', |
1226 | 780 | help=("use JSON output format.")) | 456 | help=("use JSON output format.")) |
1228 | 781 | parser_list_apps.set_defaults(func=list_apps) | 457 | parser_list_apps.set_defaults(func=container_manager.list_apps) |
1229 | 782 | 458 | ||
1230 | 783 | # Handle the execute command and it's options | 459 | # Handle the execute command and it's options |
1231 | 784 | parser_exec = subparsers.add_parser( | 460 | parser_exec = subparsers.add_parser( |
1232 | @@ -791,7 +467,7 @@ | |||
1233 | 791 | parser_exec.add_argument( | 467 | parser_exec.add_argument( |
1234 | 792 | '-c', '--command', | 468 | '-c', '--command', |
1235 | 793 | help=("The command to run in the specified container.")) | 469 | help=("The command to run in the specified container.")) |
1237 | 794 | parser_exec.set_defaults(func=exec) | 470 | parser_exec.set_defaults(func=container_manager.exec) |
1238 | 795 | 471 | ||
1239 | 796 | # Handle the configure command and it's options | 472 | # Handle the configure command and it's options |
1240 | 797 | parser_configure = subparsers.add_parser( | 473 | parser_configure = subparsers.add_parser( |
1241 | @@ -816,7 +492,7 @@ | |||
1242 | 816 | metavar='Archive name', | 492 | metavar='Archive name', |
1243 | 817 | help=("Deletes an existing archive (PPA) in the specified Libertine container. " | 493 | help=("Deletes an existing archive (PPA) in the specified Libertine container. " |
1244 | 818 | "Needs to be in the form of \"ppa:user/ppa-name\".")) | 494 | "Needs to be in the form of \"ppa:user/ppa-name\".")) |
1246 | 819 | parser_configure.set_defaults(func=configure) | 495 | parser_configure.set_defaults(func=container_manager.configure) |
1247 | 820 | 496 | ||
1248 | 821 | # Handle merging another ContainersConfig.json file into the main ContainersConfig.json file | 497 | # Handle merging another ContainersConfig.json file into the main ContainersConfig.json file |
1249 | 822 | parser_merge = subparsers.add_parser( | 498 | parser_merge = subparsers.add_parser( |
1250 | @@ -825,13 +501,13 @@ | |||
1251 | 825 | parser_merge.add_argument( | 501 | parser_merge.add_argument( |
1252 | 826 | '-f', '--file', | 502 | '-f', '--file', |
1253 | 827 | required=True) | 503 | required=True) |
1255 | 828 | parser_merge.set_defaults(func=merge) | 504 | parser_merge.set_defaults(func=container_manager.merge) |
1256 | 829 | 505 | ||
1257 | 830 | # Indiscriminately destroy containers, packages, and archives which are not fully installed | 506 | # Indiscriminately destroy containers, packages, and archives which are not fully installed |
1258 | 831 | parser_integrity = subparsers.add_parser( | 507 | parser_integrity = subparsers.add_parser( |
1259 | 832 | 'fix-integrity', | 508 | 'fix-integrity', |
1260 | 833 | add_help=False) | 509 | add_help=False) |
1262 | 834 | parser_integrity.set_defaults(func=fix_integrity) | 510 | parser_integrity.set_defaults(func=container_manager.fix_integrity) |
1263 | 835 | 511 | ||
1264 | 836 | # Set the default container in ContainersConfig | 512 | # Set the default container in ContainersConfig |
1265 | 837 | parser_default = subparsers.add_parser( | 513 | parser_default = subparsers.add_parser( |
1266 | @@ -844,7 +520,7 @@ | |||
1267 | 844 | parser_default.add_argument( | 520 | parser_default.add_argument( |
1268 | 845 | '-c', '--clear', action='store_true', | 521 | '-c', '--clear', action='store_true', |
1269 | 846 | help=("Clear the default container.")) | 522 | help=("Clear the default container.")) |
1271 | 847 | parser_default.set_defaults(func=set_default) | 523 | parser_default.set_defaults(func=container_manager.set_default) |
1272 | 848 | 524 | ||
1273 | 849 | # Actually parse the args | 525 | # Actually parse the args |
1274 | 850 | args = parser.parse_args() | 526 | args = parser.parse_args() |
PASSED: Continuous integration, rev:255 /jenkins. canonical. com/libertine/ job/lp- libertine- ci/12/ /jenkins. canonical. com/libertine/ job/build/ 94 /jenkins. canonical. com/libertine/ job/test- 0-autopkgtest/ label=amd64, release= vivid+overlay, testname= default/ 62 /jenkins. canonical. com/libertine/ job/test- 0-autopkgtest/ label=amd64, release= xenial+ overlay, testname= default/ 62 /jenkins. canonical. com/libertine/ job/test- 0-autopkgtest/ label=amd64, release= yakkety, testname= default/ 62 /jenkins. canonical. com/libertine/ job/test- 0-autopkgtest/ label=i386, release= vivid+overlay, testname= default/ 62 /jenkins. canonical. com/libertine/ job/test- 0-autopkgtest/ label=i386, release= xenial+ overlay, testname= default/ 62 /jenkins. canonical. com/libertine/ job/test- 0-autopkgtest/ label=i386, release= yakkety, testname= default/ 62 /jenkins. canonical. com/libertine/ job/lp- generic- update- mp/78/console /jenkins. canonical. com/libertine/ job/build- 0-fetch/ 97 /jenkins. canonical. com/libertine/ job/build- 1-sourcepkg/ release= vivid+overlay/ 82 /jenkins. canonical. com/libertine/ job/build- 1-sourcepkg/ release= xenial+ overlay/ 82 /jenkins. canonical. com/libertine/ job/build- 1-sourcepkg/ release= yakkety/ 82 /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=amd64, release= vivid+overlay/ 75 /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=amd64, release= vivid+overlay/ 75/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=amd64, release= xenial+ overlay/ 75 /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=amd64, release= xenial+ overlay/ 75/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=amd64, release= yakkety/ 75 /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=amd64, release= yakkety/ 75/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=i386, release= vivid+overlay/ 75 /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=i386, release= vivid+overlay/ 75/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=i386, release= xenial+ overlay/ 75 /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=i386, release= xenial+ overlay/ 75/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=i386, release= yakkety/ 75 /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=i386, release= yakkety/ 75/artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/libertine/ job/lp- libertine- ci/12/rebuild
https:/