Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve disable by architecture #760

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions alibuild_helpers/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,18 @@ def getPackageList(packages, specs, configDir, preferSystem, noSystem,
log("Overrides for package %s: %s", spec["package"], overrides[override])
spec.update(overrides.get(override, {}) or {})

# Architecture is used to determine for which architecture we
# should build a given package. By default everything matches
# The architecture string should NOT go in the has, because in
# any case wether or not a package is build the hash will be different.
architectureRE = spec.get("architecture", ".*")
try:
architectureREMatches = re.match(architectureRE, architecture)
except:
dieOnError(True, "Malformed entry architecture: %s in %s" % (architecture, spec["package"]))
if not architectureREMatches:
disable.append(spec["package"])

# If --always-prefer-system is passed or if prefer_system is set to true
# inside the recipe, use the script specified in the prefer_system_check
# stanza to see if we can use the system version of the package.
Expand Down Expand Up @@ -513,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"))
TimoWilken marked this conversation as resolved.
Show resolved Hide resolved
if not spec["package"] in requirementsCache:
requirementsCache[spec["package"]] = performRequirementCheck(spec, cmd.strip())

Expand Down
Loading