[117409] trunk/base/src/cregistry/sql.c

cal at macports.org cal at macports.org
Tue Feb 25 11:59:37 PST 2014


Revision: 117409
          https://trac.macports.org/changeset/117409
Author:   cal at macports.org
Date:     2014-02-25 11:59:37 -0800 (Tue, 25 Feb 2014)
Log Message:
-----------
sql.c: fix database upgrade code

sql_version() treats 1.2 < 1.100 (which is the version number the last update stored). So, version numbers aren't floating point, but actually integers separated by dots (which makes sense).

Modified Paths:
--------------
    trunk/base/src/cregistry/sql.c

Modified: trunk/base/src/cregistry/sql.c
===================================================================
--- trunk/base/src/cregistry/sql.c	2014-02-25 19:32:23 UTC (rev 117408)
+++ trunk/base/src/cregistry/sql.c	2014-02-25 19:59:37 UTC (rev 117409)
@@ -264,7 +264,7 @@
 
         /* we can't call vercmp directly because it's static, but we have
          * sql_version, which is basically an alias */
-        if (sql_version(NULL, -1, version, -1, "1.1") < 0) {
+        if (sql_version(NULL, -1, version, -1, "1.100") < 0) {
             /* we need to update to 1.1, add binary field and index to files
              * table */
             static char* version_1_1_queries[] = {
@@ -326,7 +326,7 @@
             continue;
         }
 
-        if (sql_version(NULL, -1, version, -1, "1.2") < 0) {
+        if (sql_version(NULL, -1, version, -1, "1.200") < 0) {
             /* We need to add the portgroup table and move the portfiles out
                of the db and into the filesystem. The latter is way easier to do
                from Tcl, so here we'll just flag that it needs to be done. */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140225/a7c3bd6a/attachment.html>


More information about the macports-changes mailing list