dev/chain_build.py: fix skipping non-versioned crate present in apt cache when finding existing debs

This commit is contained in:
Blair Noctis 2023-03-04 15:46:23 +08:00
parent e024e67f57
commit 7ad8def344
No known key found for this signature in database
GPG Key ID: 2C89AF5FFD1C767C

View File

@ -73,7 +73,6 @@ def find_built(specs: list[tuple[str, str]]) -> list[tuple[str, str, str]]:
chdir('build')
debs = _find('*.deb')
chdir('..')
now = now_ts()
built = []
_print('Conducting search in apt cache and build/ directory for existing debs')
for crate, ver in specs:
@ -82,13 +81,15 @@ def find_built(specs: list[tuple[str, str]]) -> list[tuple[str, str, str]]:
try:
ver = _get_dch_version(crate)
except:
pass
pkg = aptc.get(f'librust-{_crate}-dev')
if pkg is not None and (ver == '*' or pkg.candidate.version.startswith(ver)):
built.append((crate, pkg.candidate.version, 'apt'))
continue
if ver == '*':
# version isn't specified, and d/changelog doesn't exist,
# means it's yet to be `./update.sh`d, move on
continue
pkg = aptc.get(f'librust-{_crate}-dev')
if pkg is not None and pkg.candidate.version.startswith(ver):
built.append((crate, pkg.candidate.version, 'apt'))
continue
for deb in debs:
if f'{_crate}-dev_{ver}' in deb:
built.append((crate, deb, 'build'))