From: Michael Vogt Date: Mon, 15 Aug 2011 12:21:31 +0000 (+0200) Subject: merged from lp:~mvo/apt/mvo X-Git-Tag: 0.9.0~59 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/d0f1646ae06ca5710b015662b9244e277dce73fa?ds=inline;hp=-c merged from lp:~mvo/apt/mvo --- d0f1646ae06ca5710b015662b9244e277dce73fa diff --combined apt-pkg/acquire.cc index 34e2f5aac,06b0f11f8..8c00748b2 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@@ -116,7 -116,7 +116,7 @@@ pkgAcquire::~pkgAcquire( /* */ void pkgAcquire::Shutdown() { - while (Items.size() != 0) + while (Items.empty() == false) { if (Items[0]->Status == Item::StatFetching) Items[0]->Status = Item::StatError; @@@ -155,7 -155,7 +155,7 @@@ void pkgAcquire::Remove(Item *Itm I = Items.begin(); } else - I++; + ++I; } } /*}}}*/ @@@ -411,7 -411,7 +411,7 @@@ pkgAcquire::RunResult pkgAcquire::Run(i I->Shutdown(false); // Shut down the items - for (ItemIterator I = Items.begin(); I != Items.end(); I++) + for (ItemIterator I = Items.begin(); I != Items.end(); ++I) (*I)->Finished(); if (_error->PendingError()) @@@ -467,7 -467,7 +467,7 @@@ bool pkgAcquire::Clean(string Dir // Look in the get list ItemCIterator I = Items.begin(); - for (; I != Items.end(); I++) + for (; I != Items.end(); ++I) if (flNotDir((*I)->DestFile) == Dir->d_name) break; @@@ -488,7 -488,7 +488,7 @@@ unsigned long long pkgAcquire::TotalNeeded() { unsigned long long Total = 0; - for (ItemCIterator I = ItemsBegin(); I != ItemsEnd(); I++) + for (ItemCIterator I = ItemsBegin(); I != ItemsEnd(); ++I) Total += (*I)->FileSize; return Total; } @@@ -499,7 -499,7 +499,7 @@@ unsigned long long pkgAcquire::FetchNeeded() { unsigned long long Total = 0; - for (ItemCIterator I = ItemsBegin(); I != ItemsEnd(); I++) + for (ItemCIterator I = ItemsBegin(); I != ItemsEnd(); ++I) if ((*I)->Local == false) Total += (*I)->FileSize; return Total; @@@ -511,7 -511,7 +511,7 @@@ unsigned long long pkgAcquire::PartialPresent() { unsigned long long Total = 0; - for (ItemCIterator I = ItemsBegin(); I != ItemsEnd(); I++) + for (ItemCIterator I = ItemsBegin(); I != ItemsEnd(); ++I) if ((*I)->Local == false) Total += (*I)->PartialSize; return Total; @@@ -781,11 -781,11 +781,11 @@@ bool pkgAcquireStatus::Pulse(pkgAcquir unsigned int Unknown = 0; unsigned int Count = 0; for (pkgAcquire::ItemCIterator I = Owner->ItemsBegin(); I != Owner->ItemsEnd(); - I++, Count++) + ++I, ++Count) { TotalItems++; if ((*I)->Status == pkgAcquire::Item::StatDone) - CurrentItems++; + ++CurrentItems; // Totally ignore local items if ((*I)->Local == true) @@@ -795,7 -795,7 +795,7 @@@ if ((*I)->Complete == true) CurrentBytes += (*I)->FileSize; if ((*I)->FileSize == 0 && (*I)->Complete == false) - Unknown++; + ++Unknown; } // Compute the current completion @@@ -849,7 -849,9 +849,9 @@@ char msg[200]; long i = CurrentItems < TotalItems ? CurrentItems + 1 : CurrentItems; - unsigned long long const ETA = (TotalBytes - CurrentBytes) / CurrentCPS; + unsigned long long ETA = 0; + if(CurrentCPS > 0) + ETA = (TotalBytes - CurrentBytes) / CurrentCPS; // only show the ETA if it makes sense if (ETA > 0 && ETA < 172800 /* two days */ ) diff --combined debian/changelog index 000459c5c,3d9bdb31f..3c40d13c0 --- a/debian/changelog +++ b/debian/changelog @@@ -1,6 -1,5 +1,6 @@@ --apt (0.8.16~exp5) experimental; urgency=low ++apt (0.8.16~exp5) UNRELEASEDexperimental; urgency=low + * merged the latest debian-sid fixes * apt-pkg/makefile: - install sha256.h compat header * apt-pkg/pkgcachegen.{cc,h}: @@@ -11,6 -10,11 +11,11 @@@ * apt-pkg/acquire-item.{cc,h}: - do not check for a "Package" tag in optional index targets like the translations index + * apt-pkg/acquire.cc: + - fix potential divide-by-zero + * methods/mirror.cc: + - include the architecture(s) in the query string as well so + that the server can make better decisions -- Michael Vogt Fri, 05 Aug 2011 10:57:08 +0200 @@@ -110,9 -114,8 +115,9 @@@ apt (0.8.16~exp1) experimental; urgency -- Michael Vogt Wed, 29 Jun 2011 12:40:31 +0200 -apt (0.8.15.5.6) UNRELEASED; urgency=low +apt (0.8.15.6) unstable; urgency=low + [ Michael Vogt ] * apt-pkg/contrib/fileutl.{cc,h}: - add GetModificationTime() helper * apt-pkg/pkgcachegen.cc: @@@ -130,11 -133,8 +135,11 @@@ * apt-pkg/acquire-item.cc: - if no Release.gpg file is found, still load the hashes for verification (closes: #636314) and add test + + [ David Kalnischkies ] + * lots of cppcheck fixes - -- Michael Vogt Tue, 12 Jul 2011 11:54:47 +0200 + -- Michael Vogt Mon, 15 Aug 2011 09:20:35 +0200 apt (0.8.15.5) unstable; urgency=low diff --combined methods/mirror.cc index cb24a06cf,7f28c04cb..a3e60ab15 --- a/methods/mirror.cc +++ b/methods/mirror.cc @@@ -8,6 -8,7 +8,7 @@@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ + #include #include #include #include @@@ -54,7 -55,7 +55,7 @@@ using namespace std */ MirrorMethod::MirrorMethod() - : HttpMethod(), DownloadedMirrorFile(false) + : HttpMethod(), DownloadedMirrorFile(false), Debug(false) { }; @@@ -107,7 -108,7 +108,7 @@@ bool MirrorMethod::Clean(string Dir continue; // see if we have that uri - for(I=list.begin(); I != list.end(); I++) + for(I=list.begin(); I != list.end(); ++I) { string uri = (*I)->GetURI(); if(uri.find("mirror://") != 0) @@@ -134,9 -135,24 +135,24 @@@ bool MirrorMethod::DownloadMirrorFile(s string fetch = BaseUri; fetch.replace(0,strlen("mirror://"),"http://"); + #if 0 // no need for this, the getArchitectures() will also include the main + // arch + // append main architecture + fetch += "?arch=" + _config->Find("Apt::Architecture"); + #endif + + // append all architectures + std::vector vec = APT::Configuration::getArchitectures(); + for (std::vector::const_iterator I = vec.begin(); + I != vec.end(); I++) + if (I == vec.begin()) + fetch += "?arch" + (*I); + else + fetch += "&arch=" + (*I); + // append the dist as a query string if (Dist != "") - fetch += "?dist=" + Dist; + fetch += "&dist=" + Dist; if(Debug) clog << "MirrorMethod::DownloadMirrorFile(): '" << fetch << "'" @@@ -330,7 -346,7 +346,7 @@@ string MirrorMethod::GetMirrorFileName( vector::const_iterator I; pkgSourceList list; list.ReadMainList(); - for(I=list.begin(); I != list.end(); I++) + for(I=list.begin(); I != list.end(); ++I) { string uristr = (*I)->GetURI(); if(Debug)