From 7092893bdd93d25da3a7f53b675a1130f51a03fd Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Thu, 19 Sep 2013 22:37:54 +0200 Subject: [PATCH] Actually rename the updated repository to the target name. --- src/bin/package_repo/command_update.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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);