!284 check-kabi支持python3

From: @love_hangzhou
Reviewed-by: @xiexiuqi
Signed-off-by: @xiexiuqi,@xiexiuqi
This commit is contained in:
openeuler-ci-bot 2021-08-24 06:13:04 +00:00 committed by Gitee
commit 5572746644
2 changed files with 34 additions and 31 deletions

View File

@ -41,7 +41,7 @@ def load_symvers(symvers,filename):
break break
if in_line == "\n": if in_line == "\n":
continue continue
checksum,symbol,directory,type = string.split(in_line) checksum,symbol,directory,type = in_line.split()
symvers[symbol] = in_line[0:-1] symvers[symbol] = in_line[0:-1]
@ -56,7 +56,7 @@ def load_kabi(kabi,filename):
break break
if in_line == "\n": if in_line == "\n":
continue continue
checksum,symbol,directory,type = string.split(in_line) checksum,symbol,directory,type = in_line.split()
kabi[symbol] = in_line[0:-1] kabi[symbol] = in_line[0:-1]
@ -71,9 +71,9 @@ def check_kabi(symvers,kabi):
losted_symbols=[] losted_symbols=[]
for symbol in kabi: for symbol in kabi:
abi_hash,abi_sym,abi_dir,abi_type = string.split(kabi[symbol]) abi_hash,abi_sym,abi_dir,abi_type = kabi[symbol].split()
if symvers.has_key(symbol): if symbol in symvers:
sym_hash,sym_sym,sym_dir,sym_type = string.split(symvers[symbol]) sym_hash,sym_sym,sym_dir,sym_type = symvers[symbole].split()
if abi_hash != sym_hash: if abi_hash != sym_hash:
fail=1 fail=1
changed_symbols.append(symbol) changed_symbols.append(symbol)
@ -86,39 +86,39 @@ def check_kabi(symvers,kabi):
losted_symbols.append(symbol) losted_symbols.append(symbol)
if fail: if fail:
print "*** ERROR - ABI BREAKAGE WAS DETECTED ***" print ("*** ERROR - ABI BREAKAGE WAS DETECTED ***")
print "" print ("")
print "The following symbols have been changed (this will cause an ABI breakage):" print ("The following symbols have been changed (this will cause an ABI breakage):")
print "new kabi:" print ("new kabi:")
for symbol in changed_symbols: for symbol in changed_symbols:
print symvers[symbol] print (symvers[symbol])
print "old kabi:" print ("old kabi:")
for symbol in changed_symbols: for symbol in changed_symbols:
print kabi[symbol] print (kabi[symbol])
print "" print ("")
if lost: if lost:
print "*** ERROR - ABI BREAKAGE WAS DETECTED ***" print ("*** ERROR - ABI BREAKAGE WAS DETECTED ***")
print "" print ("")
print "The following symbols have been losted (this will cause an ABI breakage):" print ("The following symbols have been losted (this will cause an ABI breakage):")
print "old kabi:" print ("old kabi:")
for symbol in losted_symbols: for symbol in losted_symbols:
print kabi[symbol] print (kabi[symbol])
print "" print ("")
if warn: if warn:
print "*** WARNING - ABI SYMBOLS MOVED ***" print ("*** WARNING - ABI SYMBOLS MOVED ***")
print "" print ("")
print "The following symbols moved (typically caused by moving a symbol from being" print ("The following symbols moved (typically caused by moving a symbol from being")
print "provided by the kernel vmlinux out to a loadable module):" print ("provided by the kernel vmlinux out to a loadable module):")
print "new kabi:" print ("new kabi:")
for symbol in moved_symbols: for symbol in moved_symbols:
print symvers[symbol] print (symvers[symbol])
print "old kabi" print ("old kabi")
for symbol in moved_symbols: for symbol in moved_symbols:
print kabi[symbol] print (kabi[symbol])
print "" print ("")
"""Halt the build, if we got errors and/or warnings. In either case, """Halt the build, if we got errors and/or warnings. In either case,
double-checkig is required to avoid introducing / concealing double-checkig is required to avoid introducing / concealing
@ -128,12 +128,12 @@ def check_kabi(symvers,kabi):
sys.exit(0) sys.exit(0)
def usage(): def usage():
print """ print ("""
check-kabi: check Module.kabi and Module.symvers files. check-kabi: check Module.kabi and Module.symvers files.
check-kabi [ -k Module.kabi ] [ -s Module.symvers ] check-kabi [ -k Module.kabi ] [ -s Module.symvers ]
""" """)
if __name__ == "__main__": if __name__ == "__main__":

View File

@ -12,7 +12,7 @@
%global upstream_sublevel 0 %global upstream_sublevel 0
%global devel_release 5 %global devel_release 5
%global maintenance_release .3.0 %global maintenance_release .3.0
%global pkg_release .18 %global pkg_release .19
%define with_debuginfo 1 %define with_debuginfo 1
# Do not recompute the build-id of vmlinux in find-debuginfo.sh # Do not recompute the build-id of vmlinux in find-debuginfo.sh
@ -858,6 +858,9 @@ fi
%endif %endif
%changelog %changelog
* Mon Aug 23 2021 ShiYuan HU <hushiyuan@huwei.com> - 5.10.0-5.3.0.19
- check-kabi: check-kabi support python3 and python2
* Fri Aug 13 2021 Zheng Zengkai <zhengzengkai@huawei.com> - 5.10.0-5.3.0.18 * Fri Aug 13 2021 Zheng Zengkai <zhengzengkai@huawei.com> - 5.10.0-5.3.0.18
- srcu: Take early exit on memory-allocation failure - srcu: Take early exit on memory-allocation failure
- iommu: fix build error when CONFIG_IOMMU_API is off - iommu: fix build error when CONFIG_IOMMU_API is off