[yum-git] Branch 'yum-3_2_X' - yum/depsolve.py
Seth Vidal
skvidal at linux.duke.edu
Thu Jul 10 16:23:38 UTC 2008
yum/depsolve.py | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
New commits:
commit 63540521709205dd601994e2b05b7ddd3712b3a1
Author: Seth Vidal <skvidal at fedoraproject.org>
Date: Thu Jul 10 12:21:29 2008 -0400
make sure the reqpo exists before we compare it
diff --git a/yum/depsolve.py b/yum/depsolve.py
index 8bb2cf1..2577cef 100644
--- a/yum/depsolve.py
+++ b/yum/depsolve.py
@@ -986,8 +986,13 @@ class Depsolve(object):
if obsoleted:
pkgresults[po] -= 1024
break
-
- for thisarch in (reqpo.arch, getBestArch()):
+
+ if reqpo:
+ arches = (reqpo.arch, getBestArch())
+ else:
+ arches = (getBestArch())
+
+ for thisarch in arches:
res = _compare_arch_distance(po, nextpo, thisarch)
if not res:
continue
@@ -1001,13 +1006,13 @@ class Depsolve(object):
self.verbose_logger.log(logginglevels.DEBUG_4,
_('common sourcerpm %s and %s' % (po, reqpo)))
pkgresults[po] += 20
-
- cpl = _common_prefix_len(po.name, reqpo.name)
- if cpl > 2:
- self.verbose_logger.log(logginglevels.DEBUG_4,
- _('common prefix of %s between %s and %s' % (cpl, po, reqpo)))
-
- pkgresults[po] += cpl*2
+ if reqpo:
+ cpl = _common_prefix_len(po.name, reqpo.name)
+ if cpl > 2:
+ self.verbose_logger.log(logginglevels.DEBUG_4,
+ _('common prefix of %s between %s and %s' % (cpl, po, reqpo)))
+
+ pkgresults[po] += cpl*2
pkgresults[po] += (len(po.name)*-1)
More information about the Yum-cvs-commits
mailing list