Cope with change to Module.symvers file structure

With commit 7b727f1c5394 ("modpost: move the namespace field in
Module.symvers last"), upstream has re-ordered the content of
Module.symvers.  Update our tooling to cope with the new input format, and
to preserve the new format in output.
This commit is contained in:
Noah Meyerhans 2020-03-27 10:08:13 -07:00 committed by Ben Hutchings
parent ac64a094a9
commit 7a54cc60ba

View file

@ -35,10 +35,10 @@ class Symbols(dict):
def read(self, file):
for line in file:
version, name, namespace, module, export = line.strip().split('\t')
version, name, module, export, namespace = line.strip('\r\n').split('\t')
self[name] = Symbol(name, namespace, module, version, export)
def write(self, file):
for s in sorted(self.values(), key=lambda i: i.name):
file.write("%s\t%s\t%s\t%s\t%s\n" %
(s.version, s.name, s.namespace, s.module, s.export))
(s.version, s.name, s.module, s.export, s.namespace))