Skip to content

Commit

Permalink
Make system_requirement more useful
Browse files Browse the repository at this point in the history
This allows people to define system requirements also for
packages which have a recipe. It also falls back to prefer_system_check
when system_requirement_check is missing. This will allow us,
for example to say:

system_requirement: (ubuntu|osx)

for packages which want to pick up from the system on those two
architectures, e.g. openssl.
  • Loading branch information
ktf authored and singiamtel committed Aug 29, 2024
1 parent d3d9aed commit c362489
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions alibuild_helpers/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,10 +525,10 @@ def getPackageList(packages, specs, configDir, preferSystem, noSystem,
else:
systemPackages.add(spec["package"])

dieOnError(("system_requirement" in spec) and recipe.strip("\n\t "),
"System requirements %s cannot have a recipe" % spec["package"])
if re.match(spec.get("system_requirement", "(?!.*)"), architecture):
cmd = spec.get("system_requirement_check", "false")
# system_requirement fallsback to the prefer_system_check rule
# if the system_requirement_check does not exist.
cmd = spec.get("system_requirement_check", spec.get("prefer_system_check", "false"))
if not spec["package"] in requirementsCache:
requirementsCache[spec["package"]] = performRequirementCheck(spec, cmd.strip())

Expand Down

0 comments on commit c362489

Please sign in to comment.