From: Holger Hans Peter Freyther Date: Thu, 18 Mar 2010 13:18:07 +0000 (+0100) Subject: oe_audit.py: Properly handle used version.. X-Git-Tag: Release-2010-05/1~339^2~20^2~17 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=888edecd1b34a4f23e000e08f88a81e43f95732e;p=openembedded.git oe_audit.py: Properly handle used version.. There might be a third column for -s and we want to use that one. It seems bitbake is a bit confused about latest vs. current... and it is helping. --- diff --git a/contrib/qa/oe_audit.py b/contrib/qa/oe_audit.py index 905f1108d3..bb7915b5f2 100755 --- a/contrib/qa/oe_audit.py +++ b/contrib/qa/oe_audit.py @@ -11,16 +11,22 @@ def read_available(filename): packages = {} for line in f: - if line.startswith("NOTE: ") or line.startswith("Parsing .bb"): + 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 - first_space = line.find(" ") - package = line[0:first_space] - rest = line[first_space+1:] - pv = rest.strip().split(" ")[0] - - packages[package] = pv + 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