[yum-git] yum/sqlitesack.py

James Antill james at linux.duke.edu
Thu Jan 17 00:19:53 UTC 2008


 yum/sqlitesack.py |    1 +
 1 file changed, 1 insertion(+)

New commits:
commit 1a8690a739427b25957433dc1fbbcd9141073fef
Author: James Antill <james at and.org>
Date:   Wed Jan 16 19:19:41 2008 -0500

     This might be the wrong fix. This makes sure that __len__ always returns a
    number, which is good otherwise we get:
    
        self.doUtilYumSetup(opts) # in /usr/bin/yumdownloader
    ->    self._getSacks(archlist=archlist) # in /usr/bin/yumdownloader
      ->    if self._pkgSack and thisrepo is None: # in yum/__init__
        ->    ret += len(sack) # in yum/packageSack.py
    
    ...due to no addDict() being called on the sack yet, so 0 is the correct
    value.
     But it seems like we shouldn't get here before we've done the init.

diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py
index d5e2b0a..f28e279 100644
--- a/yum/sqlitesack.py
+++ b/yum/sqlitesack.py
@@ -244,6 +244,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
             cur = cache.cursor() # Does all repos, just using a cache
             executeSQL(cur, "select count(pkgId) from packages")
             return cur.fetchone()[0] - exclude_num
+        return 0
 
     @catchSqliteException
     def close(self):



More information about the Yum-cvs-commits mailing list