mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
distupgrade: Handle comments in sources.list file
Tests: - Add a comment and /etc/apt/sources.list file. Distribution upgrade page does not load and fails with an error. - With the patch, page loads properly. Distribution upgrade can be triggered. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> [jvalleroy: Fix test for release date] Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
c639bb0d14
commit
1ae55377ea
@ -116,6 +116,9 @@ def _get_sources_list_codename() -> str | None:
|
||||
dists = set()
|
||||
for match_ in aug.match('*'):
|
||||
dist = aug.get(match_ + '/distribution')
|
||||
if not dist:
|
||||
continue
|
||||
|
||||
dist = dist.removesuffix('-updates')
|
||||
dist = dist.removesuffix('-security')
|
||||
dists.add(dist)
|
||||
|
||||
@ -190,7 +190,7 @@ def test_get_status(check_auto, is_dist_upgrade_enabled,
|
||||
assert status['current_release_date'] == current_date
|
||||
assert status['next_codename'] == 'trixie'
|
||||
assert status['next_version'] == 13
|
||||
next_date = datetime_original(2025, 8, 20, tzinfo=timezone.utc)
|
||||
next_date = datetime_original(2025, 8, 9, tzinfo=timezone.utc)
|
||||
assert status['next_release_date'] == next_date
|
||||
assert status['next_action'] == 'manual'
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user