diff options
author | 2011-02-19 14:47:57 -0800 | |
---|---|---|
committer | 2011-02-19 14:47:57 -0800 | |
commit | 263f261a0219c919747d5b735d318707546d6113 (patch) | |
tree | 1dbb974328ce150108960b03edb72577377a4c6a /examples | |
parent | fix script to work with recent domain changes (diff) | |
download | pkgcore-263f261a0219c919747d5b735d318707546d6113.tar.gz pkgcore-263f261a0219c919747d5b735d318707546d6113.tar.bz2 pkgcore-263f261a0219c919747d5b735d318707546d6113.zip |
identify pkgs that have ELF components, but aren't splitdebug
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/identify-installed-non-split-debug-pkgs.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/examples/identify-installed-non-split-debug-pkgs.py b/examples/identify-installed-non-split-debug-pkgs.py new file mode 100755 index 000000000..63a5ebf3e --- /dev/null +++ b/examples/identify-installed-non-split-debug-pkgs.py @@ -0,0 +1,34 @@ +#!/usr/bin/python +from pkgcore.config import load_config +from pkgcore.util.file_type import file_identifier +from snakeoil.compatibility import any + +import re +debug_paths = ["/usr/lib%s/debug" % (x,) for x in ("64", "32", "")] + +fi = file_identifier() +vdbs = load_config().get_default("domain").vdb +for repo in vdbs: + for pkg in repo: + contents = getattr(pkg, 'contents', ()) + if not contents: + continue + files = contents.iterfiles() + + for obj in files: + res = fi(obj.location) + if res is None: + # nonexistant file. + continue + if res.startswith("ELF "): + break + else: + # no elf objects + continue + + for path in debug_paths: + if path in contents: + break + else: + # no debug bits, but is elf. + print "%s:%s" % (pkg.key, pkg.slot) |