Skip to content

Instantly share code, notes, and snippets.

@ralphbean
Created September 18, 2018 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ralphbean/4a11056e648c925f322dece9f3d6b332 to your computer and use it in GitHub Desktop.
Save ralphbean/4a11056e648c925f322dece9f3d6b332 to your computer and use it in GitHub Desktop.
A patch to mbs
diff --git a/module_build_service/mmd_resolver.py b/module_build_service/mmd_resolver.py
index dfb88bb..81d92ed 100644
--- a/module_build_service/mmd_resolver.py
+++ b/module_build_service/mmd_resolver.py
@@ -173,6 +173,17 @@ class MMDResolver(object):
pool.Dep("module(%s:%s)" % (n, s)).Rel(
solv.REL_EQ, pool.Dep(str(v))))
+ # Add "Provides: stream(name) = stream" and "Conflicts: stream(name) != stream",
+ # so that we make every stream of the a module conflict with every other stream of that
+ # module. This disallows parallel installation of streams.
+ # solv.REL_LT | solv.REL_GT should be interpreted as "!="
+ solvable.add_deparray(solv.SOLVABLE_PROVIDES,
+ pool.Dep("stream(%s)" % n).Rel(
+ solv.REL_EQ, pool.Dep(s)))
+ solvable.add_deparray(solv.SOLVABLE_CONFLICTS,
+ pool.Dep("stream(%s)" % n).Rel(
+ solv.REL_LT | solv.REL_GT, pool.Dep(s)))
+
# Fill in the "Requires" of this module, so we can track its dependencies
# on other modules.
requires = self._deps2reqs(normdeps(mmd, "get_requires"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment