Skip to content
Snippets Groups Projects
Unverified Commit 02591cfd authored by Oliver Smith's avatar Oliver Smith
Browse files

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
parent 8d446c2a
Branches
Tags
1 merge request!2410Rewrite repo_missing for bpo + systemd split repo
Pipeline #213381 failed
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment