Actually rename the updated repository to the target name.
This commit is contained in:
@@ -284,7 +284,7 @@ command_update(int argc, const char* const* argv)
|
|||||||
// create new repository
|
// create new repository
|
||||||
BRepositoryWriter repositoryWriter(&listener, &repositoryInfo);
|
BRepositoryWriter repositoryWriter(&listener, &repositoryInfo);
|
||||||
BString tempRepositoryFileName(targetRepositoryFileName);
|
BString tempRepositoryFileName(targetRepositoryFileName);
|
||||||
tempRepositoryFileName += ".new";
|
tempRepositoryFileName += ".___new___";
|
||||||
if ((result = repositoryWriter.Init(tempRepositoryFileName.String()))
|
if ((result = repositoryWriter.Init(tempRepositoryFileName.String()))
|
||||||
!= B_OK) {
|
!= B_OK) {
|
||||||
listener.PrintError("Error: can't initialize repository-writer : %s\n",
|
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)
|
if (result != B_OK)
|
||||||
return 1;
|
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) {
|
if (verbose) {
|
||||||
printf("\nsuccessfully created repository '%s'\n",
|
printf("\nsuccessfully created repository '%s'\n",
|
||||||
targetRepositoryFileName);
|
targetRepositoryFileName);
|
||||||
|
|||||||
Reference in New Issue
Block a user