Revision
835
Author
wsiegrist@apple.com
Date
2010-06-10 10:46:38 -0700 (Thu, 10 Jun 2010)

Log Message

Always print success message for rename command.

Modified Paths

Diff

Modified: branches/PR-7872907/darwinup/Depot.cpp (834 => 835)


--- branches/PR-7872907/darwinup/Depot.cpp	2010-06-10 17:38:00 UTC (rev 834)
+++ branches/PR-7872907/darwinup/Depot.cpp	2010-06-10 17:46:38 UTC (rev 835)
@@ -1408,7 +1408,6 @@
 int Depot::rename_archive(const char* archspec, const char* name) {
 	extern uint32_t verbosity;
 	int res = 0;
-	char uuid[37];
 	
 	if (strncasecmp(archspec, "all", 3) == 0 ||
 		strncasecmp(archspec, "superseded", 10) == 0) {
@@ -1422,10 +1421,13 @@
 		fprintf(stdout, "Archive not found: %s\n", archspec);
 		return -1;
 	}
+	
+	char uuid[37];
+	uuid_unparse_upper(archive->uuid(), uuid);
 	if (verbosity & VERBOSE_DEBUG) {
-		uuid_unparse_upper(archive->uuid(), uuid);
 		fprintf(stdout, "Found archive: %s\n", uuid);
 	}
+
 	if (!name || strlen(name) == 0) {
 		fprintf(stderr, "Error: invalid name: '%s'\n", name);
 		return -3;
@@ -1442,9 +1444,8 @@
 							   archive->info(),
 							   archive->build());
 
-	if (res == 0 && (verbosity & VERBOSE_DEBUG)) {
-		fprintf(stdout, "Renamed archive %s to '%s'.\n", uuid, archive->name());
-	}
+	if (res == 0) fprintf(stdout, "Renamed archive %s to '%s'.\n", 
+						  uuid, archive->name());
 	
 	delete archive;
 	return res;