]> git.saurik.com Git - apt.git/commitdiff
Symlinking final file failed is a common issue :/.
authorJay Freeman (saurik) <saurik@saurik.com>
Mon, 30 Jan 2017 19:11:45 +0000 (11:11 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 30 Jan 2017 19:11:45 +0000 (11:11 -0800)
apt-pkg/acquire-item.cc

index 12d0352075fdb5e6154b39ad09db14fbae7716ce..072a4c6e827ca9ffcd113a4ad6133e7ab1be6824 100644 (file)
@@ -3071,6 +3071,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