Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

yum-multiverse first-code

  • Loading branch information...
commit d6da3b35ddea4009abf176a270702ed1f887ae94 0 parents
@t3rmin4t0r authored
Showing with 24 additions and 0 deletions.
  1. +2 −0  multiverse.conf
  2. +22 −0 multiverse.py
2  multiverse.conf
@@ -0,0 +1,2 @@
+[main]
+enabled = 1
22 multiverse.py
@@ -0,0 +1,22 @@
+# ---
+# I should live here:
+# /usr/lib/yum-plugins/multiverse.py
+
+import re
+from yum import config
+from yum.plugins import TYPE_CORE
+
+requires_api_version = '2.4'
+plugin_type = TYPE_CORE
+
+def config_hook(conduit):
+ config.RepoConf.multiversions = config.ListOption()
+
+def postreposetup_hook(conduit):
+ base = conduit._base
+ for repo in conduit.getRepos().listEnabled():
+ patterns = [pkg.replace("*", '.*') for pkg in repo.multiversions]
+ regex = re.compile("^(" + ( ")|(".join(patterns) ) + ")$")
+ pkgs = [pkg.name for pkg in base.pkgSack.returnPackages(repo.id) if regex.match(pkg.name)]
+ base.conf.installonlypkgs.extend(pkgs)
+ #print base.conf.installonlypkgs
Please sign in to comment.
Something went wrong with that request. Please try again.