[darwinbuild-changes] [743] trunk/darwinup

source_changes at macosforge.org source_changes at macosforge.org
Mon Mar 8 16:10:01 PST 2010


Revision: 743
          http://trac.macosforge.org/projects/darwinbuild/changeset/743
Author:   wsiegrist at apple.com
Date:     2010-03-08 16:09:58 -0800 (Mon, 08 Mar 2010)
Log Message:
-----------
Roll out r740 from trunk

Revision Links:
--------------
    http://trac.macosforge.org/projects/darwinbuild/changeset/740

Modified Paths:
--------------
    trunk/darwinup/DB.cpp
    trunk/darwinup/Depot.cpp
    trunk/darwinup/Depot.h
    trunk/darwinup/main.cpp

Modified: trunk/darwinup/DB.cpp
===================================================================
--- trunk/darwinup/DB.cpp	2010-03-08 19:40:41 UTC (rev 742)
+++ trunk/darwinup/DB.cpp	2010-03-09 00:09:58 UTC (rev 743)
@@ -415,7 +415,7 @@
 	int res = this->get_all_ordered("get_archives",
 									data, count,
 									this->m_archives_table,
-									this->m_archives_table->column(0), // order by serial
+									this->m_archives_table->column(0), // order by path
 									ORDER_BY_DESC,
 									1,
 									this->m_archives_table->column(2),  // name

Modified: trunk/darwinup/Depot.cpp
===================================================================
--- trunk/darwinup/Depot.cpp	2010-03-08 19:40:41 UTC (rev 742)
+++ trunk/darwinup/Depot.cpp	2010-03-09 00:09:58 UTC (rev 743)
@@ -266,36 +266,6 @@
 	return list;	
 }
 
-Archive** Depot::get_superseded_archives(uint32_t* count) {
-	int res = DB_OK;
-	uint8_t** archlist;
-	res = this->m_db->get_archives(&archlist, count, false); // rollbacks cannot be superseded
-	
-	Archive** list = (Archive**)malloc(sizeof(Archive*) * (*count));
-	if (!list) {
-		fprintf(stderr, "Error: ran out of memory in Depot::get_superseded_archives\n");
-		return NULL;
-	}
-
-	uint32_t i = 0;
-	uint32_t cur = i;
-	if (FOUND(res)) {
-		while (i < *count) {
-			Archive* archive = this->m_db->make_archive(archlist[i++]);
-			if (archive && this->is_superseded(archive)) {
-				list[cur++] = archive;
-			} else if (!archive) {
-				fprintf(stderr, "%s:%d: DB::make_archive returned NULL\n", __FILE__, __LINE__);
-				res = -1;
-				break;
-			}
-		}
-	}
-	// adjust count based on our is_superseded filtering
-	*count = cur;
-	return list;	
-}
-
 uint64_t Depot::count_archives() {
 	extern uint32_t verbosity;
 	uint64_t c = this->m_db->count_archives((bool)(verbosity & VERBOSE_DEBUG));
@@ -866,9 +836,6 @@
 
 	if (res == 0) res = prune_archives();
 
-	if (res == 0) fprintf(stdout, "Uninstalled archive: %llu %s \n",
-						  archive->serial(), archive->name());
-	
 	(void)this->lock(LOCK_SH);
 
 	return res;
@@ -1042,23 +1009,6 @@
 
 int Depot::is_locked() { return m_is_locked; }
 
-bool Depot::is_superseded(Archive* archive) {
-	int res = DB_OK;
-	uint8_t** filelist;
-	uint8_t* data;
-	uint32_t count;	
-	res = this->m_db->get_files(&filelist, &count, archive);
-	if (FOUND(res)) {
-		for (uint32_t i=0; i < count; i++) {
-			File* file = this->m_db->make_file(filelist[i]);
-			res = this->m_db->get_next_file(&data, file, FILE_SUPERSEDED);
-			// XXX: need to send data to Table to free
-			if (!FOUND(res)) return false;
-		}
-	}
-	return true;			
-}
-
 int Depot::lock(int operation) {
 	int res = 0;
 	if (m_lock_fd == -1) {
@@ -1183,8 +1133,6 @@
 	
 	if (strncasecmp(arg, "all", 3) == 0) {
 		list = this->get_all_archives(&count);
-	} else if (strncasecmp(arg, "superseded", 10) == 0) {
-		list = this->get_superseded_archives(&count);
 	} else {
 		// make a list of 1 Archive
 		list = (Archive**)malloc(sizeof(Archive*));

Modified: trunk/darwinup/Depot.h
===================================================================
--- trunk/darwinup/Depot.h	2010-03-08 19:40:41 UTC (rev 742)
+++ trunk/darwinup/Depot.h	2010-03-09 00:09:58 UTC (rev 743)
@@ -79,7 +79,6 @@
 
 	// returns a list of Archive*. Caller must free the list. 
 	Archive** get_all_archives(uint32_t *count);
-	Archive** get_superseded_archives(uint32_t *count);
 	uint64_t count_archives();
 	
 	int dump();
@@ -113,7 +112,6 @@
 	// test if the depot is currently locked 
 	int is_locked();
 
-	bool is_superseded(Archive* archive);
 
 protected:
 

Modified: trunk/darwinup/main.cpp
===================================================================
--- trunk/darwinup/main.cpp	2010-03-08 19:40:41 UTC (rev 742)
+++ trunk/darwinup/main.cpp	2010-03-09 00:09:58 UTC (rev 743)
@@ -72,14 +72,12 @@
 	fprintf(stderr, "          xar, zip                                             \n");
 	fprintf(stderr, "                                                               \n");
 	fprintf(stderr, "<archive> is one of:                                           \n");
-	fprintf(stderr, "          <serial>     the Serial number                       \n");
-	fprintf(stderr, "          <uuid>       the UUID                                \n");
-	fprintf(stderr, "          <name>       the last root installed with that name  \n");
-	fprintf(stderr, "          newest       the newest (last) root installed        \n");
-	fprintf(stderr, "          oldest       the oldest root installed               \n");
-	fprintf(stderr, "          superseded   all roots that have been fully replaced \n");
-	fprintf(stderr, "                        by newer roots                         \n");
-	fprintf(stderr, "          all          all installed roots                     \n");
+	fprintf(stderr, "          <serial>   the Serial number                         \n");
+	fprintf(stderr, "          <uuid>     the UUID                                  \n");
+	fprintf(stderr, "          <name>     the last root installed with that name    \n");
+	fprintf(stderr, "          newest     the newest (last) root installed          \n");
+	fprintf(stderr, "          oldest     the oldest root installed                 \n");
+	fprintf(stderr, "          all        all installed roots                       \n");
 	fprintf(stderr, "                                                               \n");
 	exit(1);
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20100308/c3588010/attachment-0001.html>


More information about the darwinbuild-changes mailing list