Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions contrib/pc-sanity/bin/screen-pkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,17 +412,22 @@ def check_component_scanning(

def pkg_is_public(pkg: Package) -> bool:
ver = pkg.installed
public_sites = [
"security.ubuntu.com",
"archive.ubuntu.com",
"ports.ubuntu.com",
]

if ver and ver.origins[0].component == "now" and pkg.is_upgradable:
# this package is upgradable to a package in the archive
ver = pkg.candidate
if ver is None:
raise Exception("package is not installed")

for origin in ver.origins:
if (
"security.ubuntu.com" in origin.site
or "archive.ubuntu.com" in origin.site # noqa: W503
) and origin.trusted:
if origin.trusted and origin.site in public_sites:
return True

return False


Expand Down