|
Seth Vidal |
ccece1c |
commit 359ae828b915101116bb57fbe2645eae056c158b
|
|
Seth Vidal |
ccece1c |
Author: Tim Lauridsen <timlau@fedoraproject.org>
|
|
Seth Vidal |
ccece1c |
Date: Tue Mar 2 16:47:45 2010 +0100
|
|
Seth Vidal |
ccece1c |
|
|
Seth Vidal |
ccece1c |
Make skipbroken run again if packages has been added to transaction by a postresolve plugin
|
|
Seth Vidal |
ccece1c |
|
|
Seth Vidal |
ccece1c |
diff --git a/yum/__init__.py b/yum/__init__.py
|
|
Seth Vidal |
ccece1c |
index f21001d..69af7ba 100644
|
|
Seth Vidal |
ccece1c |
--- a/yum/__init__.py
|
|
Seth Vidal |
ccece1c |
+++ b/yum/__init__.py
|
|
Seth Vidal |
ccece1c |
@@ -866,20 +866,16 @@ class YumBase(depsolve.Depsolve):
|
|
Seth Vidal |
ccece1c |
# works for downloads / mirror failover etc.
|
|
Seth Vidal |
ccece1c |
self.rpmdb.ts = None
|
|
Seth Vidal |
ccece1c |
|
|
Seth Vidal |
ccece1c |
- # if depsolve failed and skipbroken is enabled
|
|
Seth Vidal |
ccece1c |
- # The remove the broken packages from the transactions and
|
|
Seth Vidal |
ccece1c |
- # Try another depsolve
|
|
Seth Vidal |
ccece1c |
- if self.conf.skip_broken and rescode==1:
|
|
Seth Vidal |
ccece1c |
- self.skipped_packages = [] # reset the public list of skipped packages.
|
|
Seth Vidal |
ccece1c |
- sb_st = time.time()
|
|
Seth Vidal |
ccece1c |
- rescode, restring = self._skipPackagesWithProblems(rescode, restring)
|
|
Seth Vidal |
ccece1c |
- self._printTransaction()
|
|
Seth Vidal |
ccece1c |
- self.verbose_logger.debug('Skip-Broken time: %0.3f' % (time.time() - sb_st))
|
|
Seth Vidal |
ccece1c |
+ # do the skip broken magic, if enabled and problems exist
|
|
Seth Vidal |
ccece1c |
+ (rescode, restring) = self._doSkipBroken(rescode, restring)
|
|
Seth Vidal |
ccece1c |
|
|
Seth Vidal |
ccece1c |
self.plugins.run('postresolve', rescode=rescode, restring=restring)
|
|
Seth Vidal |
ccece1c |
|
|
Seth Vidal |
ccece1c |
if self.tsInfo.changed:
|
|
Seth Vidal |
ccece1c |
(rescode, restring) = self.resolveDeps(rescode == 1)
|
|
Seth Vidal |
ccece1c |
+ # If transaction was changed by postresolve plugins then we should run skipbroken again
|
|
Seth Vidal |
ccece1c |
+ (rescode, restring) = self._doSkipBroken(rescode, restring, clear_skipped=False )
|
|
Seth Vidal |
ccece1c |
+
|
|
Seth Vidal |
ccece1c |
if self.tsInfo.pkgSack is not None: # rm Transactions don't have pkgSack
|
|
Seth Vidal |
ccece1c |
self.tsInfo.pkgSack.dropCachedData()
|
|
Seth Vidal |
ccece1c |
self.rpmdb.dropCachedData()
|
|
Seth Vidal |
ccece1c |
@@ -887,6 +883,21 @@ class YumBase(depsolve.Depsolve):
|
|
Seth Vidal |
ccece1c |
self.verbose_logger.debug('Depsolve time: %0.3f' % (time.time() - ds_st))
|
|
Seth Vidal |
ccece1c |
return rescode, restring
|
|
Seth Vidal |
ccece1c |
|
|
Seth Vidal |
ccece1c |
+ def _doSkipBroken(self,rescode, restring, clear_skipped=True):
|
|
Seth Vidal |
ccece1c |
+ ''' do skip broken if it is enabled '''
|
|
Seth Vidal |
ccece1c |
+ # if depsolve failed and skipbroken is enabled
|
|
Seth Vidal |
ccece1c |
+ # The remove the broken packages from the transactions and
|
|
Seth Vidal |
ccece1c |
+ # Try another depsolve
|
|
Seth Vidal |
ccece1c |
+ if self.conf.skip_broken and rescode==1:
|
|
Seth Vidal |
ccece1c |
+ if clear_skipped:
|
|
Seth Vidal |
ccece1c |
+ self.skipped_packages = [] # reset the public list of skipped packages.
|
|
Seth Vidal |
ccece1c |
+ sb_st = time.time()
|
|
Seth Vidal |
ccece1c |
+ rescode, restring = self._skipPackagesWithProblems(rescode, restring)
|
|
Seth Vidal |
ccece1c |
+ self._printTransaction()
|
|
Seth Vidal |
ccece1c |
+ self.verbose_logger.debug('Skip-Broken time: %0.3f' % (time.time() - sb_st))
|
|
Seth Vidal |
ccece1c |
+ return (rescode, restring)
|
|
Seth Vidal |
ccece1c |
+
|
|
Seth Vidal |
ccece1c |
+
|
|
Seth Vidal |
ccece1c |
def _skipPackagesWithProblems(self, rescode, restring):
|
|
Seth Vidal |
ccece1c |
''' Remove the packages with depsolve errors and depsolve again '''
|
|
Seth Vidal |
ccece1c |
|
|
Seth Vidal |
ccece1c |
@@ -983,7 +994,7 @@ class YumBase(depsolve.Depsolve):
|
|
Seth Vidal |
ccece1c |
for po in skipped_list:
|
|
Seth Vidal |
ccece1c |
msg = _(" %s from %s") % (str(po),po.repo.id)
|
|
Seth Vidal |
ccece1c |
self.verbose_logger.info(msg)
|
|
Seth Vidal |
ccece1c |
- self.skipped_packages = skipped_list # make the skipped packages public
|
|
Seth Vidal |
ccece1c |
+ self.skipped_packages.extend(skipped_list) # make the skipped packages public
|
|
Seth Vidal |
ccece1c |
else:
|
|
Seth Vidal |
ccece1c |
# If we cant solve the problems the show the original error messages.
|
|
Seth Vidal |
ccece1c |
self.verbose_logger.info("Skip-broken could not solve problems")
|