X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/d4db3e0afce3492d75ab2226393f93e58b0fbfde..2e3c9d6452e69dcb5c83732fbda27b747bc997f4:/methods/copy.cc diff --git a/methods/copy.cc b/methods/copy.cc index 72896b4c0..a6bb372a3 100644 --- a/methods/copy.cc +++ b/methods/copy.cc @@ -52,7 +52,7 @@ bool CopyMethod::Fetch(FetchItem *Itm) // See if the file exists FileFd From(File,FileFd::ReadOnly); - FileFd To(Itm->DestFile,FileFd::WriteEmpty); + FileFd To(Itm->DestFile,FileFd::WriteAtomic); To.EraseOnFailure(); if (_error->PendingError() == true) { @@ -84,6 +84,7 @@ bool CopyMethod::Fetch(FetchItem *Itm) FileFd Fd(Res.Filename, FileFd::ReadOnly); Hash.AddFD(Fd.Fd(), Fd.Size()); Res.TakeHashes(Hash); + URIDone(Res); return true; }