[yum-cvs] yum/yum __init__.py,1.118,1.119 plugins.py,1.12,1.13
Panu Matilainen
pmatilai at login.linux.duke.edu
Thu Jun 2 15:33:54 UTC 2005
Update of /home/groups/yum/cvs/yum/yum
In directory login:/tmp/cvs-serv8909/yum
Modified Files:
__init__.py plugins.py
Log Message:
Add preresolve and postresolve slots to plugin interface, bump up plugin
api version.
Index: __init__.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/__init__.py,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -r1.118 -r1.119
--- __init__.py 29 May 2005 06:14:36 -0000 1.118
+++ __init__.py 2 Jun 2005 15:33:52 -0000 1.119
@@ -325,7 +325,9 @@
def buildTransaction(self):
"""go through the packages in the transaction set, find them in the
packageSack or rpmdb, and pack up the ts accordingly"""
+ self.plugins.run('preresolve')
(rescode, restring) = self.resolveDeps()
+ self.plugins.run('postresolve', rescode=rescode, restring=restring)
return rescode, restring
def runTransaction(self, cb):
Index: plugins.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/plugins.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- plugins.py 8 May 2005 03:05:37 -0000 1.12
+++ plugins.py 2 Jun 2005 15:33:52 -0000 1.13
@@ -85,13 +85,14 @@
# 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.0'
+API_VERSION = '2.1'
SLOTS = (
'config', 'init',
'predownload', 'postdownload',
'prereposetup', 'postreposetup',
'exclude',
+ 'preresolve', 'postresolve',
'pretrans', 'posttrans',
'close'
)
@@ -136,6 +137,8 @@
conduitcls = PluginConduit
elif slotname in ('pretrans', 'posttrans', 'exclude'):
conduitcls = MainPluginConduit
+ elif slotname in ('preresolve', 'postresolve'):
+ conduitcls = DepsolvePluginConduit
else:
raise ValueError('unknown slot name "%s"' % slotname)
@@ -437,6 +440,11 @@
def getTsInfo(self):
return self._base.tsInfo
+class DepsolvePluginConduit(MainPluginConduit):
+ def __init__(self, parent, base, conf, rescode=None, restring=[]):
+ MainPluginConduit.__init__(self, parent, base, conf)
+ self.resultcode = rescode
+ self.resultstring = restring
def parsever(apiver):
maj, min = apiver.split('.')
More information about the Yum-cvs-commits
mailing list