[70386] branches/gsoc10-configfiles/base/src/cregistry

and.damore at macports.org and.damore at macports.org
Sat Aug 7 15:40:47 PDT 2010


Revision: 70386
          http://trac.macports.org/changeset/70386
Author:   and.damore at macports.org
Date:     2010-08-07 15:40:46 -0700 (Sat, 07 Aug 2010)
Log Message:
-----------
uncommit entry.c changes, sql.c change

Modified Paths:
--------------
    branches/gsoc10-configfiles/base/src/cregistry/entry.c
    branches/gsoc10-configfiles/base/src/cregistry/entry.h
    branches/gsoc10-configfiles/base/src/cregistry/sql.c

Modified: branches/gsoc10-configfiles/base/src/cregistry/entry.c
===================================================================
--- branches/gsoc10-configfiles/base/src/cregistry/entry.c	2010-08-07 21:47:53 UTC (rev 70385)
+++ branches/gsoc10-configfiles/base/src/cregistry/entry.c	2010-08-07 22:40:46 UTC (rev 70386)
@@ -860,60 +860,6 @@
 }
 
 /**
- * gsoc10-configfiles
- * Maps files to the given port in the filemap. The list of files must not
- * contain files that are already mapped to the given port.
- *
- * @param [in] entry      the entry to map the files to
- * @param [in] tupels      a list of tupels to map in form {file checksum}
- * @param [in] tupel_count the number of tupels
- * @param [out] errPtr    on error, a description of the error that occurred
- * @return                true if success; false if failure
- */
-int reg_entry_map_with_md5(reg_entry* entry, char** tupels, int tupel_count,
-        reg_error* errPtr) {
-    reg_registry* reg = entry->reg;
-    int result = 1;
-    sqlite3_stmt* stmt = NULL;
-    char* insert = "INSERT INTO registry.files (id, path, mtime, active, md5sum) "
-        "VALUES (?, ?, 0, 0, ?)";
-    if ((sqlite3_prepare(reg->db, insert, -1, &stmt, NULL) == SQLITE_OK)
-            && (sqlite3_bind_int64(stmt, 1, entry->id) == SQLITE_OK)) {
-        int i;
-        for (i=0; i<tupel_count && result; i++) {
-            if (sqlite3_bind_text(stmt, 2, tupels[i], -1, SQLITE_STATIC)
-                    == SQLITE_OK) {
-                int r;
-                do {
-                    r = sqlite3_step(stmt);
-                    switch (r) {
-                        case SQLITE_DONE:
-                            sqlite3_reset(stmt);
-                            break;
-                        case SQLITE_BUSY:
-                            break;
-                        default:
-                            reg_sqlite_error(reg->db, errPtr, insert);
-                            result = 0;
-                            break;
-                    }
-                } while (r == SQLITE_BUSY);
-            } else {
-                reg_sqlite_error(reg->db, errPtr, insert);
-                result = 0;
-            }
-        }
-    } else {
-        reg_sqlite_error(reg->db, errPtr, insert);
-        result = 0;
-    }
-    if (stmt) {
-        sqlite3_finalize(stmt);
-    }
-    return result;
-}
-
-/**
  * Unaps files from the given port in the filemap. The files must be owned by
  * the given entry.
  *

Modified: branches/gsoc10-configfiles/base/src/cregistry/entry.h
===================================================================
--- branches/gsoc10-configfiles/base/src/cregistry/entry.h	2010-08-07 21:47:53 UTC (rev 70385)
+++ branches/gsoc10-configfiles/base/src/cregistry/entry.h	2010-08-07 22:40:46 UTC (rev 70386)
@@ -75,8 +75,6 @@
 int reg_entry_propset(reg_entry* entry, char* key, char* value,
         reg_error* errPtr);
 
-int reg_entry_map_with_md5(reg_entry* entry, char** tupels, int tupel_count,
-        reg_error* errPtr);
 int reg_entry_map(reg_entry* entry, char** files, int file_count,
         reg_error* errPtr);
 int reg_entry_unmap(reg_entry* entry, char** files, int file_count,

Modified: branches/gsoc10-configfiles/base/src/cregistry/sql.c
===================================================================
--- branches/gsoc10-configfiles/base/src/cregistry/sql.c	2010-08-07 21:47:53 UTC (rev 70385)
+++ branches/gsoc10-configfiles/base/src/cregistry/sql.c	2010-08-07 22:40:46 UTC (rev 70386)
@@ -130,7 +130,7 @@
 
         /* file map */
         "CREATE TABLE registry.files (id INTEGER, path TEXT, actual_path TEXT, "
-            "active INT, mtime DATETIME, md5sum TEXT, editable INT, is_config INT, modified INT, "
+            "active INT, mtime DATETIME, md5sum TEXT, editable INT, "
             "FOREIGN KEY(id) REFERENCES ports(id))",
         "CREATE INDEX registry.file_port ON files (id)",
         "CREATE INDEX registry.file_path ON files(path)",
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100807/0abb4d56/attachment.html>


More information about the macports-changes mailing list