forked from Mirror/pmbootstrap
repo_missing: if abuild is forked, add it as dep (MR 2410)
In the systemd repository, we currently have a forked version of abuild, which needs to be used to build all other packages. Check if we have a forked abuild, and if it is the case, add it to the dependencies of all other packages. Closes: issue 2401
This commit is contained in:
parent
8d446c2aeb
commit
02591cfda2
1 changed files with 22 additions and 0 deletions
|
@ -2,6 +2,8 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
from pmb.core.arch import Arch
|
||||
from pmb.core.context import get_context
|
||||
from pmb.meta import Cache
|
||||
from pmb.types import WithExtraRepos
|
||||
from pathlib import Path
|
||||
|
||||
import pmb.build
|
||||
|
@ -11,6 +13,23 @@ import glob
|
|||
import os
|
||||
|
||||
|
||||
@Cache("repo")
|
||||
def is_abuild_forked(repo: str | None) -> bool:
|
||||
"""Check if abuild is forked to make sure we build it first (pmb#2401)"""
|
||||
with_extra_repos: WithExtraRepos
|
||||
|
||||
if repo == "systemd":
|
||||
with_extra_repos = "enabled"
|
||||
elif repo is None:
|
||||
with_extra_repos = "disabled"
|
||||
else:
|
||||
raise RuntimeError(f"Unexpected repo value: {repo}")
|
||||
|
||||
if pmb.helpers.pmaports.find("abuild", False, False, with_extra_repos):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def generate(arch: Arch) -> list[dict[str, list[str] | str | None]]:
|
||||
"""Get packages that need to be built, with all their dependencies. Include
|
||||
packages from extra-repos, no matter if systemd is enabled or not. This
|
||||
|
@ -42,6 +61,9 @@ def generate(arch: Arch) -> list[dict[str, list[str] | str | None]]:
|
|||
if entry is None:
|
||||
raise RuntimeError(f"Couldn't get package {pkgname} for arch {arch}")
|
||||
|
||||
if pkgname != "abuild" and is_abuild_forked(repo):
|
||||
entry.depends.insert(0, "abuild")
|
||||
|
||||
ret += [
|
||||
{
|
||||
"pkgname": entry.pkgname,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue