diff options
author | Koen Kooi <koen@dominion.thruhere.net> | 2012-11-22 20:20:25 +0100 |
---|---|---|
committer | Koen Kooi <koen@dominion.thruhere.net> | 2012-12-14 13:09:34 +0100 |
commit | da9e2d4a115cc94efba7f0b833ca782d7ed8e89c (patch) | |
tree | 0438e3a7ba3b8ed8663197549939f70671223e62 /meta-systemd/recipes-core/systemd/systemd/0001-Revert-systemd-analyze-use-argparse-instead-of-getop.patch | |
parent | 03d3a7f75d79755d426a8197779c462c021b9329 (diff) | |
download | meta-openembedded-contrib-da9e2d4a115cc94efba7f0b833ca782d7ed8e89c.tar.gz |
systemd: update to v196
Systemd-analyze has 2 reverts to keep it working with the python currently present in OE-core
The LGPLv2.1 was update to the latest text from gnu.org, so match checksum to that.
Runtime tested on beaglebone/angstrom and soekris-net6501/angstrom
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-systemd/recipes-core/systemd/systemd/0001-Revert-systemd-analyze-use-argparse-instead-of-getop.patch')
-rw-r--r-- | meta-systemd/recipes-core/systemd/systemd/0001-Revert-systemd-analyze-use-argparse-instead-of-getop.patch | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/meta-systemd/recipes-core/systemd/systemd/0001-Revert-systemd-analyze-use-argparse-instead-of-getop.patch b/meta-systemd/recipes-core/systemd/systemd/0001-Revert-systemd-analyze-use-argparse-instead-of-getop.patch new file mode 100644 index 0000000000..7de2705ace --- /dev/null +++ b/meta-systemd/recipes-core/systemd/systemd/0001-Revert-systemd-analyze-use-argparse-instead-of-getop.patch @@ -0,0 +1,103 @@ +From 2003e63f48cee2f497de7b90b66284f98c1c9919 Mon Sep 17 00:00:00 2001 +From: Koen Kooi <koen@dominion.thruhere.net> +Date: Mon, 10 Dec 2012 12:24:32 +0100 +Subject: [PATCH 1/2] Revert "systemd-analyze: use argparse instead of getopt" + +This reverts commit 0c0271841ab45595f71528c50bcf1904d4b841d5. + +Argparse is broken in current OE python +--- + src/analyze/systemd-analyze | 60 ++++++++++++++++++++++++++++--------------- + 1 files changed, 39 insertions(+), 21 deletions(-) + +diff --git a/src/analyze/systemd-analyze b/src/analyze/systemd-analyze +index 88699d6..87a83dd 100755 +--- a/src/analyze/systemd-analyze ++++ b/src/analyze/systemd-analyze +@@ -1,7 +1,6 @@ + #!/usr/bin/python + +-import sys, os +-import argparse ++import getopt, sys, os + from gi.repository import Gio + try: + import cairo +@@ -76,6 +75,20 @@ def draw_text(context, x, y, text, size = 12, r = 0, g = 0, b = 0, vcenter = 0.5 + + context.restore() + ++def usage(): ++ sys.stdout.write("""systemd-analyze [--user] time ++systemd-analyze [--user] blame ++systemd-analyze [--user] plot ++ ++Process systemd profiling information ++ ++ -h --help Show this help ++""") ++ ++def help(): ++ usage() ++ sys.exit() ++ + def time(): + + initrd_time, start_time, finish_time = acquire_start_time() +@@ -266,29 +279,34 @@ def plot(): + + surface.finish() + +-parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter, +- description='Process systemd profiling information', +- epilog='''\ +-time - print time spent in the kernel before reaching userspace +-blame - print list of running units ordered by time to init +-plot - output SVG graphic showing service initialization +-''') +- +-parser.add_argument('action', choices=('time', 'blame', 'plot'), +- default='time', nargs='?', +- help='action to perform (default: time)') +-parser.add_argument('--user', action='store_true', +- help='use the session bus') ++def unknown_verb(): ++ sys.stderr.write("Unknown verb '%s'.\n" % args[0]) ++ usage() ++ sys.exit(1) + +-args = parser.parse_args() ++bus = Gio.BusType.SYSTEM + +-if args.user: +- bus = Gio.BusType.SESSION +-else: +- bus = Gio.BusType.SYSTEM ++try: ++ opts, args = getopt.gnu_getopt(sys.argv[1:], "h", ["help", "user"]) ++except getopt.GetoptError as err: ++ sys.stdout.write(str(err) + "\n") ++ usage() ++ sys.exit(2) ++for o, a in opts: ++ if o in ("-h", "--help"): ++ help() ++ elif o == '--user': ++ bus = Gio.BusType.SESSION ++ else: ++ assert False, "unhandled option" + + verb = {'time' : time, + 'blame': blame, + 'plot' : plot, ++ 'help' : help, + } +-verb.get(args.action)() ++ ++if len(args) == 0: ++ time() ++else: ++ verb.get(args[0], unknown_verb)() +-- +1.7.7.6 + |