Hi,

This is something I've been intending to comment on / patch for a long time but just haven't gotten around...

I know the "debug" part originates from times when yum's own depsolver was just being developed, but ts.check() is not really an optional call. Rpm can and does check more things there than yum does (things that cannot be determined by the information available in repodata, such as rpmlib() dependencies and more might be added), so although yum doesn't use the callback for depsolving anymore, it should always unconditionally call ts.check(). Something like this:

diff --git a/cli.py b/cli.py
index 06bfb68..70fa69f 100644
--- a/cli.py
+++ b/cli.py
@@ -504,30 +504,29 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
         if self.gpgsigcheck(downloadpkgs) != 0:
             return 1

-        if self.conf.rpm_check_debug:
-            rcd_st = time.time()
- self.verbose_logger.log(yum.logginglevels.INFO_2, - _('Running rpm_check_debug'))
-            msgs = self._run_rpm_check_debug()
-            if msgs:
-                rpmlib_only = True
-                for msg in msgs:
-                    if msg.startswith('rpmlib('):
-                        continue
-                    rpmlib_only = False
-                if rpmlib_only:
-                    print _("ERROR You need to update rpm to handle:")
-                else:
-                    print _('ERROR with rpm_check_debug vs depsolve:')
+        rcd_st = time.time()
+ self.verbose_logger.log(yum.logginglevels.INFO_2, + _('Running rpm transaction check'))
+        msgs = self._run_rpm_transaction_check()
+        if msgs:
+            rpmlib_only = True
+            for msg in msgs:
+                if msg.startswith('rpmlib('):
+                    continue
+                rpmlib_only = False
+            if rpmlib_only:
+                print _("ERROR You need to update rpm to handle:")
+            else:
+                print _('ERROR with rpm transaction check vs depsolve:')

-                for msg in msgs:
-                    print to_utf8(msg)
+            for msg in msgs:
+                print to_utf8(msg)

-                if rpmlib_only:
-                    return 1, [_('RPM needs to be updated')]
-                return 1, [_('Please report this error in %s') % 
self.conf.bugtracker_url]
+            if rpmlib_only:
+                return 1, [_('RPM needs to be updated')]
+            return 1, [_('Please report this error in %s') % 
self.conf.bugtracker_url]

-            self.verbose_logger.debug('rpm_check_debug time: %0.3f' % 
(time.time() - rcd_st))
+        self.verbose_logger.debug('rpm transaction check time: %0.3f' % 
(time.time() - rcd_st))

         tt_st = time.time()
         self.verbose_logger.log(yum.logginglevels.INFO_2,
diff --git a/yum/__init__.py b/yum/__init__.py
index fcf5076..21f09d8 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -4757,25 +4757,24 @@ class YumBase(depsolve.Depsolve):
     def _doTestTransaction(self,callback,display=None):
         ''' Do the RPM test transaction '''
# This can be overloaded by a subclass. - if self.conf.rpm_check_debug: - self.verbose_logger.log(logginglevels.INFO_2, - _('Running rpm_check_debug'))
-            msgs = self._run_rpm_check_debug()
-            if msgs:
-                rpmlib_only = True
-                for msg in msgs:
-                    if msg.startswith('rpmlib('):
-                        continue
-                    rpmlib_only = False
-                if rpmlib_only:
-                    retmsgs = [_("ERROR You need to update rpm to handle:")]
-                    retmsgs.extend(msgs)
-                    raise Errors.YumRPMCheckError, retmsgs
-                retmsgs = [_('ERROR with rpm_check_debug vs depsolve:')]
- retmsgs.extend(msgs) - retmsgs.append(_('Please report this error at %s') - % self.conf.bugtracker_url)
-                raise Errors.YumRPMCheckError,retmsgs
+ self.verbose_logger.log(logginglevels.INFO_2, + _('Running rpm transaction check'))
+        msgs = self._run_rpm_transaction_check()
+        if msgs:
+            rpmlib_only = True
+            for msg in msgs:
+                if msg.startswith('rpmlib('):
+                    continue
+                rpmlib_only = False
+            if rpmlib_only:
+                retmsgs = [_("ERROR You need to update rpm to handle:")]
+                retmsgs.extend(msgs)
+                raise Errors.YumRPMCheckError, retmsgs
+            retmsgs = [_('ERROR with rpm transaction check vs depsolve:')]
+ retmsgs.extend(msgs) + retmsgs.append(_('Please report this error at %s') + % self.conf.bugtracker_url)
+            raise Errors.YumRPMCheckError,retmsgs

         tsConf = {}
         for feature in ['diskspacecheck']: # more to come, I'm sure
@@ -4820,7 +4819,7 @@ class YumBase(depsolve.Depsolve):
             cb.display = display
         self.runTransaction( cb=cb )

-    def _run_rpm_check_debug(self):
+    def _run_rpm_transaction_check(self):
         results = []
         # save our dsCallback out
         dscb = self.dsCallback
diff --git a/yum/config.py b/yum/config.py
index 97e5e3d..cb27bd4 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -691,7 +691,6 @@ class YumConf(StartupConf):
     metadata_expire = SecondsOption(60 * 60 * 6) # Time in seconds (6h).
     # Time in seconds (1 day). NOTE: This isn't used when using metalinks
     mirrorlist_expire = SecondsOption(60 * 60 * 24)
-    rpm_check_debug = BoolOption(True)
     disable_excludes = ListOption()
     skip_broken = BoolOption(False)
     #  Note that "instant" is the old behaviour, but group:primary is very
diff --git a/yummain.py b/yummain.py
index c64b140..196ce59 100755
--- a/yummain.py
+++ b/yummain.py
@@ -205,7 +205,7 @@ def main(args):
     except IOError, e:
         return exIOError(e)

-    # rpm_check_debug failed.
+    # rpm transaction check failed.
     if type(return_code) == type((0,)) and len(return_code) == 2:
         (result, resultmsgs) = return_code
         for msg in resultmsgs:


Oh and btw, why the code duplication in cli.py vs yum/__init__.py?

        - Panu -
_______________________________________________
Yum-devel mailing list
Yum-devel@lists.baseurl.org
http://lists.baseurl.org/mailman/listinfo/yum-devel

Reply via email to