feat: add managed sources

Signed-off-by: sisungo <[email protected]>
This commit is contained in:
2026-09-30 06:32:54 +00:00
parent c62b2fc8f6
commit 67a7ccf9ab
59 changed files with 215 additions and 114 deletions
+15 -4
View File
@@ -4,7 +4,7 @@ import os
from lib import arch
from . import pkgcomposer, sources
from . import pkgcomposer, sources, managed_source
_key_global = "@global"
_key_version = "version"
@@ -18,6 +18,9 @@ _key_recommendations = "recommendations"
_key_provides = "provides"
_key_configure = "configure"
_managed_source_url = None
_managed_source_postprocess = ""
_current_pkgname: str = _key_global
_pkginfo: dict[str, dict[str, typing.Any]] = {
_key_global: {
@@ -32,7 +35,7 @@ _pkginfo: dict[str, dict[str, typing.Any]] = {
_supported_arch: typing.Callable[[str], bool] = lambda x: True
_on_build: typing.Callable[[], None] | None = None
_in_atombuild = False
_dry_run = False
_builddep: list[str] = []
_blocked_hooks: list[str] = []
@@ -155,14 +158,22 @@ def block_hook(hook: str):
def source_url(url: str):
if not _in_atombuild:
if not _dry_run:
sources.source_url(url)
def source_git(url: str, branch: str | None = None):
if not _in_atombuild:
if not _dry_run:
sources.source_git(url, branch)
def source_managed(s: str, postprocess: str = ""):
global _managed_source_url, _managed_source_postprocess
_managed_source_url = s
_managed_source_postprocess = postprocess
if not _dry_run:
sources.source_url(managed_source.get_repo_url(s))
def in_atomic():
return os.environ.get("SEMIOS_PKGBUILD_IN_ATOMIC", "0") == "1"