File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -412,17 +412,25 @@ def check_component_scanning(
412412
413413def 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 not origin . trusted :
429+ continue
430+
431+ if origin .site in public_sites :
425432 return True
433+
426434 return False
427435
428436
You can’t perform that action at this time.
0 commit comments