X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/a3259857ed1ba6a5624c781e804f4c1a6bdb37aa..4bec02c237e8e218bc7d4bcf7142e0450480138b:/methods/copy.cc?ds=sidebyside 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; }