diff options
author | Bastian Blank <waldi@debian.org> | 2006-12-08 17:32:21 +0000 |
---|---|---|
committer | Bastian Blank <waldi@debian.org> | 2006-12-08 17:32:21 +0000 |
commit | c2727146596acd76f55e56254d6df52b947609e2 (patch) | |
tree | ecabcc2db94d0bb4a063e2ac850b8571c3b81fd3 /debian/lib/python/debian_linux/abi.py | |
parent | 641195b4ffe5c8ec51ed3b6ea2219b336d4ecbd6 (diff) | |
download | kernel_replicant_linux-c2727146596acd76f55e56254d6df52b947609e2.tar.gz kernel_replicant_linux-c2727146596acd76f55e56254d6df52b947609e2.tar.bz2 kernel_replicant_linux-c2727146596acd76f55e56254d6df52b947609e2.zip |
* debian/bin/abicheck.py: Always report all informations from a symbol.
* debian/lib/python/debian_linux/abi.py: Update.
svn path=/dists/trunk/linux-2.6/; revision=7952
Diffstat (limited to 'debian/lib/python/debian_linux/abi.py')
-rw-r--r-- | debian/lib/python/debian_linux/abi.py | 68 |
1 files changed, 22 insertions, 46 deletions
diff --git a/debian/lib/python/debian_linux/abi.py b/debian/lib/python/debian_linux/abi.py index 930e5d1432ff..d04ad450d4d5 100644 --- a/debian/lib/python/debian_linux/abi.py +++ b/debian/lib/python/debian_linux/abi.py @@ -1,11 +1,12 @@ -class symbols(object): +class symbols(dict): def __init__(self, filename = None): + self.modules = {} if filename is not None: self.read(file(filename)) def cmp(self, new): - symbols_ref = set(self.symbols.keys()) - symbols_new = set(new.symbols.keys()) + symbols_ref = set(self.keys()) + symbols_new = set(new.keys()) symbols_add = {} symbols_remove = {} @@ -13,63 +14,38 @@ class symbols(object): symbols_change = {} for symbol in symbols_new - symbols_ref: - symbols_add[symbol] = {'module': new.symbols[symbol][0]} + symbols_add[symbol] = new[symbol] for symbol in symbols_ref.intersection(symbols_new): - module_ref, version_ref, export_ref = self.symbols[symbol] - module_new, version_new, export_new = new.symbols[symbol] - - ent = {} - if module_ref != module_new: - ent['module'] = module_ref, module_new - if version_ref != version_new: - ent['version'] = version_ref, version_new - if export_ref != export_new: - ent['export'] = export_ref, export_new - if ent: + symbol_ref = self[symbol] + symbol_new = new[symbol] + + ent = {'ref': symbol_ref, 'new': symbol_new, 'changes': {}} + for i in ('module', 'version', 'export'): + if symbol_ref[i] != symbol_new[i]: + ent['changes'][i] = {'ref': symbol_ref, 'new': symbol_new} + if ent['changes']: symbols_change[symbol] = ent for symbol in symbols_ref - symbols_new: - symbols_remove[symbol] = {'module': self.symbols[symbol][0]} + symbols_remove[symbol] = self[symbol] return symbols_add, symbols_change, symbols_remove def read(self, file): - self.modules = {} - self.symbols = {} - for line in file.readlines(): version, symbol, module, export = line.strip().split() - symbols = self.modules.get(module, {}) - symbols[symbol] = version - self.modules[module] = symbols - if self.symbols.has_key(symbol): + if self.has_key(symbol): pass - self.symbols[symbol] = module, version, export + symbols = self.modules.get(module, set()) + symbols.add(symbol) + self.modules[module] = symbols + self[symbol] = {'symbol': symbol, 'module': module, 'version': version, 'export': export} def write(self, file): - symbols = self.symbols.items() + symbols = self.items() symbols.sort() - for symbol, i in symbols: - module, version, export = i - file.write("%s %s %s %s\n" % (version, symbol, module, export)) - - def write_human(self, file): - modules = self.modules.keys() - modules.sort() - modules.remove('vmlinux') - - file.write("Symbols in vmlinux\n\n") - symbols = self.modules['vmlinux'].items() - symbols.sort() - for symbol, version, export in symbols: - file.write("%-48s %s %s\n" % (symbol, version, export)) - - for module in modules: - file.write("\n\nSymbols in module %s\n\n" % module) - symbols = self.modules[module].items() - symbols.sort() - for symbol, version, export in symbols: - file.write("%-48s %s %s\n" % (symbol, version, export)) + for symbol, info in symbols: + file.write("%(version)s %(symbol)s %(module)s %(export)s\n" % info) |