[darwinbuild-changes] [785] branches/PR-7748469/darwinup

source_changes at macosforge.org source_changes at macosforge.org
Mon Mar 15 08:57:36 PDT 2010


Revision: 785
          http://trac.macosforge.org/projects/darwinbuild/changeset/785
Author:   wsiegrist at apple.com
Date:     2010-03-15 08:57:36 -0700 (Mon, 15 Mar 2010)
Log Message:
-----------
Be graceful when we cannot find update_dyld_shared_cache. Also, only update the cache after processing all args, instead of for each arg.

Modified Paths:
--------------
    branches/PR-7748469/darwinup/Utils.cpp
    branches/PR-7748469/darwinup/main.cpp

Modified: branches/PR-7748469/darwinup/Utils.cpp
===================================================================
--- branches/PR-7748469/darwinup/Utils.cpp	2010-03-15 06:46:24 UTC (rev 784)
+++ branches/PR-7748469/darwinup/Utils.cpp	2010-03-15 15:57:36 UTC (rev 785)
@@ -317,6 +317,12 @@
 	char* toolpath;
 	join_path(&toolpath, base, "/usr/bin/update_dyld_shared_cache");
 
+	struct stat sb;
+	res = stat(toolpath, &sb);
+	if (res) {
+		return 1;
+	}
+		
 	const char* args[] = {
 		toolpath,
 		"-root", base,

Modified: branches/PR-7748469/darwinup/main.cpp
===================================================================
--- branches/PR-7748469/darwinup/main.cpp	2010-03-15 06:46:24 UTC (rev 784)
+++ branches/PR-7748469/darwinup/main.cpp	2010-03-15 15:57:36 UTC (rev 785)
@@ -180,7 +180,6 @@
 			if (strcmp(argv[0], "install") == 0) {
 				if (i==1 && depot->initialize(true)) exit(13);
 				res = depot->install(argv[i]);
-				if (update_dyld && res == 0) res = update_dyld_shared_cache(path);
 			} else if (strcmp(argv[0], "upgrade") == 0) {
 				if (i==1 && depot->initialize(true)) exit(14);
 				// find most recent matching archive by name
@@ -193,14 +192,12 @@
 				if (res == 0) res = depot->install(argv[i]);
 				// uninstall old archive
 				if (res == 0) res = depot->uninstall(old);
-				if (update_dyld && res == 0) res = update_dyld_shared_cache(path);
 			} else if (strcmp(argv[0], "files") == 0) {
 				if (i==1 && depot->initialize(false)) exit(12);
 				res = depot->process_archive(argv[0], argv[i]);
 			} else if (strcmp(argv[0], "uninstall") == 0) {
 				if (i==1 && depot->initialize(true)) exit(15);
 				res = depot->process_archive(argv[0], argv[i]);
-				if (update_dyld && res == 0) res = update_dyld_shared_cache(path);
 			} else if (strcmp(argv[0], "verify") == 0) {
 				if (i==1 && depot->initialize(true)) exit(16);
 				res = depot->process_archive(argv[0], argv[i]);
@@ -208,6 +205,11 @@
 				usage(progname);
 			}
 		}
+		if (update_dyld && res == 0) {
+			res = update_dyld_shared_cache(path);
+			if (res) fprintf(stderr, "Warning: could not update dyld cache.\n");
+			res = 0;
+		}		
 	}
 	
 	free(path);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20100315/ab833253/attachment.html>


More information about the darwinbuild-changes mailing list