[yum-cvs] yum cli.py,1.270,1.271

Seth Vidal skvidal at linux.duke.edu
Thu Jul 5 14:05:02 UTC 2007


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

Modified Files:
	cli.py 
Log Message:
as a result of the depsolving bugs we've been seeing I added in a temporary
ts.check() debug option. If you're running yum from the cli and you set
rpm_check_debug=True in your yum.conf then it will run an rpm ts.check()
before it runs the transaction test. If it finds any problems it will bail
out. This might help us find bogus depsolving.



Index: cli.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/cli.py,v
retrieving revision 1.270
retrieving revision 1.271
diff -u -r1.270 -r1.271
--- cli.py	5 Jun 2007 07:52:58 -0000	1.270
+++ cli.py	5 Jul 2007 14:05:00 -0000	1.271
@@ -33,6 +33,7 @@
 import yum.plugins
 from yum.constants import TS_OBSOLETED
 import rpmUtils.arch
+import rpmUtils.miscutils
 from yum.packages import parsePackages, YumLocalPackage
 from i18n import _
 import callback
@@ -316,6 +317,18 @@
         if self.gpgsigcheck(downloadpkgs) != 0:
             return 1
         
+        if self.conf.rpm_check_debug:
+            self.verbose_logger.log(yum.logginglevels.INFO_2, 
+                 'Running rpm_check_debug')
+            msgs = self._run_rpm_check_debug()
+            if msgs:
+                print 'ERROR with rpm_check_debug vs depsolve:'
+                for msg in msgs:
+                    print msg
+    
+                return 0, ['Please report this error in bugzilla']
+                
+            
         self.verbose_logger.log(yum.logginglevels.INFO_2,
             'Running Transaction Test')
         tsConf = {}
@@ -1064,6 +1077,26 @@
             return True
         
         return False
+    def _run_rpm_check_debug(self):
+        import rpm
+        results = []
+        self.populateTs(test=1)
+        deps = self.ts.check()
+        for deptuple in deps:
+            ((name, version, release), (needname, needversion), flags,
+              suggest, sense) = deptuple
+            if sense == rpm.RPMDEP_SENSE_REQUIRES:
+                msg = 'Package %s needs %s, this is not available.' % \
+                      (name, rpmUtils.miscutils.formatRequire(needname, 
+                                                              needversion, flags))
+                results.append(msg)
+            elif sense == rpm.RPMDEP_SENSE_CONFLICTS:
+                msg = 'Package %s conflicts with %s.' % \
+                      (name, rpmUtils.miscutils.formatRequire(needname, 
+                                                              needversion, flags))
+                results.append(msg)
+
+        return results
 
 class YumOptionParser(OptionParser):
     '''Subclass that makes some minor tweaks to make OptionParser do things the
@@ -1230,6 +1263,8 @@
         self.add_option("", "--disableplugin", dest="disableplugins", default=[], 
                 action="append", help="disable plugins by name",
                 metavar='[plugin]')
+
+
         
 def _filtercmdline(novalopts, valopts, args):
     '''Keep only specific options from the command line argument list
@@ -1275,3 +1310,4 @@
                     out.append(a)
 
     return out
+




More information about the Yum-cvs-commits mailing list