Revision
117409
Author
cal@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

Diff

Modified: trunk/base/src/cregistry/sql.c (117408 => 117409)


--- 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. */