]> git.saurik.com Git - apt.git/blobdiff - methods/copy.cc
merged from lp:~mvo/apt/mvo
[apt.git] / methods / copy.cc
index 72896b4c076e77ce56086c6a3519770571d599c4..a6bb372a3754d9b8d72ee5f85f81b2ebf586904f 100644 (file)
@@ -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;
 }