upgrades: dist-upgrade: Don't change apt security line

This change was only needed for upgrade to bullseye.

Closes: #2302.

Tests:

- Run a dist upgrade in a bullseye vagrant box. Apt sources has
  expected content and apt-get does not produce an error.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy 2022-12-17 20:32:01 -05:00 committed by Sunil Mohan Adapa
parent b056f5829c
commit 331e6f33d8
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -379,16 +379,12 @@ def _check_dist_upgrade(test_upgrade=False) -> Tuple[bool, str]:
with open(SOURCES_LIST, 'w', encoding='utf-8') as sources_list:
for line in lines:
# E.g. replace 'buster' with 'bullseye'.
# E.g. replace 'bullseye' with 'bookworm'.
new_line = line.replace(dist, codename)
if check_dist == 'testing':
# E.g. replace 'stable' with 'bullseye'.
# E.g. replace 'stable' with 'bookworm'.
new_line = new_line.replace('stable', codename)
# Security suite name renamed starting with bullseye
if 'security' in new_line:
new_line = new_line.replace('/updates', '-security')
sources_list.write(new_line)
logging.info('Dist upgrade in progress. Setting flag.')