vppapigen: crcchecker: report deprecated messages
Report if the messages were marked as deprecated, but not yet deleted. Useful for building the release notes and comparing between the releases. Also, put the dict_compare() call into the report(), since latter always consumes the output of the former. Change-Id: Iceab3e94ff66da931a4669b612026bd162dd5d1a Type: improvement Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
This commit is contained in:

committed by
Ole Tr�an

parent
d1146f6dde
commit
62bd50de97
@@ -107,7 +107,8 @@ def is_in_progress(d, k):
|
|||||||
except:
|
except:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def report(old, new, added, removed, modified, same):
|
def report(new, old):
|
||||||
|
added, removed, modified, same = dict_compare(new, old)
|
||||||
backwards_incompatible = 0
|
backwards_incompatible = 0
|
||||||
for k in added:
|
for k in added:
|
||||||
print(f'added: {k}')
|
print(f'added: {k}')
|
||||||
@@ -126,6 +127,17 @@ def report(old, new, added, removed, modified, same):
|
|||||||
print(f'modified: ** {k}')
|
print(f'modified: ** {k}')
|
||||||
else:
|
else:
|
||||||
print(f'modified: {k}')
|
print(f'modified: {k}')
|
||||||
|
|
||||||
|
# check which messages are still there but were marked for deprecation
|
||||||
|
for k in new.keys():
|
||||||
|
newversion = int(new[k]['version'])
|
||||||
|
if newversion > 0 and is_deprecated(new, k):
|
||||||
|
if k in old:
|
||||||
|
if not is_deprecated(old, k):
|
||||||
|
print(f'deprecated: {k}')
|
||||||
|
else:
|
||||||
|
print(f'added+deprecated: {k}')
|
||||||
|
|
||||||
return backwards_incompatible
|
return backwards_incompatible
|
||||||
|
|
||||||
|
|
||||||
@@ -150,8 +162,7 @@ def main():
|
|||||||
if args.diff:
|
if args.diff:
|
||||||
oldcrcs = crc_from_apigen(None, args.diff[0])
|
oldcrcs = crc_from_apigen(None, args.diff[0])
|
||||||
newcrcs = crc_from_apigen(None, args.diff[1])
|
newcrcs = crc_from_apigen(None, args.diff[1])
|
||||||
added, removed, modified, same = dict_compare(newcrcs, oldcrcs)
|
backwards_incompatible = report(newcrcs, oldcrcs)
|
||||||
backwards_incompatible = report(oldcrcs, newcrcs, added, removed, modified, same)
|
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
# Dump CRC for messages in given files / revision
|
# Dump CRC for messages in given files / revision
|
||||||
@@ -186,8 +197,7 @@ def main():
|
|||||||
newcrcs.update(crc_from_apigen(None, f))
|
newcrcs.update(crc_from_apigen(None, f))
|
||||||
oldcrcs.update(crc_from_apigen(revision, f))
|
oldcrcs.update(crc_from_apigen(revision, f))
|
||||||
|
|
||||||
added, removed, modified, same = dict_compare(newcrcs, oldcrcs)
|
backwards_incompatible = report(newcrcs, oldcrcs)
|
||||||
backwards_incompatible = report(oldcrcs, newcrcs, added, removed, modified, same)
|
|
||||||
|
|
||||||
if args.check_patchset:
|
if args.check_patchset:
|
||||||
if backwards_incompatible:
|
if backwards_incompatible:
|
||||||
|
Reference in New Issue
Block a user