diff options
author | Sergey Lapin <slapin@ossfans.org> | 2010-03-22 18:13:56 +0300 |
---|---|---|
committer | Sergey Lapin <slapin@ossfans.org> | 2010-03-22 18:13:56 +0300 |
commit | 3937c88166a493900a694ea8fe53b860f4099d83 (patch) | |
tree | 57597245b6efd4cf27c1f4c9ff21c0515e530c15 /contrib/oeaudit/oe.py | |
parent | df2ace6d59e22b42e50bcf4e8a9c92b580602c2e (diff) | |
parent | 3510d2ed15a4b477aa7af802a839e11a87b981ed (diff) |
Merge branch 'org.openembedded.dev' of git@git.openembedded.net:openembedded into org.openembedded.dev
Diffstat (limited to 'contrib/oeaudit/oe.py')
-rw-r--r-- | contrib/oeaudit/oe.py | 28 |
1 files changed, 28 insertions, 0 deletions
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 + + |