X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/6ca714d55119e87a01bd475abd08e7212dcafbd0..859110cdec2f211beb45305134d095fd8926d552:/apt-pkg/acquire-item.cc diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 020047c06..1b9120586 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -13,9 +13,6 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#ifdef __GNUG__ -#pragma implementation "apt-pkg/acquire-item.h" -#endif #include #include #include @@ -78,7 +75,7 @@ void pkgAcquire::Item::Failed(string Message,pkgAcquire::MethodConfig *Cnf) Dequeue(); return; } - + Status = StatError; Dequeue(); } @@ -274,9 +271,9 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string IndexDiffFile) if(found) { // queue the diffs - int last_space = Description.rfind(" "); - if(last_space != string::npos) - Description.erase(last_space, Description.size()-last_space); + int last_space = Description.rfind(" "); + if(last_space != string::npos) + Description.erase(last_space, Description.size()-last_space); new pkgAcqIndexDiffs(Owner, RealURI, Description, Desc.ShortDesc, ExpectedMD5, available_patches); Complete = false; @@ -285,7 +282,7 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string IndexDiffFile) return true; } } - + // Nothing found, report and return false // Failing here is ok, if we return false later, the full // IndexFile is queued @@ -467,7 +464,6 @@ bool pkgAcqIndexDiffs::QueueNextDiff() // queue the right diff Desc.URI = string(RealURI) + ".diff/" + available_patches[0].file + ".gz"; Desc.Description = Description + " " + available_patches[0].file + string(".pdiff"); - DestFile = _config->FindDir("Dir::State::lists") + "partial/"; DestFile += URItoFileName(RealURI + ".diff/" + available_patches[0].file); @@ -617,9 +613,15 @@ void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf) Complete = false; Dequeue(); return; + } + + // on decompression failure, remove bad versions in partial/ + if(Decompression && Erase) { + string s = _config->FindDir("Dir::State::lists") + "partial/"; + s += URItoFileName(RealURI); + unlink(s.c_str()); } - Item::Failed(Message,Cnf); } @@ -848,7 +850,7 @@ void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf) if(Status == StatTransientNetworkError) { Item::Failed(Message,Cnf); - // move the sigfile back on network failures (and re-authenticated?) + // move the sigfile back on transient network failures if(FileExists(DestFile)) Rename(DestFile,Final);