summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2017-01-30 11:11:45 -0800
committerSam Bingner <sam@bingner.com>2020-07-17 00:22:23 -1000
commit2af52cc582ad94945e264531739fe7889dae34d0 (patch)
treedaa1b6149f2323a62e8d3d6c46e65ecf178d60e7
parent1be6d864fbe18357cbabc214193474577164d2bb (diff)
Symlinking final file failed is a common issue :/.
-rw-r--r--apt-pkg/acquire-item.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 1f901e3b7..4ed8cc6ae 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -3276,6 +3276,7 @@ void pkgAcqIndex::StageDownloadDone(string const &Message)
// copy FinalFile into partial/ so that we check the hash again
string const FinalFile = GetExistingFilename(GetFinalFileNameFromURI(Target.URI));
DestFile = GetKeepCompressedFileName(GetPartialFileNameFromURI(Target.URI), Target);
+ unlink(DestFile.c_str());
if (symlink(FinalFile.c_str(), DestFile.c_str()) != 0)
_error->WarningE("pkgAcqIndex::StageDownloadDone", "Symlinking final file %s back to %s failed", FinalFile.c_str(), DestFile.c_str());
else