summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r--apt-pkg/acquire-item.cc17
1 files changed, 6 insertions, 11 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index a108eb213..062b39cad 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -3265,19 +3265,14 @@ void pkgAcqIndex::StageDownloadDone(string const &Message)
// we need to verify the file against the current Release file again
// on if-modfied-since hit to avoid a stale attack against us
- if(StringToBool(LookupTag(Message,"IMS-Hit"),false) == true)
+ if (StringToBool(LookupTag(Message, "IMS-Hit"), false))
{
- // copy FinalFile into partial/ so that we check the hash again
- string const FinalFile = GetExistingFilename(GetFinalFileNameFromURI(Target.URI));
- 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
- {
- EraseFileName = DestFile;
- Filename = DestFile;
- }
+ Filename = GetExistingFilename(GetFinalFileNameFromURI(Target.URI));
+ EraseFileName = DestFile = flCombine(flNotFile(DestFile), flNotDir(Filename));
+ if (symlink(Filename.c_str(), DestFile.c_str()) != 0)
+ _error->WarningE("pkgAcqIndex::StageDownloadDone", "Symlinking file %s to %s failed", Filename.c_str(), DestFile.c_str());
Stage = STAGE_DECOMPRESS_AND_VERIFY;
- Desc.URI = "store:" + Filename;
+ Desc.URI = "store:" + DestFile;
QueueURI(Desc);
SetActiveSubprocess(::URI(Desc.URI).Access);
return;