diff --git a/src/bin/package_repo/command_update.cpp b/src/bin/package_repo/command_update.cpp index 5da5772c53..3e06ee69cb 100644 --- a/src/bin/package_repo/command_update.cpp +++ b/src/bin/package_repo/command_update.cpp @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -312,6 +313,9 @@ command_update(int argc, const char* const* argv) return 1; } + BEntry tempRepositoryFile(tempRepositoryFileName.String()); + BPath targetRepositoryFilePath(targetRepositoryFileName); + BObjectList packageNames(100, true); if ((result = parsePackageListFile(packageListFileName, &packageNames)) != B_OK) { @@ -378,8 +382,7 @@ command_update(int argc, const char* const* argv) if (result != B_OK) return 1; - result = BEntry(tempRepositoryFileName.String()).Rename( - targetRepositoryFileName, true); + result = tempRepositoryFile.Rename(targetRepositoryFilePath.Leaf(), true); if (result != B_OK) { printf("Error: unable to rename repository %s to %s - %s\n", tempRepositoryFileName.String(), targetRepositoryFileName,