From: Michael Vogt Date: Mon, 15 Aug 2011 07:23:39 +0000 (+0200) Subject: merged fixes from lp:~mvo/apt/mvo X-Git-Tag: 0.8.15.6~1 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/a288748e481c707127b416439407eb613cd12a8a?hp=-c merged fixes from lp:~mvo/apt/mvo --- a288748e481c707127b416439407eb613cd12a8a diff --combined apt-pkg/acquire-item.cc index 2a514b088,d4b451d5b..566f51606 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@@ -681,17 -681,17 +681,17 @@@ bool pkgAcqIndexDiffs::QueueNextDiff( // remove all patches until the next matching patch is found // this requires the Index file to be ordered for(vector::iterator I=available_patches.begin(); - available_patches.size() > 0 && + available_patches.empty() == false && I != available_patches.end() && - (*I).sha1 != local_sha1; - I++) + I->sha1 != local_sha1; + ++I) { available_patches.erase(I); } // error checking and falling back if no patch was found - if(available_patches.size() == 0) - { + if(available_patches.empty() == true) + { Failed("", NULL); return false; } @@@ -756,7 -756,7 +756,7 @@@ void pkgAcqIndexDiffs::Done(string Mess chmod(FinalFile.c_str(),0644); // see if there is more to download - if(available_patches.size() > 0) { + if(available_patches.empty() == false) { new pkgAcqIndexDiffs(Owner, RealURI, Description, Desc.ShortDesc, ExpectedHash, ServerSha1, available_patches); return Finish(); @@@ -1375,7 -1375,7 +1375,7 @@@ void pkgAcqMetaIndex::QueueIndexes(boo #endif for (vector ::const_iterator Target = IndexTargets->begin(); Target != IndexTargets->end(); - Target++) + ++Target) { HashString ExpectedIndexHash; if (verify) @@@ -1397,6 -1397,7 +1397,7 @@@ { std::cerr << "Queueing: " << (*Target)->URI << std::endl; std::cerr << "Expected Hash: " << ExpectedIndexHash.toStr() << std::endl; + std::cerr << "For: " << Record->MetaKeyFilename << std::endl; } if (ExpectedIndexHash.empty() == true && (*Target)->IsOptional() == false) { @@@ -1672,7 -1673,7 +1673,7 @@@ pkgAcqArchive::pkgAcqArchive(pkgAcquir // check if we have one trusted source for the package. if so, switch // to "TrustedOnly" mode - for (pkgCache::VerFileIterator i = Version.FileList(); i.end() == false; i++) + for (pkgCache::VerFileIterator i = Version.FileList(); i.end() == false; ++i) { pkgIndexFile *Index; if (Sources->FindIndex(i.File(),Index) == false) @@@ -1709,7 -1710,7 +1710,7 @@@ bool pkgAcqArchive::QueueNext() { string const ForceHash = _config->Find("Acquire::ForceHash"); - for (; Vf.end() == false; Vf++) + for (; Vf.end() == false; ++Vf) { // Ignore not source sources if ((Vf.File()->Flags & pkgCache::Flag::NotSource) != 0) @@@ -1820,7 -1821,7 +1821,7 @@@ Desc.ShortDesc = Version.ParentPkg().Name(); QueueURI(Desc); - Vf++; + ++Vf; return true; } return false; @@@ -1894,7 -1895,7 +1895,7 @@@ void pkgAcqArchive::Failed(string Messa StringToBool(LookupTag(Message,"Transient-Failure"),false) == true) { // Vf = Version.FileList(); - while (Vf.end() == false) Vf++; + while (Vf.end() == false) ++Vf; StoreFilename = string(); Item::Failed(Message,Cnf); return; diff --combined apt-pkg/pkgcachegen.cc index 8a7c1e979,7539e1b94..dc5a830bd --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@@ -220,7 -220,7 +220,7 @@@ bool pkgCacheGenerator::MergeList(ListP // don't add a new description if we have one for the given // md5 && language - for ( ; Desc.end() == false; Desc++) + for ( ; Desc.end() == false; ++Desc) if (MD5SumValue(Desc.md5()) == CurMd5 && Desc.LanguageCode() == List.DescriptionLanguage()) duplicate=true; @@@ -229,7 -229,7 +229,7 @@@ for (Desc = Ver.DescriptionList(); Desc.end() == false; - LastDesc = &Desc->NextDesc, Desc++) + LastDesc = &Desc->NextDesc, ++Desc) { if (MD5SumValue(Desc.md5()) == CurMd5) { @@@ -395,7 -395,7 +395,7 @@@ bool pkgCacheGenerator::MergeFileProvid unsigned long Hash = List.VersionHash(); pkgCache::VerIterator Ver = Pkg.VersionList(); Dynamic DynVer(Ver); - for (; Ver.end() == false; Ver++) + for (; Ver.end() == false; ++Ver) { if (Ver->Hash == Hash && Version.c_str() == Ver.VerStr()) { @@@ -511,7 -511,7 +511,7 @@@ bool pkgCacheGenerator::NewFileVer(pkgC // Link it to the end of the list map_ptrloc *Last = &Ver->FileList; - for (pkgCache::VerFileIterator V = Ver.FileList(); V.end() == false; V++) + for (pkgCache::VerFileIterator V = Ver.FileList(); V.end() == false; ++V) Last = &V->NextFile; VF->NextFile = *Last; *Last = VF.Index(); @@@ -568,7 -568,7 +568,7 @@@ bool pkgCacheGenerator::NewFileDesc(pkg // Link it to the end of the list map_ptrloc *Last = &Desc->FileList; - for (pkgCache::DescFileIterator D = Desc.FileList(); D.end() == false; D++) + for (pkgCache::DescFileIterator D = Desc.FileList(); D.end() == false; ++D) Last = &D->NextFile; DF->NextFile = *Last; @@@ -623,7 -623,7 +623,7 @@@ bool pkgCacheGenerator::FinishCache(OpP // Create Conflicts in between the group pkgCache::GrpIterator G = GetCache().GrpBegin(); Dynamic DynG(G); - for (; G.end() != true; G++) + for (; G.end() != true; ++G) { string const PkgName = G.Name(); pkgCache::PkgIterator P = G.PackageList(); @@@ -634,7 -634,7 +634,7 @@@ Dynamic DynallPkg(allPkg); pkgCache::VerIterator V = P.VersionList(); Dynamic DynV(V); - for (; V.end() != true; V++) + for (; V.end() != true; ++V) { // copy P.Arch() into a string here as a cache remap // in NewDepends() later may alter the pointer location @@@ -728,7 -728,7 +728,7 @@@ bool pkgCacheGenerator::NewDepends(pkgC if (OldDepLast == NULL) { OldDepLast = &Ver->DependsList; - for (pkgCache::DepIterator D = Ver.DependsList(); D.end() == false; D++) + for (pkgCache::DepIterator D = Ver.DependsList(); D.end() == false; ++D) OldDepLast = &D->NextDepends; } else if (oldMap != Map.Data()) OldDepLast += (map_ptrloc*) Map.Data() - (map_ptrloc*) oldMap; @@@ -935,7 -935,7 +935,7 @@@ static bool CheckValidity(const string return false; } - if (List.GetLastModifiedTime() < GetModificationTime(CacheFile)) + if (List.GetLastModifiedTime() > GetModificationTime(CacheFile)) { if (Debug == true) std::clog << "sources.list is newer than the cache" << std::endl; @@@ -958,7 -958,7 +958,7 @@@ verify the IMS data and check that it is on the disk too.. */ SPtrArray Visited = new bool[Cache.HeaderP->PackageFileCount]; memset(Visited,0,sizeof(*Visited)*Cache.HeaderP->PackageFileCount); - for (; Start != End; Start++) + for (; Start != End; ++Start) { if (Debug == true) std::clog << "Checking PkgFile " << (*Start)->Describe() << ": "; @@@ -1025,7 -1025,7 +1025,7 @@@ static unsigned long ComputeSize(FileIterator Start,FileIterator End) { unsigned long TotalSize = 0; - for (; Start != End; Start++) + for (; Start != End; ++Start) { if ((*Start)->HasPackages() == false) continue; @@@ -1043,7 -1043,7 +1043,7 @@@ static bool BuildCache(pkgCacheGenerato FileIterator Start, FileIterator End) { FileIterator I; - for (I = Start; I != End; I++) + for (I = Start; I != End; ++I) { if ((*I)->HasPackages() == false) continue; @@@ -1073,7 -1073,7 +1073,7 @@@ Progress->Done(); TotalSize = ComputeSize(Start, End); CurrentSize = 0; - for (I = Start; I != End; I++) + for (I = Start; I != End; ++I) { unsigned long Size = (*I)->Size(); if (Progress != NULL) @@@ -1120,12 -1120,12 +1120,12 @@@ bool pkgCacheGenerator::MakeStatusCache vector Files; for (vector::const_iterator i = List.begin(); i != List.end(); - i++) + ++i) { vector *Indexes = (*i)->GetIndexFiles(); for (vector::const_iterator j = Indexes->begin(); j != Indexes->end(); - j++) + ++j) Files.push_back (*j); }