diff options
Diffstat (limited to 'meta/recipes-core/systemd/systemd/0002-Revert-analyze-use-GDBus-instead-of-dbus-python.patch')
-rw-r--r-- | meta/recipes-core/systemd/systemd/0002-Revert-analyze-use-GDBus-instead-of-dbus-python.patch | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/0002-Revert-analyze-use-GDBus-instead-of-dbus-python.patch b/meta/recipes-core/systemd/systemd/0002-Revert-analyze-use-GDBus-instead-of-dbus-python.patch new file mode 100644 index 0000000000..e5e8d7df0d --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0002-Revert-analyze-use-GDBus-instead-of-dbus-python.patch | |||
@@ -0,0 +1,91 @@ | |||
1 | From 8079db861b8ffdce69fa10a9ab9ef4740045187f Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Mon, 10 Dec 2012 12:25:00 +0100 | ||
4 | Subject: [PATCH 2/2] Revert "analyze: use GDBus instead of dbus-python" | ||
5 | |||
6 | This reverts commit 4940c64240541e91411620b7dc0963e012aa6b91. | ||
7 | |||
8 | Python-gobject is too old in current OE | ||
9 | --- | ||
10 | src/analyze/systemd-analyze | 31 ++++++++++++++----------------- | ||
11 | 1 files changed, 14 insertions(+), 17 deletions(-) | ||
12 | |||
13 | diff --git a/src/analyze/systemd-analyze b/src/analyze/systemd-analyze | ||
14 | index 87a83dd..636fd74 100755 | ||
15 | --- a/src/analyze/systemd-analyze | ||
16 | +++ b/src/analyze/systemd-analyze | ||
17 | @@ -1,15 +1,14 @@ | ||
18 | #!/usr/bin/python | ||
19 | |||
20 | -import getopt, sys, os | ||
21 | -from gi.repository import Gio | ||
22 | +import getopt, dbus, sys, os | ||
23 | try: | ||
24 | import cairo | ||
25 | except ImportError: | ||
26 | cairo = None | ||
27 | |||
28 | def acquire_time_data(): | ||
29 | - manager = Gio.DBusProxy.new_for_bus_sync(bus, Gio.DBusProxyFlags.NONE, | ||
30 | - None, 'org.freedesktop.systemd1', '/org/freedesktop/systemd1', 'org.freedesktop.systemd1.Manager', None) | ||
31 | + | ||
32 | + manager = dbus.Interface(bus.get_object('org.freedesktop.systemd1', '/org/freedesktop/systemd1'), 'org.freedesktop.systemd1.Manager') | ||
33 | units = manager.ListUnits() | ||
34 | |||
35 | l = [] | ||
36 | @@ -18,25 +17,23 @@ def acquire_time_data(): | ||
37 | if i[5] != "": | ||
38 | continue | ||
39 | |||
40 | - properties = Gio.DBusProxy.new_for_bus_sync(bus, Gio.DBusProxyFlags.NONE, | ||
41 | - None, 'org.freedesktop.systemd1', i[6], 'org.freedesktop.DBus.Properties', None) | ||
42 | + properties = dbus.Interface(bus.get_object('org.freedesktop.systemd1', i[6]), 'org.freedesktop.DBus.Properties') | ||
43 | |||
44 | - ixt = properties.Get('(ss)', 'org.freedesktop.systemd1.Unit', 'InactiveExitTimestampMonotonic') | ||
45 | - aet = properties.Get('(ss)', 'org.freedesktop.systemd1.Unit', 'ActiveEnterTimestampMonotonic') | ||
46 | - axt = properties.Get('(ss)', 'org.freedesktop.systemd1.Unit', 'ActiveExitTimestampMonotonic') | ||
47 | - iet = properties.Get('(ss)', 'org.freedesktop.systemd1.Unit', 'InactiveEnterTimestampMonotonic') | ||
48 | + ixt = int(properties.Get('org.freedesktop.systemd1.Unit', 'InactiveExitTimestampMonotonic')) | ||
49 | + aet = int(properties.Get('org.freedesktop.systemd1.Unit', 'ActiveEnterTimestampMonotonic')) | ||
50 | + axt = int(properties.Get('org.freedesktop.systemd1.Unit', 'ActiveExitTimestampMonotonic')) | ||
51 | + iet = int(properties.Get('org.freedesktop.systemd1.Unit', 'InactiveEnterTimestampMonotonic')) | ||
52 | |||
53 | l.append((str(i[0]), ixt, aet, axt, iet)) | ||
54 | |||
55 | return l | ||
56 | |||
57 | def acquire_start_time(): | ||
58 | - properties = Gio.DBusProxy.new_for_bus_sync(bus, Gio.DBusProxyFlags.NONE, | ||
59 | - None, 'org.freedesktop.systemd1', '/org/freedesktop/systemd1', 'org.freedesktop.DBus.Properties', None) | ||
60 | + properties = dbus.Interface(bus.get_object('org.freedesktop.systemd1', '/org/freedesktop/systemd1'), 'org.freedesktop.DBus.Properties') | ||
61 | |||
62 | - initrd_time = properties.Get('(ss)', 'org.freedesktop.systemd1.Manager', 'InitRDTimestampMonotonic') | ||
63 | - userspace_time = properties.Get('(ss)', 'org.freedesktop.systemd1.Manager', 'UserspaceTimestampMonotonic') | ||
64 | - finish_time = properties.Get('(ss)', 'org.freedesktop.systemd1.Manager', 'FinishTimestampMonotonic') | ||
65 | + initrd_time = int(properties.Get('org.freedesktop.systemd1.Manager', 'InitRDTimestampMonotonic')) | ||
66 | + userspace_time = int(properties.Get('org.freedesktop.systemd1.Manager', 'UserspaceTimestampMonotonic')) | ||
67 | + finish_time = int(properties.Get('org.freedesktop.systemd1.Manager', 'FinishTimestampMonotonic')) | ||
68 | |||
69 | if finish_time == 0: | ||
70 | sys.stderr.write("Bootup is not yet finished. Please try again later.\n") | ||
71 | @@ -284,7 +281,7 @@ def unknown_verb(): | ||
72 | usage() | ||
73 | sys.exit(1) | ||
74 | |||
75 | -bus = Gio.BusType.SYSTEM | ||
76 | +bus = dbus.SystemBus() | ||
77 | |||
78 | try: | ||
79 | opts, args = getopt.gnu_getopt(sys.argv[1:], "h", ["help", "user"]) | ||
80 | @@ -296,7 +293,7 @@ for o, a in opts: | ||
81 | if o in ("-h", "--help"): | ||
82 | help() | ||
83 | elif o == '--user': | ||
84 | - bus = Gio.BusType.SESSION | ||
85 | + bus = dbus.SessionBus() | ||
86 | else: | ||
87 | assert False, "unhandled option" | ||
88 | |||
89 | -- | ||
90 | 1.7.7.6 | ||
91 | |||