Skip to content

Commit

Permalink
chore(core: check_runtime_deps): fakeroot is now part of base-devel - 2
Browse files Browse the repository at this point in the history
  • Loading branch information
actionless committed Jun 7, 2024
1 parent 6225030 commit 0b94fd0
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions pikaur/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,17 @@ def dirname(path: str | Path) -> Path:
return Path(path).parent if path else Path()


def get_local_pkg(pkg_name: str) -> pyalpm.Package | None:
# pylint: disable=import-outside-toplevel
from .pacman import PackageDB # noqa: PLC0415
return PackageDB.get_local_pkg_uncached(pkg_name)


def check_systemd_dynamic_users_version() -> bool: # pragma: no cover
# @TODO: remove this check later as systemd v 235 is quite OLD already
# pylint: disable=import-outside-toplevel
from .pacman import PackageDB # noqa: PLC0415
from .version import split_version # noqa: PLC0415
pkg = PackageDB.get_local_pkg_uncached("systemd")
pkg = get_local_pkg("systemd")
if not pkg:
return False
version = int(split_version(pkg.version)[0])
Expand All @@ -364,9 +369,16 @@ def check_runtime_deps(dep_names: list[str] | None = None) -> None:
sys.exit(65)
if not dep_names:
privilege_escalation_tool = PikaurConfig().misc.PrivilegeEscalationTool.get_str()
dep_names = ["fakeroot"] + (
dep_names = (
[privilege_escalation_tool] if not RunningAsRoot()() else []
)
if not get_local_pkg("base-devel"):
print_error(
translate(
"Read damn arch-wiki before borking your computer",
),
)
sys.exit(65)

for dep_bin in dep_names:
if not shutil.which(dep_bin):
Expand Down

0 comments on commit 0b94fd0

Please sign in to comment.