From 654f95c32918456f928f117871b15f09c0b6ae25 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 22 Mar 2010 04:21:17 +0100 Subject: oeaudit: Move the oeaudit into a new subdirectory and split it up * OE should contain OE related handling * FreeBSD should contain the handling of FreeBSD specific things like the auditfile format, mapping BSD names to OE.. --- contrib/oeaudit/oe.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 contrib/oeaudit/oe.py (limited to 'contrib/oeaudit/oe.py') diff --git a/contrib/oeaudit/oe.py b/contrib/oeaudit/oe.py new file mode 100644 index 0000000000..f3326a5338 --- /dev/null +++ b/contrib/oeaudit/oe.py @@ -0,0 +1,28 @@ +def read_available(filename): + """ + Parses the output of bitbake -s + minus the first few lines + """ + f = open(filename) + packages = {} + + for line in f: + if line.startswith("NOTE: ") or line.startswith("Parsing .bb") or line.startswith("done."): + continue + + # str.split can not be used as we have multiple whitespace + split = line.split(" ", 1) + package = split[0] + rest = split[1].strip() + + # we might have a latest package... + split = rest.split(" ", 1) + if len(split) == 2: + version = split[1].strip() + else: + version = split[0] + + packages[package] = version + return packages + + -- cgit v1.2.3