]> git.saurik.com Git - apt.git/blobdiff - methods/gzip.cc
add a way to add packages to generate a dists style environment without
[apt.git] / methods / gzip.cc
index 5b9b66b50375769f1d528b11c00d116c03e0841d..f1c76066e403810f7cbe4733d1c97aec0249bd1d 100644 (file)
@@ -48,12 +48,9 @@ bool GzipMethod::Fetch(FetchItem *Itm)
    // Open the source and destination files
    FileFd From(Path,FileFd::ReadOnlyGzip);
 
-   // if the file is empty, just rename it and return
-   if(From.Size() == 0) 
-   {
-      rename(Path.c_str(), Itm->DestFile.c_str());
-      return true;
-   }
+   // FIXME add an error message saying that empty files can't be valid archives
+   if(From.FileSize() == 0)
+      return false;
 
    FileFd To(Itm->DestFile,FileFd::WriteAtomic);   
    To.EraseOnFailure();