Merge lp:click into lp:~ubuntu-managed-branches/click/click

Proposed by Colin Watson
Status: Merged
Merged at revision: 345
Proposed branch: lp:click
Merge into: lp:~ubuntu-managed-branches/click/click
Diff against target: 620 lines (+261/-41)
13 files modified
click/chroot.py (+81/-12)
click/commands/chroot.py (+32/-2)
click/commands/info.py (+6/-5)
click/tests/test_user.py (+4/-0)
debian/changelog (+30/-0)
debian/control (+1/-1)
doc/databases.rst (+65/-0)
doc/hooks.rst (+1/-1)
doc/index.rst (+1/-0)
doc/manpage.rst (+25/-3)
lib/click/click-0.4.pc.in (+1/-0)
lib/click/user.vala (+9/-11)
pk-plugin/pk-plugin-click.c (+5/-6)
To merge this branch: bzr merge lp:click
Reviewer Review Type Date Requested Status
Stéphane Graber Pending
Review via email: mp+211530@code.launchpad.net

Commit message

Click 0.4.19: pkg-config fixes, improve "click info" output, and several "click chroot" improvements including 14.04 support.

Description of the change

  [ Colin Watson ]
  * Set Click.User.ensure_db visibility back to private, since it's no
    longer used by Click.Hook. (The C ABI is unaffected.)
  * Add brief documentation on Click's multiple-database scheme, based on my
    recent mail to ubuntu-phone.
  * Fix a few potential GLib critical messages from the PackageKit plugin.
  * Make libclick-0.4-dev depend on libjson-glib-dev for
    <json-glib/json-glib.h>.
  * Add Requires.private to click-0.4.pc, so that programs built against
    libclick pick up the proper CFLAGS including glib and json-glib.
  * chroot: Allow creating 14.04 chroots.
  * Include _directory and _removable dynamic manifest keys in "click info"
    output (LP: #1293788).
  * Document -f and -s options to "click chroot" in click(1).
  * chroot: Fix code to make /finish.sh executable.
  * chroot: Make /usr/sbin/policy-rc.d executable in the chroot, as
    otherwise it has no effect.
  * chroot: Run apt-get dist-upgrade on the chroot before trying to install
    the basic build tool set. Fixes chroot creation for saucy.

  [ Benjamin Zeller ]
  * Take pkexec env vars into account when creating a chroot.

  [ Dimitri John Ledkov ]
  * Add session management to click chroot.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'click/chroot.py'
2--- click/chroot.py 2014-01-22 14:08:33 +0000
3+++ click/chroot.py 2014-03-18 13:53:02 +0000
4@@ -32,8 +32,17 @@
5 import subprocess
6
7
8+framework_base = {
9+ "ubuntu-sdk-13.10": "ubuntu-sdk-13.10",
10+ "ubuntu-sdk-14.04-html-dev1": "ubuntu-sdk-14.04",
11+ "ubuntu-sdk-14.04-papi-dev1": "ubuntu-sdk-14.04",
12+ "ubuntu-sdk-14.04-qml-dev1": "ubuntu-sdk-14.04",
13+ }
14+
15+
16 framework_series = {
17 "ubuntu-sdk-13.10": "saucy",
18+ "ubuntu-sdk-14.04": "trusty",
19 }
20
21
22@@ -56,6 +65,23 @@
23 "qtsensors5-dev:TARGET",
24 "qttools5-dev:TARGET",
25 ],
26+ "ubuntu-sdk-14.04": [
27+ "cmake",
28+ "libqt5svg5-dev:TARGET",
29+ "libqt5webkit5-dev:TARGET",
30+ "libqt5xmlpatterns5-dev:TARGET",
31+ "qt3d5-dev:TARGET",
32+ "qt5-default:TARGET",
33+ "qtbase5-dev:TARGET",
34+ "qtdeclarative5-dev:TARGET",
35+ "qtdeclarative5-dev-tools",
36+ "qtlocation5-dev:TARGET",
37+ "qtmultimedia5-dev:TARGET",
38+ "qtscript5-dev:TARGET",
39+ "qtsensors5-dev:TARGET",
40+ "qttools5-dev:TARGET",
41+ "qttools5-dev-tools:TARGET",
42+ ],
43 }
44
45
46@@ -67,15 +93,16 @@
47
48
49 class ClickChroot:
50- def __init__(self, target_arch, framework, name=None, series=None):
51+ def __init__(self, target_arch, framework, name=None, series=None, session=None):
52+ self.target_arch = target_arch
53+ self.framework = framework
54 if name is None:
55 name = "click"
56+ self.name = name
57 if series is None:
58- series = framework_series[framework]
59- self.target_arch = target_arch
60- self.framework = framework
61- self.name = name
62+ series = framework_series[self.framework_base]
63 self.series = series
64+ self.session = session
65 self.native_arch = subprocess.check_output(
66 ["dpkg", "--print-architecture"],
67 universal_newlines=True).strip()
68@@ -87,6 +114,8 @@
69 self.archive = "http://archive.ubuntu.com/ubuntu"
70 if "SUDO_USER" in os.environ:
71 self.user = os.environ["SUDO_USER"]
72+ elif "PKEXEC_UID" in os.environ:
73+ self.user = pwd.getpwuid(int(os.environ["PKEXEC_UID"])).pw_name
74 else:
75 self.user = pwd.getpwuid(os.getuid()).pw_name
76 self.dpkg_architecture = self._dpkg_architecture()
77@@ -127,8 +156,19 @@
78 return sources
79
80 @property
81+ def framework_base(self):
82+ if self.framework in framework_base:
83+ return framework_base[self.framework]
84+ else:
85+ return self.framework
86+
87+ @property
88 def full_name(self):
89- return "%s-%s-%s" % (self.name, self.framework, self.target_arch)
90+ return "%s-%s-%s" % (self.name, self.framework_base, self.target_arch)
91+
92+ @property
93+ def full_session_name(self):
94+ return "%s-%s" % (self.full_name, self.session)
95
96 def exists(self):
97 command = ["schroot", "-c", self.full_name, "-i"]
98@@ -136,6 +176,10 @@
99 return subprocess.call(
100 command, stdout=devnull, stderr=devnull) == 0
101
102+ def _make_executable(self, path):
103+ mode = stat.S_IMODE(os.stat(path).st_mode)
104+ os.chmod(path, mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
105+
106 def create(self):
107 if self.exists():
108 raise ClickChrootException(
109@@ -156,7 +200,7 @@
110 "pkg-config-%s" % target_tuple, "cmake",
111 "dpkg-cross", "libc-dev:%s" % self.target_arch
112 ]
113- for package in extra_packages.get(self.framework, []):
114+ for package in extra_packages.get(self.framework_base, []):
115 package = package.replace(":TARGET", ":%s" % self.target_arch)
116 build_pkgs.append(package)
117 os.makedirs(mount)
118@@ -205,6 +249,7 @@
119 print(" *) exit 101;;", file=policy)
120 print(" esac", file=policy)
121 print("done", file=policy)
122+ self._make_executable(daemon_policy)
123 os.remove("%s/sbin/initctl" % mount)
124 os.symlink("%s/bin/true" % mount, "%s/sbin/initctl" % mount)
125 finish_script = "%s/finish.sh" % mount
126@@ -235,6 +280,7 @@
127 debconf-communicate", file=finish)
128 print("echo set debconf/priority critical | \
129 debconf-communicate", file=finish)
130+ print("apt-get -y --force-yes dist-upgrade", file=finish)
131 print("# Install basic build tool set to match buildd",
132 file=finish)
133 print("apt-get -y --force-yes install %s"
134@@ -249,7 +295,7 @@
135 print("# Clean up", file=finish)
136 print("rm /finish.sh", file=finish)
137 print("apt-get clean", file=finish)
138- os.chmod(finish_script, stat.S_IEXEC)
139+ self._make_executable(finish_script)
140 command = ["/finish.sh"]
141 self.maint(*command)
142
143@@ -257,16 +303,24 @@
144 if not self.exists():
145 raise ClickChrootException(
146 "Chroot %s does not exist" % self.full_name)
147- command = ["schroot", "-c", self.full_name, "--", "env"]
148+ command = ["schroot", "-c"]
149+ if self.session:
150+ command.extend([self.full_session_name, "--run-session"])
151+ else:
152+ command.append(self.full_name)
153+ command.extend(["--", "env"])
154 for key, value in self.dpkg_architecture.items():
155 command.append("%s=%s" % (key, value))
156 command.extend(args)
157 subprocess.check_call(command)
158
159 def maint(self, *args):
160- command = [
161- "schroot", "-c", "source:%s" % self.full_name, "-u", "root", "--",
162- ]
163+ command = [ "schroot", "-u", "root", "-c" ]
164+ if self.session:
165+ command.extend([self.full_session_name, "--run-session"])
166+ else:
167+ command.append("source:%s" % self.full_name)
168+ command.append("--")
169 command.extend(args)
170 subprocess.check_call(command)
171
172@@ -305,3 +359,18 @@
173 os.remove(chroot_config)
174 mount = "%s/%s" % (self.chroots_dir, self.full_name)
175 shutil.rmtree(mount)
176+
177+ def begin_session(self):
178+ if not self.exists():
179+ raise ClickChrootException(
180+ "Chroot %s does not exist" % self.full_name)
181+ command = ["schroot", "-c", self.full_name, "--begin-session",
182+ "--session-name", self.full_session_name]
183+ subprocess.check_call(command)
184+
185+ def end_session(self):
186+ if not self.exists():
187+ raise ClickChrootException(
188+ "Chroot %s does not exist" % self.full_name)
189+ command = ["schroot", "-c", self.full_session_name, "--end-session"]
190+ subprocess.check_call(command)
191
192=== modified file 'click/commands/chroot.py'
193--- click/commands/chroot.py 2013-12-13 12:12:41 +0000
194+++ click/commands/chroot.py 2014-03-18 13:53:02 +0000
195@@ -55,20 +55,28 @@
196 program = args.program
197 if not program:
198 program = ["/bin/bash"]
199- ClickChroot(args.architecture, args.framework).run(*program)
200+ ClickChroot(args.architecture, args.framework, session=args.session).run(*program)
201
202
203 def maint(parser, args):
204 program = args.program
205 if not program:
206 program = ["/bin/bash"]
207- ClickChroot(args.architecture, args.framework).maint(*program)
208+ ClickChroot(args.architecture, args.framework, session=args.session).maint(*program)
209
210
211 def upgrade(parser, args):
212 ClickChroot(args.architecture, args.framework).upgrade()
213
214
215+def begin_session(parser, args):
216+ ClickChroot(args.architecture, args.framework, session=args.session).begin_session()
217+
218+
219+def end_session(parser, args):
220+ ClickChroot(args.architecture, args.framework, session=args.session).end_session()
221+
222+
223 def run(argv):
224 parser = ArgumentParser("click chroot")
225 subparsers = parser.add_subparsers(
226@@ -107,6 +115,10 @@
227 "run",
228 help="run a program in the chroot")
229 execute_parser.add_argument(
230+ "-n", "--session-name",
231+ dest='session',
232+ help="persistent chroot session name to run a program in")
233+ execute_parser.add_argument(
234 "program", nargs=REMAINDER,
235 help="program to run with arguments")
236 execute_parser.set_defaults(func=execute)
237@@ -114,9 +126,27 @@
238 "maint",
239 help="run a maintenance command in the chroot")
240 maint_parser.add_argument(
241+ "-n", "--session-name",
242+ dest='session',
243+ help="persistent chroot session name to run a maintenance command in")
244+ maint_parser.add_argument(
245 "program", nargs=REMAINDER,
246 help="program to run with arguments")
247 maint_parser.set_defaults(func=maint)
248+ begin_parser = subparsers.add_parser(
249+ "begin-session",
250+ help="begin a persistent chroot session")
251+ begin_parser.add_argument(
252+ "session",
253+ help="new session name")
254+ begin_parser.set_defaults(func=begin_session)
255+ end_parser = subparsers.add_parser(
256+ "end-session",
257+ help="end a persistent chroot session")
258+ end_parser.add_argument(
259+ "session",
260+ help="session name to end")
261+ end_parser.set_defaults(func=end_session)
262 args = parser.parse_args(argv)
263 if not hasattr(args, "func"):
264 parser.print_help()
265
266=== modified file 'click/commands/info.py'
267--- click/commands/info.py 2014-03-10 09:30:31 +0000
268+++ click/commands/info.py 2014-03-18 13:53:02 +0000
269@@ -41,7 +41,12 @@
270 with closing(DebFile(filename=arg)) as package:
271 with package.control.get_file(
272 "manifest", encoding="UTF-8") as manifest_file:
273- return json.load(manifest_file)
274+ manifest = json.load(manifest_file)
275+ keys = list(manifest)
276+ for key in keys:
277+ if key.startswith("_"):
278+ del manifest[key]
279+ return manifest
280
281
282 def run(argv):
283@@ -60,10 +65,6 @@
284 except Exception as e:
285 print(e, file=sys.stderr)
286 return 1
287- keys = list(manifest)
288- for key in keys:
289- if key.startswith("_"):
290- del manifest[key]
291 json.dump(
292 manifest, sys.stdout, ensure_ascii=False, sort_keys=True, indent=4,
293 separators=(",", ": "))
294
295=== modified file 'click/tests/test_user.py'
296--- click/tests/test_user.py 2014-03-10 09:30:31 +0000
297+++ click/tests/test_user.py 2014-03-18 13:53:02 +0000
298@@ -311,6 +311,7 @@
299 json.dump(manifest_obj, manifest)
300 manifest_obj["_directory"] = os.path.join(
301 registry.get_overlay_db(), "a")
302+ manifest_obj["_removable"] = 1
303 registry.set_version("a", "1.0")
304 self.assertEqual(
305 manifest_obj, json_object_to_python(registry.get_manifest("a")))
306@@ -321,16 +322,19 @@
307 "name": "a",
308 "version": "1.1",
309 "_directory": os.path.join(user_dbs[1], "a"),
310+ "_removable": 1,
311 }, json_object_to_python(registry.get_manifest("a")))
312 self.assertEqual({
313 "name": "b",
314 "version": "2.0",
315 "_directory": os.path.join(user_dbs[0], "b"),
316+ "_removable": 1,
317 }, json_object_to_python(registry.get_manifest("b")))
318 self.assertEqual({
319 "name": "c",
320 "version": "0.1",
321 "_directory": os.path.join(user_dbs[1], "c"),
322+ "_removable": 1,
323 }, json_object_to_python(registry.get_manifest("c")))
324 self.assertRaisesUserError(
325 Click.UserError.NO_SUCH_PACKAGE, registry.get_path, "d")
326
327=== modified file 'debian/changelog'
328--- debian/changelog 2014-03-12 12:02:47 +0000
329+++ debian/changelog 2014-03-18 13:53:02 +0000
330@@ -1,3 +1,33 @@
331+click (0.4.19) UNRELEASED; urgency=medium
332+
333+ [ Colin Watson ]
334+ * Set Click.User.ensure_db visibility back to private, since it's no
335+ longer used by Click.Hook. (The C ABI is unaffected.)
336+ * Add brief documentation on Click's multiple-database scheme, based on my
337+ recent mail to ubuntu-phone.
338+ * Fix a few potential GLib critical messages from the PackageKit plugin.
339+ * Make libclick-0.4-dev depend on libjson-glib-dev for
340+ <json-glib/json-glib.h>.
341+ * Add Requires.private to click-0.4.pc, so that programs built against
342+ libclick pick up the proper CFLAGS including glib and json-glib.
343+ * chroot: Allow creating 14.04 chroots.
344+ * Include _directory and _removable dynamic manifest keys in "click info"
345+ output (LP: #1293788).
346+ * Document -f and -s options to "click chroot" in click(1).
347+ * chroot: Fix code to make /finish.sh executable.
348+ * chroot: Make /usr/sbin/policy-rc.d executable in the chroot, as
349+ otherwise it has no effect.
350+ * chroot: Run apt-get dist-upgrade on the chroot before trying to install
351+ the basic build tool set. Fixes chroot creation for saucy.
352+
353+ [ Benjamin Zeller ]
354+ * Take pkexec env vars into account when creating a chroot.
355+
356+ [ Dimitri John Ledkov ]
357+ * Add session management to click chroot.
358+
359+ -- Colin Watson <cjwatson@ubuntu.com> Wed, 12 Mar 2014 14:23:34 +0000
360+
361 click (0.4.18.3) trusty; urgency=medium
362
363 [ Colin Watson ]
364
365=== modified file 'debian/control'
366--- debian/control 2014-03-06 20:51:27 +0000
367+++ debian/control 2014-03-18 13:53:02 +0000
368@@ -66,7 +66,7 @@
369 Architecture: any
370 Multi-Arch: same
371 Pre-Depends: ${misc:Pre-Depends}
372-Depends: ${shlibs:Depends}, ${misc:Depends}, libclick-0.4-0 (= ${binary:Version}), libglib2.0-dev
373+Depends: ${shlibs:Depends}, ${misc:Depends}, libclick-0.4-0 (= ${binary:Version}), libglib2.0-dev, libjson-glib-dev
374 Description: development files for Click package management library
375 Click is a simplified packaging format that installs in a separate part of
376 the file system, suitable for third-party applications.
377
378=== added file 'doc/databases.rst'
379--- doc/databases.rst 1970-01-01 00:00:00 +0000
380+++ doc/databases.rst 2014-03-18 13:53:02 +0000
381@@ -0,0 +1,65 @@
382+=========
383+Databases
384+=========
385+
386+(This is a lightly-edited copy of a brain-dump sent by Colin Watson to the
387+ubuntu-phone mailing list, preserved here since it may be useful.)
388+
389+Click has multiple databases where packages may be unpacked: by default we
390+have the "core" database for core apps (``/usr/share/click/preinstalled/``),
391+the "custom" database for carrier/OEM customisations (``/custom/click/``),
392+and the "default" database for user-installed applications
393+(``/opt/click.ubuntu.com/``), although these are configurable in
394+``/etc/click/databases/``. Each database may have multiple unpacked
395+versions of any given package.
396+
397+Each database may also have user registrations, which live in
398+``.click/users/`` relative to the database root. Each user has a
399+subdirectory of that, which contains symlinks to the versions of each
400+package they have registered. This means that on a tablet, say, I can
401+install an app without it also showing up on my children's accounts; they'd
402+need to install it separately, although the disk space for the unpacked copy
403+of the app would be shared.
404+
405+There was an idea early on that we'd deal with preinstalled apps by going
406+round and registering them all for all active users on first boot. This
407+would have lots of problems for the packaging system, though. Most notably,
408+doing it that way makes it hard for a user to remove an app and make it
409+stick, because it would tend to reappear on system updates. You can
410+probably fudge your way around this somehow, but it gets very fiddly and
411+easy to get wrong.
412+
413+What we do instead is: we have an ``@all`` pseudo-user which you can
414+register packages for, typically in the core database (``click register
415+--root=/usr/share/click/preinstalled --all-users``). If a user wants to
416+remove a package, we do this by creating a deliberately broken symlink
417+pointing to ``@hidden`` in their user registration area in
418+``/opt/click.ubuntu.com/.click/users/$USERNAME/``. When click is asked to
419+list the set of packages for a given user, it walks its way down the list of
420+databases from top (default) to bottom (core). For each database, it checks
421+registrations for that user, followed by registrations for ``@all``. It
422+takes the first registration for any given package name that it finds. If
423+that registration is ``@hidden``, then it ignores the package, otherwise it
424+must be a link to the unpacked copy of the appropriate version of the
425+package.
426+
427+There are still some things that can't be done just with static files in the
428+image and instead have to be done at boot time and on session startup: we
429+have to make sure the right AppArmor profiles are loaded, do things to the
430+user's home directory like creating .desktop files, and that kind of thing.
431+We run ``click hook run-system`` at boot time and ``click hook run-user`` on
432+session startup, and these deal with running hooks for whatever packages are
433+visible in context, according to the rules above.
434+
435+The effect of all this is that we can hide a core app for a carrier by doing
436+this as root when preparing their custom overlay image::
437+
438+ click unregister --root=/custom/click --all-users PACKAGE-NAME
439+
440+This will create a symlink ``/custom/click/.click/users/@all/PACKAGE-NAME``
441+pointing to ``@hidden``. Unless a user explicitly installs the app in
442+question, the effect of this will be that it's as if the app just isn't
443+there. It shouldn't incur any more than a negligible cost at startup
444+(basically just a readlink call); at the moment I think we might still
445+create an AppArmor profile for it, which isn't free, but that can be fixed
446+easily enough.
447
448=== modified file 'doc/hooks.rst'
449--- doc/hooks.rst 2014-01-22 11:43:39 +0000
450+++ doc/hooks.rst 2014-03-18 13:53:02 +0000
451@@ -219,7 +219,7 @@
452 "hooks": {
453 "example-app": {
454 "apparmor": "apparmor/example-app.json",
455- "desktop": "example-app.desktop",
456+ "desktop": "example-app.desktop"
457 }
458 }
459
460
461=== modified file 'doc/index.rst'
462--- doc/index.rst 2014-03-02 00:04:16 +0000
463+++ doc/index.rst 2014-03-18 13:53:02 +0000
464@@ -84,6 +84,7 @@
465 file-format.rst
466 constraints.rst
467 hooks.rst
468+ databases.rst
469 todo.rst
470
471
472
473=== modified file 'doc/manpage.rst'
474--- doc/manpage.rst 2013-11-01 15:40:05 +0000
475+++ doc/manpage.rst 2014-03-18 13:53:02 +0000
476@@ -97,27 +97,49 @@
477
478 Options:
479
480--a ARCH, --architecture ARCH Set the target architecture.
481+-a ARCH, --architecture ARCH Set the target architecture.
482+-f FRAMEWORK, --framework FRAMEWORK Set the target framework (default:
483+ ubuntu-sdk-13.10).
484+-s SERIES, --series SERIES Set the target series for
485+ newly-created chroots (default: a
486+ series appropriate for the
487+ framework).
488+ This option is mainly for debugging;
489+ use -f instead.
490
491 Subcommands:
492
493+begin-session SESSION
494+ Begin a persistent chroot session.
495+
496 create
497 Create a chroot.
498
499 destroy
500 Destroy a chroot.
501
502+end-session SESSION
503+ End a persistent chroot session.
504+
505 install PACKAGES
506 Install packages in the chroot.
507
508-maint COMMAND ARGUMENTS
509+maint [-n SESSION] COMMAND ARGUMENTS
510 Run a maintenance command in the chroot. Unlike ``run``, this runs its
511 command as root inside the chroot, and its effects on the chroot will
512 persist after ``click chroot maint`` exits.
513
514-run COMMAND ARGUMENTS
515+ If a session name is given, run the command in that session. The
516+ session must previously have been created by ``click chroot
517+ begin-session``.
518+
519+run [-n SESSION] COMMAND ARGUMENTS
520 Run a program in the chroot.
521
522+ If a session name is given, run the command in that session. The
523+ session must previously have been created by ``click chroot
524+ begin-session``.
525+
526 upgrade
527 Upgrade the chroot.
528
529
530=== modified file 'lib/click/click-0.4.pc.in'
531--- lib/click/click-0.4.pc.in 2014-03-03 17:01:37 +0000
532+++ lib/click/click-0.4.pc.in 2014-03-18 13:53:02 +0000
533@@ -23,5 +23,6 @@
534 Description: Click package manipulation library
535 Version: @PACKAGE_VERSION@
536 URL: https://click.readthedocs.org/en/latest/
537+Requires.private: glib-2.0 gobject-2.0 json-glib-1.0
538 Libs: -L${libdir} -lclick-0.4
539 Cflags: -I${includedir}/click-0.4
540
541=== modified file 'lib/click/user.vala'
542--- lib/click/user.vala 2014-03-12 10:50:00 +0000
543+++ lib/click/user.vala 2014-03-18 13:53:02 +0000
544@@ -301,7 +301,7 @@
545 return db_for_user (db.overlay, name);
546 }
547
548- internal void
549+ private void
550 ensure_db () throws UserError
551 {
552 if (users == null)
553@@ -668,6 +668,12 @@
554 var obj = db.get_manifest (package, get_version (package));
555 /* Adjust _directory to point to the user registration path. */
556 obj.set_string_member ("_directory", get_path (package));
557+ /* This should really be a boolean, but it was mistakenly
558+ * made an int when the "_removable" key was first created.
559+ * We may change this in future.
560+ */
561+ obj.set_int_member ("_removable",
562+ is_removable (package) ? 1 : 0);
563 return obj;
564 }
565
566@@ -683,16 +689,8 @@
567 get_manifests () throws Error
568 {
569 var ret = new Json.Array ();
570- foreach (var package in get_package_names ()) {
571- var obj = get_manifest (package);
572- /* This should really be a boolean, but it was
573- * mistakenly made an int when the "_removable" key
574- * was first created. We may change this in future.
575- */
576- obj.set_int_member ("_removable",
577- is_removable (package) ? 1 : 0);
578- ret.add_object_element (obj);
579- }
580+ foreach (var package in get_package_names ())
581+ ret.add_object_element (get_manifest (package));
582 return ret;
583 }
584
585
586=== modified file 'pk-plugin/pk-plugin-click.c'
587--- pk-plugin/pk-plugin-click.c 2014-03-11 11:33:21 +0000
588+++ pk-plugin/pk-plugin-click.c 2014-03-18 13:53:02 +0000
589@@ -67,9 +67,8 @@
590 ret = TRUE;
591
592 out:
593- if (info)
594- g_object_unref (info);
595- g_object_unref (file);
596+ g_clear_object (&info);
597+ g_clear_object (&file);
598 return ret;
599 }
600
601@@ -391,7 +390,7 @@
602 out:
603 if (error)
604 g_error_free (error);
605- g_object_unref (registry);
606+ g_clear_object (&registry);
607 g_free (username);
608
609 return array;
610@@ -702,8 +701,8 @@
611 if (error)
612 g_error_free (error);
613 g_free (old_version);
614- g_object_unref (registry);
615- g_object_unref (db);
616+ g_clear_object (&registry);
617+ g_clear_object (&db);
618 g_free (version);
619 g_free (name);
620 g_free (username);

Subscribers

People subscribed via source and target branches