[yum-cvs] yum/yum plugins.py,1.19,1.20

Menno Smits mjs at linux.duke.edu
Sun Feb 5 22:03:15 UTC 2006


Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv14710

Modified Files:
	plugins.py 
Log Message:
Applied Paul Nasrat's patch to make plugins group aware with some changes.
Since group information is only available after repos have been set up,
RepoSetupPluginConduit has been split into PreRepoSetupPluginConduit and
PostRepoSetupPluginConduit with getGroups() available in the latter.


Index: plugins.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/plugins.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- plugins.py	2 Dec 2005 20:39:03 -0000	1.19
+++ plugins.py	5 Feb 2006 22:03:13 -0000	1.20
@@ -82,7 +82,7 @@
 # API, the major version number must be incremented and the minor version number
 # reset to 0. If a change is made that doesn't break backwards compatibility,
 # then the minor number must be incremented.
-API_VERSION = '2.1'
+API_VERSION = '2.2'
 
 # Plugin types
 TYPE_CORE = 0
@@ -95,8 +95,8 @@
     'init': 'InitPluginConduit',
     'predownload': 'DownloadPluginConduit',
     'postdownload': 'DownloadPluginConduit',
-    'prereposetup': 'RepoSetupPluginConduit',
-    'postreposetup': 'RepoSetupPluginConduit',
+    'prereposetup': 'PreRepoSetupPluginConduit',
+    'postreposetup': 'PostRepoSetupPluginConduit',
     'close': 'PluginConduit',
     'pretrans': 'MainPluginConduit',
     'posttrans': 'MainPluginConduit',
@@ -428,7 +428,7 @@
         '''
         return self._base.repos
 
-class RepoSetupPluginConduit(InitPluginConduit):
+class PreRepoSetupPluginConduit(InitPluginConduit):
 
     def getCmdLine(self):
         '''Return parsed command line options.
@@ -447,10 +447,20 @@
         self._base.doRpmDBSetup()
         return self._base.rpmdb
 
-class DownloadPluginConduit(RepoSetupPluginConduit):
+class PostRepoSetupPluginConduit(PreRepoSetupPluginConduit):
+
+    def getGroups(self):
+        '''Return group information.
+
+        @return: yum.comps.Comps instance
+        '''
+        self._base.doGroupSetup()
+        return self._base.comps
+
+class DownloadPluginConduit(PostRepoSetupPluginConduit):
 
     def __init__(self, parent, base, conf, pkglist, errors=None):
-        RepoSetupPluginConduit.__init__(self, parent, base, conf)
+        PostRepoSetupPluginConduit.__init__(self, parent, base, conf)
         self._pkglist = pkglist
         self._errors = errors
 
@@ -470,7 +480,7 @@
             return {}
         return self._errors
 
-class MainPluginConduit(RepoSetupPluginConduit):
+class MainPluginConduit(PostRepoSetupPluginConduit):
 
     def getPackages(self, repo=None):
         if repo:




More information about the Yum-cvs-commits mailing list