Skip to content

Commit 9666ce0

Browse files
authored
Add ports.ubuntu.archive to public site (bugfix) (#2048)
Signed-off-by: ChunAn Wu <[email protected]>
1 parent fec2b5c commit 9666ce0

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

contrib/pc-sanity/bin/screen-pkg.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,17 +412,22 @@ def check_component_scanning(
412412

413413
def pkg_is_public(pkg: Package) -> bool:
414414
ver = pkg.installed
415+
public_sites = [
416+
"security.ubuntu.com",
417+
"archive.ubuntu.com",
418+
"ports.ubuntu.com",
419+
]
420+
415421
if ver and ver.origins[0].component == "now" and pkg.is_upgradable:
416422
# this package is upgradable to a package in the archive
417423
ver = pkg.candidate
418424
if ver is None:
419425
raise Exception("package is not installed")
426+
420427
for origin in ver.origins:
421-
if (
422-
"security.ubuntu.com" in origin.site
423-
or "archive.ubuntu.com" in origin.site # noqa: W503
424-
) and origin.trusted:
428+
if origin.trusted and origin.site in public_sites:
425429
return True
430+
426431
return False
427432

428433

0 commit comments

Comments
 (0)