[yum-cvs] 2 commits - shell.py yum/sqlitesack.py yum/yumRepo.py

Seth Vidal skvidal at linux.duke.edu
Thu Sep 6 02:54:04 UTC 2007


 shell.py          |   17 +++++++++--------
 yum/sqlitesack.py |   20 ++++++++++++++++++--
 yum/yumRepo.py    |    2 +-
 3 files changed, 28 insertions(+), 11 deletions(-)

New commits:
commit a8887cbf079a41fa23054cfabf512818d2c79f65
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Wed Sep 5 22:52:20 2007 -0400

    - fix a problem when enabling new repos, too that the sack would never
      get setup for that repo

diff --git a/shell.py b/shell.py
index 2f72781..27f52a7 100644
--- a/shell.py
+++ b/shell.py
@@ -272,7 +272,7 @@ class YumShell(cmd.Cmd):
                 else:
                     for repo in changed:
                         try:
-                            self.base._getRepos(thisrepo=repo)
+                            self.base.doRepoSetup(thisrepo=repo)
                         except Errors.RepoError, e:
                             self.logger.critical('Disabling Repository')
                             self.base.repos.disableRepo(repo)
commit 9c6c6f88e524e7fec0e4a78ee9e8274fd9640c07
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Wed Sep 5 22:48:54 2007 -0400

    - clean up how we do repo disabling in yum shell
    - more completely destroy repository objects when we're done with them

diff --git a/shell.py b/shell.py
index 468a5e1..2f72781 100644
--- a/shell.py
+++ b/shell.py
@@ -284,19 +284,20 @@ class YumShell(cmd.Cmd):
             repos = self._shlex_split(args)
             for repo in repos:
                 try:
-                    self.base.repos.disableRepo(repo)
+                    offrepos = self.base.repos.disableRepo(repo)
                 except Errors.ConfigError, e:
                     self.logger.critical(e)
                 except Errors.RepoError, e:
                     self.logger.critical(e)
 
                 else:
-                    if self.base.pkgSack:       # kill the pkgSack
-                        self.base.pkgSack = None
-                    self.base.up = None     # reset the updates
-                    # reset the transaction set and refresh everything
-                    self.base.closeRpmDB() 
-        
+                    # close the repos, too
+                    for repoid in offrepos:
+                        thisrepo = self.base.repos.repos[repoid]
+                        thisrepo.close()       # kill the pkgSack
+            # rebuild the indexes to be sure we cleaned up
+            self.base.pkgSack.buildIndexes()
+            
         else:
             self.do_help('repo')
                 
diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py
index dc10db4..88b63f7 100644
--- a/yum/sqlitesack.py
+++ b/yum/sqlitesack.py
@@ -222,11 +222,27 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
                        self.filelistsdb.values() + \
                        self.otherdb.values():
             dataobj.close()
+            self.primarydb = {}
+            self.filelistsdb = {}
+            self.otherdb = {}
+            self.excludes = {}
+            self._search_cache = {
+                'provides' : { },
+                'requires' : { },
+                }
+            del self.pkgobjlist
+            del self.pkglist
+
         yumRepo.YumPackageSack.close(self)
 
     def buildIndexes(self):
-        # We don't need these
-        return
+        # we just need to nuke the indexes first
+        if hasattr(self, 'pkgobjlist'):
+            del self.pkgobjlist
+        if hasattr(self, 'pkglist'):
+            del self.pkglist
+        self.simplePkgList()
+        self.returnPackages()
 
     def _checkIndexes(self, failure='error'):
         return
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index dc940ab..48ec521 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -53,7 +53,7 @@ class YumPackageSack(packageSack.PackageSack):
         self.close()
 
     def close(self):
-        pass
+        self.added = {}
 
     def addDict(self, repo, datatype, dataobj, callback=None):
         if self.added.has_key(repo):



More information about the Yum-cvs-commits mailing list