[Yum-devel] [PATCH] when we do localinstalls/reinstalls/etc - make sure we check disableexcludes to see if we've disabled the exclude that might be stopping the localinstall.
Seth Vidal
skvidal at fedoraproject.org
Fri Oct 9 20:22:23 UTC 2009
This creates a new private method of YumBase._is_local_exclude() which takes
a package object and a list of pkgs to match against it.
---
yum/__init__.py | 40 ++++++++++++++++++++--------------------
1 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/yum/__init__.py b/yum/__init__.py
index daa437f..43dae48 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -3287,14 +3287,8 @@ class YumBase(depsolve.Depsolve):
donothingpkgs.append(po)
# handle excludes for a localinstall
- toexc = []
- if len(self.conf.exclude) > 0:
- exactmatch, matched, unmatched = \
- parsePackages(installpkgs + map(lambda x: x[0], updatepkgs),
- self.conf.exclude, casematch=1)
- toexc = exactmatch + matched
-
- if po in toexc:
+ check_pkgs = installpkgs + map(lambda x: x[0], updatepkgs)
+ if self._is_local_exclude(po, check_pkgs):
self.verbose_logger.debug(_('Excluding %s'), po)
return tx_return
@@ -3355,13 +3349,7 @@ class YumBase(depsolve.Depsolve):
return []
# handle excludes for a local reinstall
- toexc = []
- if len(self.conf.exclude) > 0:
- exactmatch, matched, unmatched = \
- parsePackages([po], self.conf.exclude, casematch=1)
- toexc = exactmatch + matched
-
- if po in toexc:
+ if self._is_local_exclude(po, [po]):
self.verbose_logger.debug(_('Excluding %s'), po)
return []
@@ -3444,18 +3432,30 @@ class YumBase(depsolve.Depsolve):
return []
# handle excludes for a local downgrade
+ if self._is_local_exclude(po, [po]):
+ self.verbose_logger.debug(_('Excluding %s'), po)
+ return []
+
+ return self.downgrade(po=po)
+
+ def _is_local_exclude(self, po, pkglist):
+ """returns True if the local pkg should be excluded"""
+
+ if "all" in self.conf.disable_excludes or \
+ "main" in self.conf.disable_excludes:
+ return False
+
toexc = []
if len(self.conf.exclude) > 0:
exactmatch, matched, unmatched = \
- parsePackages([po], self.conf.exclude, casematch=1)
+ parsePackages(pkglist, self.conf.exclude, casematch=1)
toexc = exactmatch + matched
if po in toexc:
- self.verbose_logger.debug(_('Excluding %s'), po)
- return []
-
- return self.downgrade(po=po)
+ return True
+ return False
+
def downgrade(self, po=None, **kwargs):
""" Try to downgrade a package. Works like:
% yum shell <<EOL
--
1.6.2.5
More information about the Yum-devel
mailing list