Sanity check paste checker
Some checks failed
Wiki Resources Sanity Checks / ruff-checks (push) Failing after 1s

This commit is contained in:
2026-06-16 22:09:12 -07:00
parent 06f0853f44
commit 292b9a8004
2 changed files with 54 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
from sys import argv
from requests import get
from subprocess import check_output
def local_package_list():
pkgs = check_output('pacman -Qqm'.split())
return [ pkg.decode() for pkg in pkgs.splitlines()]
def get_remote(url):
pkgs = get(url)
pkgs = [pkg.decode() for pkg in pkgs.content.splitlines()]
return set(pkgs)
def pkg_in_remote(pkg_name, remote_set):
return pkg_name in remote_set
if __name__ == '__main__':
if len(argv) == 2:
paste_url = argv[1]
else:
paste_url = 'https://paste.cachyos.org/73a714d'
remote_package_list = get_remote(paste_url)
for pkg in local_package_list():
if pkg_in_remote(pkg, remote_package_list):
print(f'COMPROMISED - {pkg}')
else:
print(f'CLEAN - {pkg}')