diff --git a/src/bin/package_repo/command_update.cpp b/src/bin/package_repo/command_update.cpp index 3dccbb315b..dad62cce02 100644 --- a/src/bin/package_repo/command_update.cpp +++ b/src/bin/package_repo/command_update.cpp @@ -284,7 +284,7 @@ command_update(int argc, const char* const* argv) // create new repository BRepositoryWriter repositoryWriter(&listener, &repositoryInfo); BString tempRepositoryFileName(targetRepositoryFileName); - tempRepositoryFileName += ".new"; + tempRepositoryFileName += ".___new___"; if ((result = repositoryWriter.Init(tempRepositoryFileName.String())) != B_OK) { listener.PrintError("Error: can't initialize repository-writer : %s\n", @@ -358,6 +358,15 @@ command_update(int argc, const char* const* argv) if (result != B_OK) return 1; + result = BEntry(tempRepositoryFileName.String()).Rename( + targetRepositoryFileName, true); + if (result != B_OK) { + printf("Error: unable to rename repository %s to %s - %s\n", + tempRepositoryFileName.String(), targetRepositoryFileName, + strerror(result)); + return 1; + } + if (verbose) { printf("\nsuccessfully created repository '%s'\n", targetRepositoryFileName);