From: Michael Tremer Date: Sat, 14 Apr 2012 19:16:30 +0000 (+0200) Subject: Fix accessing index data after the transaction is done. X-Git-Tag: 0.9.23~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b856696a0a8173eaacdd03833971272de06118ce;p=pakfire.git Fix accessing index data after the transaction is done. --- diff --git a/python/pakfire/client/builder.py b/python/pakfire/client/builder.py index a039e65f9..2ade5dc84 100644 --- a/python/pakfire/client/builder.py +++ b/python/pakfire/client/builder.py @@ -334,6 +334,7 @@ class ClientBuilder(object): pkgs = [] for pkg in installed_packages: + assert pkg.uuid, "%s has got no UUID" pkgs.append((pkg.friendly_name, pkg.uuid)) return self.conn.build_upload_buildroot(self.build_id, pkgs) diff --git a/python/pakfire/repository/system.py b/python/pakfire/repository/system.py index 642c4bd19..5dcdd041c 100644 --- a/python/pakfire/repository/system.py +++ b/python/pakfire/repository/system.py @@ -52,6 +52,9 @@ class RepositorySystem(base.RepositoryFactory): # Commit the database to disk. self.db.commit() + # Make sure that all data in the index is accessable. + self.index.optimize() + def add_package(self, pkg): # Add package to the database. self.db.add_package(pkg)