Revision: 427 http://trac.macosforge.org/projects/darwinbuild/changeset/427 Author: wsiegrist@apple.com Date: 2008-12-03 14:09:31 -0800 (Wed, 03 Dec 2008) Log Message: ----------- Expand protection of libSystem to the rest of the libraries used by gnutar Modified Paths: -------------- branches/PR-6392966/darwinup/Depot.cpp Modified: branches/PR-6392966/darwinup/Depot.cpp =================================================================== --- branches/PR-6392966/darwinup/Depot.cpp 2008-12-03 03:32:23 UTC (rev 426) +++ branches/PR-6392966/darwinup/Depot.cpp 2008-12-03 22:09:31 UTC (rev 427) @@ -423,9 +423,19 @@ // XXX: res = file->backup() - // Copy libSystem since it cannot be renamed safely - const char* libsystem = "/usr/lib/libSystem.B.dylib"; - if (strncmp(libsystem, file->path(), strlen(libsystem)) == 0) { + // Copy libraries gnutar uses since we need to use gnutar before they are replaced + int i = 0; + bool docopy = false; + const char* tarlibs[] = {"/usr/lib/libSystem.B.dylib", + "/usr/lib/libiconv.2.dylib", + "/usr/lib/libgcc_s.1.dylib"}; + for (i = 0; i < 3; i++) { + if (strncmp(tarlibs[i], file->path(), strlen(tarlibs[i])) == 0) { + docopy = true; + break; + } + } + if (docopy) { IF_DEBUG("[backup] copyfile(%s, %s)\n", file->path(), dstpath); res = copyfile(file->path(), dstpath, NULL, COPYFILE_ALL); } else {