Skip to content

Commit 45d4bcf

Browse files
committed
Prefer system check which result in a new recipe should be treated as normal packages
In general when are remote store is provided, we disable system packages. However, this should not be the case if the system package results in a new recipe, because in that case we consider the result of that recipe to be the package.
1 parent 59749dc commit 45d4bcf

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

alibuild_helpers/utilities.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,8 @@ def getPackageList(packages, specs, configDir, preferSystem, noSystem,
504504
noSystemList = [spec["package"]]
505505
elif noSystem is not None:
506506
noSystemList = noSystem.split(",")
507-
508-
if (spec["package"] not in noSystemList) and (preferSystem or systemREMatches):
507+
systemExcluded = (spec["package"] in noSystemList)
508+
if (preferSystem or systemREMatches):
509509
requested_version = resolve_version(spec, defaults, "unavailable", "unavailable")
510510
cmd = "REQUESTED_VERSION={version}\n{check}".format(
511511
version=quote(requested_version),
@@ -520,12 +520,16 @@ def getPackageList(packages, specs, configDir, preferSystem, noSystem,
520520
else:
521521
# prefer_system_check succeeded; this means we should use the system package.
522522
match = re.search(r"^alibuild_system_replace:(?P<key>.*)$", output, re.MULTILINE)
523-
if not match:
523+
if not match and systemExcluded:
524+
# No replacement spec name given. Fall back to old system package
525+
# behaviour and just disable the package.
526+
ownPackages.add(spec["package"])
527+
elif not match and not systemExcluded:
524528
# No replacement spec name given. Fall back to old system package
525529
# behaviour and just disable the package.
526530
systemPackages.add(spec["package"])
527531
disable.append(spec["package"])
528-
else:
532+
elif match:
529533
# The check printed the name of a replacement; use it.
530534
key = match.group("key").strip()
531535
replacement = None

0 commit comments

Comments
 (0)