Updated some stuff trying to get package fetching working

This commit is contained in:
2026-05-18 15:11:29 +02:00
parent df42c118bf
commit 5cb41ac8b5
3 changed files with 19 additions and 1 deletions
+17
View File
@@ -1,5 +1,8 @@
#! /bin/env python
import sys
from pathlib import Path
import tarfile
from db import get_package_meta, ensure_db
from handoff import delegate_to_pacman
from fetch import fetch_package
@@ -34,5 +37,19 @@ def install(pkgname: str):
# Send to pacman with userman flags
if not _is_userman_pkg(pkg_path):
# Throw it to pacman
print(":: Not Implemeted")
sys.exit(1)
def _is_userman_pkg(pkg_dir: Path, pkg_name: str) -> bool:
with tarfile.open(pkg_dir, "r") as pkg:
for member in pkg.getmembers():
parts = member.name.split("/")
if len(parts) != 3 or parts[4] != (pkg_name + ".userman"):
continue
return True
return False
if __name__ == "__main__":
main()