Skip to content
Snippets Groups Projects
Commit 31e8ced0 authored by Dylan Aïssi's avatar Dylan Aïssi
Browse files

apertis-abi-compare: don't fail in case of soname change


When the soname changes, the name of the binary package changes
accordingly. In this case, ABI breakage is expected thus there is
no need to run abi-compliance-checker. apertis-abi-compare detects
this case and report the soname change without failing.

Signed-off-by: default avatarDylan Aïssi <dylan.aissi@collabora.com>
parent a8d595e0
No related branches found
No related tags found
4 merge requests!66Merge changes from apertis/v2023-updates into apertis/v2023,!65Merge changes from apertis/v2022-updates into apertis/v2022,!60Backport v2022 <- v2024: apertis-abi-compare: don't fail in case of soname change,!59Backport v2023 <- v2024: apertis-abi-compare: don't fail in case of soname change
......@@ -273,7 +273,27 @@ def main():
subprocess.run(['/usr/bin/apt', 'download', bin_deb],
cwd=folder_old_bin)
my_old_deb = list(pathlib.Path(folder_old_bin).glob('*.deb'))[0]
list_old_debs = list(pathlib.Path(folder_old_bin).glob('*.deb'))
print(f'INFO: {len(list_old_debs)} old packages have been downloaded!')
if len(list_old_debs) == 0:
print('INFO: Checking if similar packages are available in apt repositories')
for bin_deb in list_bin_deb:
if re.search('\d$', bin_deb):
libbin_deb = re.sub('(\d*[\.]*)*\d$', '', bin_deb)
my_libbin_deb = libbin_deb + '[0-9]$'
print(f'INFO: ...searching for {libbin_deb} in apt')
apt_search = subprocess.run(['/usr/bin/apt-cache', 'search', '--names-only', my_libbin_deb], capture_output=True)
my_oldlibbin_deb = apt_search.stdout.decode('utf-8').split(' - ')[0]
if len(my_oldlibbin_deb) < 1:
print('INFO: No previous packages available in apt repositories for comparison\n'
f'INFO: Could this be the first release of {libbin_deb}?')
else:
print(f'INFO: soname change detected for {bin_deb}')
print(f'INFO: {my_oldlibbin_deb} is available in apt repositories')
print('INFO: ABI breakage expected, no need to run abi-compliance-checker')
sys.exit(0)
my_old_deb = list_old_debs[0]
my_old_deb = debfile.DebFile(my_old_deb)
my_old_debcontrol = my_old_deb.debcontrol()
my_old_ver = my_old_debcontrol['Version']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment