[Uludag-commits] r15243 - branches/pisi-db/pisi

uludag-commits at pardus.org.tr uludag-commits at pardus.org.tr
1 Eyl 2007 Cmt 14:34:02 EEST


Author: faik
Date: Sat Sep  1 14:34:02 2007
New Revision: 15243

Modified:
   branches/pisi-db/pisi/api.py
   branches/pisi-db/pisi/index.py
Log:
Remove update_db

The only package db we need is pisi-index.xml


Modified: branches/pisi-db/pisi/api.py
=================================================================
--- branches/pisi-db/pisi/api.py	(original)
+++ branches/pisi-db/pisi/api.py	Sat Sep  1 14:34:02 2007
@@ -416,7 +416,6 @@
         except pisi.file.NoSignatureFound, e:
             ctx.ui.warning(e)
 
-        index.update_db(repo)
         ctx.ui.info(_('* Package database updated.'))
     else:
         raise Error(_('No repository named %s found.') % repo)
@@ -442,7 +441,6 @@
         except IOError, e:
             ctx.ui.warning(_("Input/Output error while reading %s: %s") % (indexpath, unicode(e)))
             return
-        index.update_db(repo)
     else:
         raise Error(_('No repository named %s found.') % repo)
 

Modified: branches/pisi-db/pisi/index.py
=================================================================
--- branches/pisi-db/pisi/index.py	(original)
+++ branches/pisi-db/pisi/index.py	Sat Sep  1 14:34:02 2007
@@ -109,32 +109,6 @@
                 ctx.ui.info(_('Adding %s to package index') % pkg)
                 self.add_package(pkg, deltas, repo_uri)
 
-    def update_db(self, repo):
-        # FIXME: updating db takes too much time. So a notify mechanism is used to inform the status
-        # of the operation.
-
-        self.progress = ctx.ui.Progress(len(self.packages)+len(self.specs))
-        self.processed = 0
-
-        def update_progress():
-            self.processed += 1
-            ctx.ui.display_progress(operation = "updatingrepo",
-                                    percent = self.progress.update(self.processed),
-                                    info = _("Updating package database of %s") % repo)
-
-        ctx.componentdb.remove_repo(repo)
-        for comp in self.components:
-            ctx.componentdb.update_component(comp, repo)
-        ctx.packagedb.remove_repo(repo)
-        ctx.packagedb.add_obsoletes(self.distribution.obsoletes, repo)
-        for pkg in self.packages:
-            ctx.packagedb.add_package(pkg, repo)
-            update_progress()
-        ctx.sourcedb.remove_repo(repo)
-        for sf in self.specs:
-            ctx.sourcedb.add_spec(sf, repo)
-            update_progress()
-
     def add_package(self, path, deltas, repo_uri):
         package = pisi.package.Package(path, 'r')
         md = package.get_metadata()


Uludag-commits mesaj listesiyle ilgili daha fazla bilgi