mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
upgrades: Fix sources list for dist upgrade from buster
- Check apt sources list regardless of whether we are upgrading to stable or testing. - Replace stable code name with new stable code name. - When testing, also replace "stable" with code name to be tested. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
4f92e985d3
commit
d794b575e1
@ -358,17 +358,22 @@ def _check_and_dist_upgrade(develop=False, test_upgrade=False):
|
|||||||
return
|
return
|
||||||
|
|
||||||
print(f'Upgrading from {dist} to {codename}...')
|
print(f'Upgrading from {dist} to {codename}...')
|
||||||
if check_dist == 'testing':
|
with open(SOURCES_LIST, 'r') as sources_list:
|
||||||
with open(SOURCES_LIST, 'r') as sources_list:
|
lines = sources_list.readlines()
|
||||||
lines = sources_list.readlines()
|
|
||||||
|
|
||||||
with open(SOURCES_LIST, 'w') as sources_list:
|
with open(SOURCES_LIST, 'w') as sources_list:
|
||||||
for line in lines:
|
for line in lines:
|
||||||
new_line = line.replace('stable', codename)
|
# E.g. replace 'buster' with 'bullseye'.
|
||||||
if 'security' in new_line:
|
new_line = line.replace(dist, codename)
|
||||||
new_line = new_line.replace('/updates', '-security')
|
if check_dist == 'testing':
|
||||||
|
# E.g. replace 'stable' with 'bullseye'.
|
||||||
|
new_line = new_line.replace('stable', codename)
|
||||||
|
|
||||||
sources_list.write(new_line)
|
# Security suite name renamed starting with bullseye
|
||||||
|
if 'security' in new_line:
|
||||||
|
new_line = new_line.replace('/updates', '-security')
|
||||||
|
|
||||||
|
sources_list.write(new_line)
|
||||||
|
|
||||||
print('Dist upgrade in progress. Setting flag.')
|
print('Dist upgrade in progress. Setting flag.')
|
||||||
dist_upgrade_flag.touch(mode=0o660)
|
dist_upgrade_flag.touch(mode=0o660)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user