[yum-commits] db.c

James Antill james at osuosl.org
Tue Oct 14 17:14:45 UTC 2008


 db.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

New commits:
commit c5033bfe5484ec3ecd49f1bf8801c6a8163df482
Author: James Antill <james at and.org>
Date:   Tue Oct 14 13:13:54 2008 -0400

    Turn off .sqlite updating from new .xml data, bug 465898

diff --git a/db.c b/db.c
index a6af904..a1e4fe8 100644
--- a/db.c
+++ b/db.c
@@ -19,6 +19,11 @@
 #include <unistd.h>
 #include "db.h"
 
+/*  We have a lot of code so we can "quickly" update the .sqlite file using
+ * the old .sqlite data and the new .xml data. However it seems to have weird
+ * edge cases where it doesn't work, rhbz 465898 etc. ... so we turn it off. */
+#define YMP_CONFIG_UPDATE_DB 0
+
 GQuark
 yum_db_error_quark (void)
 {
@@ -196,10 +201,13 @@ yum_db_open (const char *path,
                 return NULL;
                 break;
             case DB_STATUS_CHECKSUM_MISMATCH:
-                sqlite3_exec (db, "PRAGMA synchronous = 0", NULL, NULL, NULL);
-                sqlite3_exec (db, "DELETE FROM db_info", NULL, NULL, NULL);
-                return db;
-                break;
+                if (YMP_CONFIG_UPDATE_DB) {
+                    sqlite3_exec (db, "PRAGMA synchronous = 0", NULL,NULL,NULL);
+                    sqlite3_exec (db, "DELETE FROM db_info", NULL, NULL, NULL);
+                    return db;
+                    break;
+                }
+                /* FALL THROUGH */
             case DB_STATUS_VERSION_MISMATCH:
             case DB_STATUS_ERROR:
                 sqlite3_close (db);


More information about the Yum-commits mailing list