summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/acquire-item.cc28
-rw-r--r--apt-pkg/acquire-method.cc10
-rw-r--r--apt-pkg/acquire.cc20
-rw-r--r--apt-pkg/algorithms.cc62
-rw-r--r--apt-pkg/aptconfiguration.cc4
-rw-r--r--apt-pkg/aptconfiguration.h3
-rw-r--r--apt-pkg/cdrom.cc26
-rw-r--r--apt-pkg/clean.cc4
-rw-r--r--apt-pkg/contrib/configuration.cc6
-rw-r--r--apt-pkg/contrib/error.cc6
-rw-r--r--apt-pkg/contrib/netrc.cc7
-rw-r--r--apt-pkg/contrib/strutl.cc30
-rw-r--r--apt-pkg/deb/debindexfile.cc6
-rw-r--r--apt-pkg/deb/deblistparser.cc2
-rw-r--r--apt-pkg/deb/debmetaindex.cc12
-rw-r--r--apt-pkg/deb/debrecords.cc2
-rw-r--r--apt-pkg/deb/dpkgpm.cc20
-rw-r--r--apt-pkg/depcache.cc28
-rw-r--r--apt-pkg/depcache.h4
-rw-r--r--apt-pkg/indexcopy.cc21
-rw-r--r--apt-pkg/indexfile.cc3
-rw-r--r--apt-pkg/orderlist.cc26
-rw-r--r--apt-pkg/packagemanager.cc32
-rw-r--r--apt-pkg/pkgcache.cc26
-rw-r--r--apt-pkg/pkgcachegen.cc30
-rw-r--r--apt-pkg/pkgrecords.cc2
-rw-r--r--apt-pkg/policy.cc14
-rw-r--r--apt-pkg/sourcelist.cc14
-rw-r--r--apt-pkg/srcrecords.cc10
-rw-r--r--apt-pkg/tagfile.h2
-rw-r--r--apt-pkg/vendorlist.cc6
-rw-r--r--apt-pkg/versionmatch.cc6
-rw-r--r--cmdline/apt-cache.cc104
-rw-r--r--cmdline/apt-get.cc58
-rw-r--r--cmdline/apt-sortpkgs.cc2
-rw-r--r--debian/changelog27
-rw-r--r--ftparchive/apt-ftparchive.cc16
-rw-r--r--ftparchive/multicompress.cc8
-rw-r--r--ftparchive/override.cc6
-rw-r--r--ftparchive/writer.cc4
-rw-r--r--methods/cdrom.cc3
-rw-r--r--methods/ftp.cc5
-rw-r--r--methods/gpgv.cc6
-rw-r--r--methods/http.cc6
-rw-r--r--methods/http.h14
-rw-r--r--methods/mirror.cc6
-rw-r--r--methods/rred.cc7
-rw-r--r--methods/rsh.h2
-rw-r--r--test/integration/Packages-hashsum-verification18
-rwxr-xr-xtest/integration/test-hashsum-verification83
-rw-r--r--test/libapt/assert.h8
-rw-r--r--test/libapt/getarchitectures_test.cc7
-rw-r--r--test/libapt/getlanguages_test.cc7
-rw-r--r--test/libapt/getlistoffilesindir_test.cc7
-rw-r--r--test/test_udevcdrom.cc2
55 files changed, 498 insertions, 380 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index d8fa1f828..223303ea8 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -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<DiffInfo>::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 @@ void pkgAcqIndexDiffs::Done(string Message,unsigned long long Size,string Md5Has
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();
@@ -1266,8 +1266,9 @@ void pkgAcqMetaIndex::Done(string Message,unsigned long long Size,string Hash, /
if (SigFile == "")
{
// There was no signature file, so we are finished. Download
- // the indexes without verification.
- QueueIndexes(false);
+ // the indexes and do only hashsum verification
+ MetaIndexParser->Load(DestFile);
+ QueueIndexes(true);
}
else
{
@@ -1382,7 +1383,7 @@ void pkgAcqMetaIndex::QueueIndexes(bool verify) /*{{{*/
#endif
for (vector <struct IndexTarget*>::const_iterator Target = IndexTargets->begin();
Target != IndexTargets->end();
- Target++)
+ ++Target)
{
HashString ExpectedIndexHash;
if (verify)
@@ -1404,6 +1405,7 @@ void pkgAcqMetaIndex::QueueIndexes(bool verify) /*{{{*/
{
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)
{
@@ -1679,7 +1681,7 @@ pkgAcqArchive::pkgAcqArchive(pkgAcquire *Owner,pkgSourceList *Sources,
// 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)
@@ -1716,7 +1718,7 @@ pkgAcqArchive::pkgAcqArchive(pkgAcquire *Owner,pkgSourceList *Sources,
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)
@@ -1831,7 +1833,7 @@ bool pkgAcqArchive::QueueNext()
Desc.ShortDesc = Version.ParentPkg().Name();
QueueURI(Desc);
- Vf++;
+ ++Vf;
return true;
}
return false;
@@ -1905,7 +1907,7 @@ void pkgAcqArchive::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
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 --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc
index 8c353beb2..25c6c674d 100644
--- a/apt-pkg/acquire-method.cc
+++ b/apt-pkg/acquire-method.cc
@@ -81,7 +81,7 @@ void pkgAcqMethod::Fail(bool Transient)
void pkgAcqMethod::Fail(string Err,bool Transient)
{
// Strip out junk from the error messages
- for (string::iterator I = Err.begin(); I != Err.end(); I++)
+ for (string::iterator I = Err.begin(); I != Err.end(); ++I)
{
if (*I == '\r')
*I = ' ';
@@ -425,12 +425,8 @@ void pkgAcqMethod::Status(const char *Format,...)
to keep the pipeline synchronized. */
void pkgAcqMethod::Redirect(const string &NewURI)
{
- std::cout << "103 Redirect\nURI: ";
- if (Queue != 0)
- std::cout << Queue->Uri << "\n";
- else
- std::cout << "<UNKNOWN>\n";
- std::cout << "New-URI: " << NewURI << "\n"
+ std::cout << "103 Redirect\nURI: " << Queue->Uri << "\n"
+ << "New-URI: " << NewURI << "\n"
<< "\n" << std::flush;
// Change the URI for the request.
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index 2064abc50..34e2f5aac 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -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 @@ void pkgAcquire::Remove(Item *Itm)
I = Items.begin();
}
else
- I++;
+ ++I;
}
}
/*}}}*/
@@ -411,7 +411,7 @@ pkgAcquire::RunResult pkgAcquire::Run(int PulseIntervall)
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 @@ 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 @@ bool pkgAcquire::Clean(string Dir)
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 @@ unsigned long long pkgAcquire::TotalNeeded()
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 @@ unsigned long long pkgAcquire::FetchNeeded()
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 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner)
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 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner)
if ((*I)->Complete == true)
CurrentBytes += (*I)->FileSize;
if ((*I)->FileSize == 0 && (*I)->Complete == false)
- Unknown++;
+ ++Unknown;
}
// Compute the current completion
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc
index 8737c5334..08d1f8cb7 100644
--- a/apt-pkg/algorithms.cc
+++ b/apt-pkg/algorithms.cc
@@ -94,7 +94,7 @@ bool pkgSimulate::Install(PkgIterator iPkg,string /*File*/)
Sim.MarkInstall(Pkg,false);
// Look for broken conflicts+predepends.
- for (PkgIterator I = Sim.PkgBegin(); I.end() == false; I++)
+ for (PkgIterator I = Sim.PkgBegin(); I.end() == false; ++I)
{
if (Sim[I].InstallVer == 0)
continue;
@@ -143,7 +143,7 @@ bool pkgSimulate::Configure(PkgIterator iPkg)
Sim.Update();
// Print out each package and the failed dependencies
- for (pkgCache::DepIterator D = Sim[Pkg].InstVerIter(Sim).DependsList(); D.end() == false; D++)
+ for (pkgCache::DepIterator D = Sim[Pkg].InstVerIter(Sim).DependsList(); D.end() == false; ++D)
{
if (Sim.IsImportantDep(D) == false ||
(Sim[D] & pkgDepCache::DepInstall) != 0)
@@ -207,7 +207,7 @@ bool pkgSimulate::Remove(PkgIterator iPkg,bool Purge)
void pkgSimulate::ShortBreaks()
{
cout << " [";
- for (PkgIterator I = Sim.PkgBegin(); I.end() == false; I++)
+ for (PkgIterator I = Sim.PkgBegin(); I.end() == false; ++I)
{
if (Sim[I].InstBroken() == true)
{
@@ -229,7 +229,7 @@ bool pkgApplyStatus(pkgDepCache &Cache)
{
pkgDepCache::ActionGroup group(Cache);
- for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
{
if (I->VersionList == 0)
continue;
@@ -298,13 +298,13 @@ bool pkgFixBroken(pkgDepCache &Cache)
pkgDepCache::ActionGroup group(Cache);
// Auto upgrade all broken packages
- for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
if (Cache[I].NowBroken() == true)
Cache.MarkInstall(I, true, 0, false);
/* Fix packages that are in a NeedArchive state but don't have a
downloadable install version */
- for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
{
if (I.State() != pkgCache::PkgIterator::NeedsUnpack ||
Cache[I].Delete() == true)
@@ -347,19 +347,19 @@ bool pkgDistUpgrade(pkgDepCache &Cache)
/* Auto upgrade all installed packages, this provides the basis
for the installation */
- for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
if (I->CurrentVer != 0)
Cache.MarkInstall(I, true, 0, false);
/* Now, auto upgrade all essential packages - this ensures that
the essential packages are present and working */
- for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
if ((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential)
Cache.MarkInstall(I, true, 0, false);
/* We do it again over all previously installed packages to force
conflict resolution on them all. */
- for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
if (I->CurrentVer != 0)
Cache.MarkInstall(I, false, 0, false);
@@ -368,7 +368,7 @@ bool pkgDistUpgrade(pkgDepCache &Cache)
// Hold back held packages.
if (_config->FindB("APT::Ignore-Hold",false) == false)
{
- for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
{
if (I->SelectedState == pkgCache::State::Hold)
{
@@ -402,7 +402,7 @@ bool pkgAllUpgrade(pkgDepCache &Cache)
return false;
// Upgrade all installed packages
- for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
{
if (Cache[I].Install() == true)
Fix.Protect(I);
@@ -436,7 +436,7 @@ bool pkgMinimizeUpgrade(pkgDepCache &Cache)
do
{
Change = false;
- for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
{
// Not interesting
if (Cache[I].Upgrade() == false || Cache[I].NewInstall() == true)
@@ -453,7 +453,7 @@ bool pkgMinimizeUpgrade(pkgDepCache &Cache)
Change = true;
}
}
- Count++;
+ ++Count;
}
while (Change == true && Count < 10);
@@ -540,7 +540,7 @@ void pkgProblemResolver::MakeScores()
<< " AddEssential => " << AddEssential << endl;
// Generate the base scores for a package based on its properties
- for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
{
if (Cache[I].InstallVer == 0)
continue;
@@ -567,12 +567,12 @@ void pkgProblemResolver::MakeScores()
}
// Now that we have the base scores we go and propogate dependencies
- for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
{
if (Cache[I].InstallVer == 0)
continue;
- for (pkgCache::DepIterator D = Cache[I].InstVerIter(Cache).DependsList(); D.end() == false; D++)
+ for (pkgCache::DepIterator D = Cache[I].InstVerIter(Cache).DependsList(); D.end() == false; ++D)
{
if (D->Type == pkgCache::Dep::Depends ||
D->Type == pkgCache::Dep::PreDepends)
@@ -589,12 +589,12 @@ void pkgProblemResolver::MakeScores()
/* Now we cause 1 level of dependency inheritance, that is we add the
score of the packages that depend on the target Package. This
fortifies high scoring packages */
- for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
{
if (Cache[I].InstallVer == 0)
continue;
- for (pkgCache::DepIterator D = I.RevDependsList(); D.end() == false; D++)
+ for (pkgCache::DepIterator D = I.RevDependsList(); D.end() == false; ++D)
{
// Only do it for the install version
if ((pkgCache::Version *)D.ParentVer() != Cache[D.ParentPkg()].InstallVer ||
@@ -609,9 +609,9 @@ void pkgProblemResolver::MakeScores()
/* Now we propogate along provides. This makes the packages that
provide important packages extremely important */
- for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
{
- for (pkgCache::PrvIterator P = I.ProvidesList(); P.end() == false; P++)
+ for (pkgCache::PrvIterator P = I.ProvidesList(); P.end() == false; ++P)
{
// Only do it once per package
if ((pkgCache::Version *)P.OwnerVer() != Cache[P.OwnerPkg()].InstallVer)
@@ -622,7 +622,7 @@ void pkgProblemResolver::MakeScores()
/* Protected things are pushed really high up. This number should put them
ahead of everything */
- for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
{
if ((Flags[I->ID] & Protected) != 0)
Scores[I->ID] += AddProtected;
@@ -719,7 +719,7 @@ bool pkgProblemResolver::DoUpgrade(pkgCache::PkgIterator Pkg)
if (Start == End)
break;
- Start++;
+ ++Start;
}
if (Fail == true)
break;
@@ -776,7 +776,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
do
{
Again = false;
- for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
{
if (Cache[I].Install() == true)
Flags[I->ID] |= PreInstalled;
@@ -809,7 +809,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
would cause the removal of even lower score packages. */
SPtrArray<pkgCache::Package *> PList = new pkgCache::Package *[Size];
pkgCache::Package **PEnd = PList;
- for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
*PEnd++ = I;
This = this;
qsort(PList,PEnd - PList,sizeof(*PList),&ScoreSort);
@@ -929,7 +929,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
}
else
{
- Start++;
+ ++Start;
// We only worry about critical deps.
if (Start.IsCritical() != true)
continue;
@@ -1178,7 +1178,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
{
// See if this is the result of a hold
pkgCache::PkgIterator I = Cache.PkgBegin();
- for (;I.end() != true; I++)
+ for (;I.end() != true; ++I)
{
if (Cache[I].InstBroken() == false)
continue;
@@ -1190,7 +1190,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
// set the auto-flags (mvo: I'm not sure if we _really_ need this)
pkgCache::PkgIterator I = Cache.PkgBegin();
- for (;I.end() != true; I++) {
+ for (;I.end() != true; ++I) {
if (Cache[I].NewInstall() && !(Flags[I->ID] & PreInstalled)) {
if(_config->FindI("Debug::pkgAutoRemove",false)) {
std::clog << "Resolve installed new pkg: " << I.FullName(false)
@@ -1263,7 +1263,7 @@ bool pkgProblemResolver::ResolveByKeepInternal()
would cause the removal of even lower score packages. */
pkgCache::Package **PList = new pkgCache::Package *[Size];
pkgCache::Package **PEnd = PList;
- for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
*PEnd++ = I;
This = this;
qsort(PList,PEnd - PList,sizeof(*PList),&ScoreSort);
@@ -1360,7 +1360,7 @@ bool pkgProblemResolver::ResolveByKeepInternal()
if (Start == End)
break;
- Start++;
+ ++Start;
}
if (InstOrNewPolicyBroken(I) == false)
@@ -1387,7 +1387,7 @@ void pkgProblemResolver::InstallProtect()
{
pkgDepCache::ActionGroup group(Cache);
- for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
{
if ((Flags[I->ID] & Protected) == Protected)
{
@@ -1467,7 +1467,7 @@ bool ListUpdate(pkgAcquireStatus &Stat,
bool Failed = false;
bool TransientNetworkFailure = false;
for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin();
- I != Fetcher.ItemsEnd(); I++)
+ I != Fetcher.ItemsEnd(); ++I)
{
if ((*I)->Status == pkgAcquire::Item::StatDone)
continue;
diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc
index 9ccbeecf1..6ec5fa03a 100644
--- a/apt-pkg/aptconfiguration.cc
+++ b/apt-pkg/aptconfiguration.cc
@@ -53,7 +53,7 @@ const Configuration::getCompressionTypes(bool const &Cached) {
// load the order setting into our vector
std::vector<std::string> const order = _config->FindVector("Acquire::CompressionTypes::Order");
for (std::vector<std::string>::const_iterator o = order.begin();
- o != order.end(); o++) {
+ o != order.end(); ++o) {
if ((*o).empty() == true)
continue;
// ignore types we have no method ready to use
@@ -274,7 +274,7 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All,
// then needed and ensure the codes are not listed twice.
bool noneSeen = false;
for (std::vector<string>::const_iterator l = lang.begin();
- l != lang.end(); l++) {
+ l != lang.end(); ++l) {
if (*l == "environment") {
for (std::vector<string>::const_iterator e = environment.begin();
e != environment.end(); ++e) {
diff --git a/apt-pkg/aptconfiguration.h b/apt-pkg/aptconfiguration.h
index 1f0399dd2..e098d0fd6 100644
--- a/apt-pkg/aptconfiguration.h
+++ b/apt-pkg/aptconfiguration.h
@@ -13,6 +13,7 @@
// Include Files /*{{{*/
#include <string>
#include <vector>
+#include <limits>
/*}}}*/
namespace APT {
class Configuration { /*{{{*/
@@ -94,7 +95,7 @@ public: /*{{{*/
Compressor(char const *name, char const *extension, char const *binary,
char const *compressArg, char const *uncompressArg,
unsigned short const cost);
- Compressor() {};
+ Compressor() : Cost(std::numeric_limits<unsigned short>::max()) {};
};
/** \brief Return a vector of Compressors supported for data.tar's
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc
index 0ad1c69e5..df1ffedf2 100644
--- a/apt-pkg/cdrom.cc
+++ b/apt-pkg/cdrom.cc
@@ -310,7 +310,7 @@ void pkgCdrom::ReduceSourcelist(string CD,vector<string> &List)
sort(List.begin(),List.end());
// Collect similar entries
- for (vector<string>::iterator I = List.begin(); I != List.end(); I++)
+ for (vector<string>::iterator I = List.begin(); I != List.end(); ++I)
{
// Find a space..
string::size_type Space = (*I).find(' ');
@@ -322,7 +322,7 @@ void pkgCdrom::ReduceSourcelist(string CD,vector<string> &List)
string Word1 = string(*I,Space,SSpace-Space);
string Prefix = string(*I,0,Space);
- for (vector<string>::iterator J = List.begin(); J != I; J++)
+ for (vector<string>::iterator J = List.begin(); J != I; ++J)
{
// Find a space..
string::size_type Space2 = (*J).find(' ');
@@ -405,7 +405,7 @@ bool pkgCdrom::WriteDatabase(Configuration &Cnf)
that were the same. */
bool pkgCdrom::WriteSourceList(string Name,vector<string> &List,bool Source)
{
- if (List.size() == 0)
+ if (List.empty() == true)
return true;
string File = _config->FindFile("Dir::Etc::sourcelist");
@@ -455,7 +455,7 @@ bool pkgCdrom::WriteSourceList(string Name,vector<string> &List,bool Source)
if (First == true)
{
- for (vector<string>::iterator I = List.begin(); I != List.end(); I++)
+ for (vector<string>::iterator I = List.begin(); I != List.end(); ++I)
{
string::size_type Space = (*I).find(' ');
if (Space == string::npos)
@@ -489,7 +489,7 @@ bool pkgCdrom::WriteSourceList(string Name,vector<string> &List,bool Source)
// Just in case the file was empty
if (First == true)
{
- for (vector<string>::iterator I = List.begin(); I != List.end(); I++)
+ for (vector<string>::iterator I = List.begin(); I != List.end(); ++I)
{
string::size_type Space = (*I).find(' ');
if (Space == string::npos)
@@ -661,13 +661,13 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/
if (_config->FindB("Debug::aptcdrom",false) == true)
{
cout << "I found (binary):" << endl;
- for (vector<string>::iterator I = List.begin(); I != List.end(); I++)
+ for (vector<string>::iterator I = List.begin(); I != List.end(); ++I)
cout << *I << endl;
cout << "I found (source):" << endl;
- for (vector<string>::iterator I = SourceList.begin(); I != SourceList.end(); I++)
+ for (vector<string>::iterator I = SourceList.begin(); I != SourceList.end(); ++I)
cout << *I << endl;
cout << "I found (Signatures):" << endl;
- for (vector<string>::iterator I = SigList.begin(); I != SigList.end(); I++)
+ for (vector<string>::iterator I = SigList.begin(); I != SigList.end(); ++I)
cout << *I << endl;
}
@@ -688,7 +688,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/
log->Update(msg.str(), STEP_SCAN);
}
- if (List.size() == 0 && SourceList.size() == 0)
+ if (List.empty() == true && SourceList.empty() == true)
{
if (_config->FindB("APT::CDROM::NoMount",false) == false)
UnmountCdrom(CDROM);
@@ -712,7 +712,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/
{
// Escape special characters
string::iterator J = Name.begin();
- for (; J != Name.end(); J++)
+ for (; J != Name.end(); ++J)
if (*J == '"' || *J == ']' || *J == '[')
*J = '_';
@@ -757,7 +757,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/
// Escape special characters
string::iterator J = Name.begin();
- for (; J != Name.end(); J++)
+ for (; J != Name.end(); ++J)
if (*J == '"' || *J == ']' || *J == '[')
*J = '_';
@@ -804,7 +804,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/
if(log != NULL)
log->Update(_("Source list entries for this disc are:\n"));
- for (vector<string>::iterator I = List.begin(); I != List.end(); I++)
+ for (vector<string>::iterator I = List.begin(); I != List.end(); ++I)
{
string::size_type Space = (*I).find(' ');
if (Space == string::npos)
@@ -823,7 +823,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/
}
}
- for (vector<string>::iterator I = SourceList.begin(); I != SourceList.end(); I++)
+ for (vector<string>::iterator I = SourceList.begin(); I != SourceList.end(); ++I)
{
string::size_type Space = (*I).find(' ');
if (Space == string::npos)
diff --git a/apt-pkg/clean.cc b/apt-pkg/clean.cc
index 629afd7cf..9850b93b4 100644
--- a/apt-pkg/clean.cc
+++ b/apt-pkg/clean.cc
@@ -85,12 +85,12 @@ bool pkgArchiveCleaner::Go(string Dir,pkgCache &Cache)
if (P.end() != true)
{
pkgCache::VerIterator V = P.VersionList();
- for (; V.end() == false; V++)
+ for (; V.end() == false; ++V)
{
// See if we can fetch this version at all
bool IsFetchable = false;
for (pkgCache::VerFileIterator J = V.FileList();
- J.end() == false; J++)
+ J.end() == false; ++J)
{
if (CleanInstalled == true &&
(J.File()->Flags & pkgCache::Flag::NotSource) != 0)
diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc
index 942ea9fbc..ece05e8f6 100644
--- a/apt-pkg/contrib/configuration.cc
+++ b/apt-pkg/contrib/configuration.cc
@@ -672,9 +672,9 @@ bool ReadConfigFile(Configuration &Conf,const string &FName,bool const &AsSectio
// Put the last fragment into the buffer
std::string::const_iterator NonWhitespaceStart = Start;
std::string::const_iterator NonWhitespaceStop = I;
- for (; NonWhitespaceStart != I && isspace(*NonWhitespaceStart) != 0; NonWhitespaceStart++)
+ for (; NonWhitespaceStart != I && isspace(*NonWhitespaceStart) != 0; ++NonWhitespaceStart)
;
- for (; NonWhitespaceStop != NonWhitespaceStart && isspace(NonWhitespaceStop[-1]) != 0; NonWhitespaceStop--)
+ for (; NonWhitespaceStop != NonWhitespaceStart && isspace(NonWhitespaceStop[-1]) != 0; --NonWhitespaceStop)
;
if (LineBuffer.empty() == false && NonWhitespaceStop - NonWhitespaceStart != 0)
LineBuffer += ' ';
@@ -850,7 +850,7 @@ bool ReadConfigDir(Configuration &Conf,const string &Dir,
vector<string> const List = GetListOfFilesInDir(Dir, "conf", true, true);
// Read the files
- for (vector<string>::const_iterator I = List.begin(); I != List.end(); I++)
+ for (vector<string>::const_iterator I = List.begin(); I != List.end(); ++I)
if (ReadConfigFile(Conf,*I,AsSectional,Depth) == false)
return false;
return true;
diff --git a/apt-pkg/contrib/error.cc b/apt-pkg/contrib/error.cc
index 18810d2a4..edb290f34 100644
--- a/apt-pkg/contrib/error.cc
+++ b/apt-pkg/contrib/error.cc
@@ -193,7 +193,7 @@ bool GlobalError::PopMessage(std::string &Text) {
// check if another error message is pending
for (std::list<Item>::const_iterator m = Messages.begin();
- m != Messages.end(); m++)
+ m != Messages.end(); ++m)
if (m->Type == ERROR || m->Type == FATAL)
return Ret;
@@ -210,7 +210,7 @@ void GlobalError::DumpErrors(std::ostream &out, MsgType const &threshold,
Messages.insert(Messages.begin(), s->Messages.begin(), s->Messages.end());
for (std::list<Item>::const_iterator m = Messages.begin();
- m != Messages.end(); m++)
+ m != Messages.end(); ++m)
if (m->Type >= threshold)
out << (*m) << std::endl;
Discard();
@@ -231,7 +231,7 @@ bool GlobalError::empty(MsgType const &trashhold) const {
return true;
for (std::list<Item>::const_iterator m = Messages.begin();
- m != Messages.end(); m++)
+ m != Messages.end(); ++m)
if (m->Type >= trashhold)
return false;
diff --git a/apt-pkg/contrib/netrc.cc b/apt-pkg/contrib/netrc.cc
index 34f472ee1..9ff5796c5 100644
--- a/apt-pkg/contrib/netrc.cc
+++ b/apt-pkg/contrib/netrc.cc
@@ -47,10 +47,7 @@ int parsenetrc (char *host, char *login, char *password, char *netrcfile = NULL)
int specific_login = (login[0] != 0);
char *home = NULL;
bool netrc_alloc = false;
- int state = NOTHING;
- char state_login = 0; /* Found a login keyword */
- char state_password = 0; /* Found a password keyword */
int state_our_login = false; /* With specific_login,
found *our* login name */
@@ -81,6 +78,10 @@ int parsenetrc (char *host, char *login, char *password, char *netrcfile = NULL)
bool done = false;
char netrcbuffer[256];
+ int state = NOTHING;
+ char state_login = 0; /* Found a login keyword */
+ char state_password = 0; /* Found a password keyword */
+
while (!done && fgets(netrcbuffer, sizeof (netrcbuffer), file)) {
tok = strtok_r (netrcbuffer, " \t\n", &tok_buf);
while (!done && tok) {
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index ab2da2d9a..867bb313b 100644
--- a/apt-pkg/contrib/strutl.cc
+++ b/apt-pkg/contrib/strutl.cc
@@ -271,7 +271,7 @@ bool ParseCWord(const char *&String,string &Res)
string QuoteString(const string &Str, const char *Bad)
{
string Res;
- for (string::const_iterator I = Str.begin(); I != Str.end(); I++)
+ for (string::const_iterator I = Str.begin(); I != Str.end(); ++I)
{
if (strchr(Bad,*I) != 0 || isprint(*I) == 0 ||
*I == 0x25 || // percent '%' char
@@ -298,7 +298,7 @@ string DeQuoteString(string::const_iterator const &begin,
string::const_iterator const &end)
{
string Res;
- for (string::const_iterator I = begin; I != end; I++)
+ for (string::const_iterator I = begin; I != end; ++I)
{
if (*I == '%' && I + 2 < end &&
isxdigit(I[1]) && isxdigit(I[2]))
@@ -632,7 +632,7 @@ string LookupTag(const string &Message,const char *Tag,const char *Default)
{
// Look for a matching tag.
int Length = strlen(Tag);
- for (string::const_iterator I = Message.begin(); I + Length < Message.end(); I++)
+ for (string::const_iterator I = Message.begin(); I + Length < Message.end(); ++I)
{
// Found the tag
if (I[Length] == ':' && stringcasecmp(I,I+Length,Tag) == 0)
@@ -640,14 +640,14 @@ string LookupTag(const string &Message,const char *Tag,const char *Default)
// Find the end of line and strip the leading/trailing spaces
string::const_iterator J;
I += Length + 1;
- for (; isspace(*I) != 0 && I < Message.end(); I++);
- for (J = I; *J != '\n' && J < Message.end(); J++);
- for (; J > I && isspace(J[-1]) != 0; J--);
+ for (; isspace(*I) != 0 && I < Message.end(); ++I);
+ for (J = I; *J != '\n' && J < Message.end(); ++J);
+ for (; J > I && isspace(J[-1]) != 0; --J);
return string(I,J);
}
- for (; *I != '\n' && I < Message.end(); I++);
+ for (; *I != '\n' && I < Message.end(); ++I);
}
// Failed to find a match
@@ -1224,7 +1224,7 @@ int tolower_ascii(int const c)
bool CheckDomainList(const string &Host,const string &List)
{
string::const_iterator Start = List.begin();
- for (string::const_iterator Cur = List.begin(); Cur <= List.end(); Cur++)
+ for (string::const_iterator Cur = List.begin(); Cur <= List.end(); ++Cur)
{
if (Cur < List.end() && *Cur != ',')
continue;
@@ -1248,7 +1248,7 @@ string DeEscapeString(const string &input)
char tmp[3];
string::const_iterator it, escape_start;
string output, octal, hex;
- for (it = input.begin(); it != input.end(); it++)
+ for (it = input.begin(); it != input.end(); ++it)
{
// just copy non-escape chars
if (*it != '\\')
@@ -1264,7 +1264,7 @@ string DeEscapeString(const string &input)
// copy
output += *it;
// advance iterator one step further
- it += 1;
+ ++it;
continue;
}
@@ -1273,7 +1273,7 @@ string DeEscapeString(const string &input)
continue;
// read it
- it++;
+ ++it;
switch (*it)
{
case '0':
@@ -1310,7 +1310,7 @@ void URI::CopyFrom(const string &U)
string::const_iterator I = U.begin();
// Locate the first colon, this separates the scheme
- for (; I < U.end() && *I != ':' ; I++);
+ for (; I < U.end() && *I != ':' ; ++I);
string::const_iterator FirstColon = I;
/* Determine if this is a host type URI with a leading double //
@@ -1322,7 +1322,7 @@ void URI::CopyFrom(const string &U)
/* Find the / indicating the end of the hostname, ignoring /'s in the
square brackets */
bool InBracket = false;
- for (; SingleSlash < U.end() && (*SingleSlash != '/' || InBracket == true); SingleSlash++)
+ for (; SingleSlash < U.end() && (*SingleSlash != '/' || InBracket == true); ++SingleSlash)
{
if (*SingleSlash == '[')
InBracket = true;
@@ -1355,11 +1355,11 @@ void URI::CopyFrom(const string &U)
I = FirstColon + 1;
if (I > SingleSlash)
I = SingleSlash;
- for (; I < SingleSlash && *I != ':'; I++);
+ for (; I < SingleSlash && *I != ':'; ++I);
string::const_iterator SecondColon = I;
// Search for the @ after the colon
- for (; I < SingleSlash && *I != '@'; I++);
+ for (; I < SingleSlash && *I != '@'; ++I);
string::const_iterator At = I;
// Now write the host and user/pass
diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc
index c9e7f1176..e3d4063dc 100644
--- a/apt-pkg/deb/debindexfile.cc
+++ b/apt-pkg/deb/debindexfile.cc
@@ -352,7 +352,7 @@ pkgCache::PkgFileIterator debPackagesIndex::FindInCache(pkgCache &Cache) const
{
string FileName = IndexFile("Packages");
pkgCache::PkgFileIterator File = Cache.FileBegin();
- for (; File.end() == false; File++)
+ for (; File.end() == false; ++File)
{
if (File.FileName() == NULL || FileName != File.FileName())
continue;
@@ -540,7 +540,7 @@ pkgCache::PkgFileIterator debTranslationsIndex::FindInCache(pkgCache &Cache) con
string FileName = IndexFile(Language);
pkgCache::PkgFileIterator File = Cache.FileBegin();
- for (; File.end() == false; File++)
+ for (; File.end() == false; ++File)
{
if (FileName != File.FileName())
continue;
@@ -620,7 +620,7 @@ bool debStatusIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const
pkgCache::PkgFileIterator debStatusIndex::FindInCache(pkgCache &Cache) const
{
pkgCache::PkgFileIterator File = Cache.FileBegin();
- for (; File.end() == false; File++)
+ for (; File.end() == false; ++File)
{
if (this->File != File.FileName())
continue;
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 59c4ee365..952433428 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -198,7 +198,7 @@ string debListParser::DescriptionLanguage()
std::vector<string> const lang = APT::Configuration::getLanguages(true);
for (std::vector<string>::const_iterator l = lang.begin();
- l != lang.end(); l++)
+ l != lang.end(); ++l)
if (Section.FindS(string("Description-").append(*l).c_str()).empty() == false)
return *l;
diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc
index 81afb22b6..e1f8219e3 100644
--- a/apt-pkg/deb/debmetaindex.cc
+++ b/apt-pkg/deb/debmetaindex.cc
@@ -208,7 +208,7 @@ vector <struct IndexTarget *>* debReleaseIndex::ComputeIndexTargets() const {
for (std::set<std::string>::const_iterator s = sections.begin();
s != sections.end(); ++s) {
for (std::vector<std::string>::const_iterator l = lang.begin();
- l != lang.end(); l++) {
+ l != lang.end(); ++l) {
if (*l == "none") continue;
IndexTarget * Target = new OptionalIndexTarget();
Target->ShortDesc = "Translation-" + *l;
@@ -238,7 +238,7 @@ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const
// special case for --print-uris
if (GetAll) {
vector <struct IndexTarget *> *targets = ComputeIndexTargets();
- for (vector <struct IndexTarget*>::const_iterator Target = targets->begin(); Target != targets->end(); Target++) {
+ for (vector <struct IndexTarget*>::const_iterator Target = targets->begin(); Target != targets->end(); ++Target) {
new pkgAcqIndex(Owner, (*Target)->URI, (*Target)->Description,
(*Target)->ShortDesc, HashString());
}
@@ -295,7 +295,7 @@ vector <pkgIndexFile *> *debReleaseIndex::GetIndexFiles() {
if (src != ArchEntries.end()) {
vector<debSectionEntry const*> const SectionEntries = src->second;
for (vector<debSectionEntry const*>::const_iterator I = SectionEntries.begin();
- I != SectionEntries.end(); I++)
+ I != SectionEntries.end(); ++I)
Indexes->push_back(new debSourcesIndex (URI, Dist, (*I)->Section, IsTrusted()));
}
@@ -310,7 +310,7 @@ vector <pkgIndexFile *> *debReleaseIndex::GetIndexFiles() {
if (a->first == "source")
continue;
for (vector<debSectionEntry const*>::const_iterator I = a->second.begin();
- I != a->second.end(); I++) {
+ I != a->second.end(); ++I) {
Indexes->push_back(new debPackagesIndex (URI, Dist, (*I)->Section, IsTrusted(), a->first));
sections[(*I)->Section].insert(lang.begin(), lang.end());
}
@@ -319,7 +319,7 @@ vector <pkgIndexFile *> *debReleaseIndex::GetIndexFiles() {
for (map<string, set<string> >::const_iterator s = sections.begin();
s != sections.end(); ++s)
for (set<string>::const_iterator l = s->second.begin();
- l != s->second.end(); l++) {
+ l != s->second.end(); ++l) {
if (*l == "none") continue;
Indexes->push_back(new debTranslationsIndex(URI,Dist,s->first,(*l).c_str()));
}
@@ -368,7 +368,7 @@ class debSLTypeDebian : public pkgSourceList::Type
map<string, string>::const_iterator const trusted = Options.find("trusted");
for (vector<metaIndex *>::const_iterator I = List.begin();
- I != List.end(); I++)
+ I != List.end(); ++I)
{
// We only worry about debian entries here
if (strcmp((*I)->GetType(), "deb") != 0)
diff --git a/apt-pkg/deb/debrecords.cc b/apt-pkg/deb/debrecords.cc
index f323c03c2..2571aae52 100644
--- a/apt-pkg/deb/debrecords.cc
+++ b/apt-pkg/deb/debrecords.cc
@@ -135,7 +135,7 @@ string debRecordParser::LongDesc()
{
vector<string> const lang = APT::Configuration::getLanguages();
for (vector<string>::const_iterator l = lang.begin();
- orig.empty() && l != lang.end(); l++)
+ orig.empty() && l != lang.end(); ++l)
orig = Section.FindS(string("Description-").append(*l).c_str());
}
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 019b72bb8..3c4c244cc 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -229,7 +229,7 @@ bool pkgDPkgPM::SendV2Pkgs(FILE *F)
fprintf(F,"\n");
// Write out the package actions in order.
- for (vector<Item>::iterator I = List.begin(); I != List.end(); I++)
+ for (vector<Item>::iterator I = List.begin(); I != List.end(); ++I)
{
if(I->Pkg.end() == true)
continue;
@@ -351,7 +351,7 @@ bool pkgDPkgPM::RunScriptsWithPkgs(const char *Cnf)
// Feed it the filenames.
if (Version <= 1)
{
- for (vector<Item>::iterator I = List.begin(); I != List.end(); I++)
+ for (vector<Item>::iterator I = List.begin(); I != List.end(); ++I)
{
// Only deal with packages to be installed from .deb
if (I->Op != Item::Install)
@@ -706,7 +706,7 @@ bool pkgDPkgPM::OpenLog()
chmod(history_name.c_str(), 0644);
fprintf(d->history_out, "\nStart-Date: %s\n", timestr);
string remove, purge, install, reinstall, upgrade, downgrade;
- for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
{
enum { CANDIDATE, CANDIDATE_AUTO, CURRENT_CANDIDATE, CURRENT } infostring;
string *line = NULL;
@@ -884,14 +884,14 @@ bool pkgDPkgPM::Go(int OutStatusFd)
// that will be [installed|configured|removed|purged] and add
// them to the PackageOps map (the dpkg states it goes through)
// and the PackageOpsTranslations (human readable strings)
- for (vector<Item>::const_iterator I = List.begin(); I != List.end();I++)
+ for (vector<Item>::const_iterator I = List.begin(); I != List.end(); ++I)
{
if((*I).Pkg.end() == true)
continue;
string const name = (*I).Pkg.Name();
PackageOpsDone[name] = 0;
- for(int i=0; (DpkgStatesOpMap[(*I).Op][i]).state != NULL; i++)
+ for(int i=0; (DpkgStatesOpMap[(*I).Op][i]).state != NULL; ++i)
{
PackageOps[name].push_back(DpkgStatesOpMap[(*I).Op][i]);
PackagesTotal++;
@@ -909,7 +909,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
// Do all actions with the same Op in one run
vector<Item>::const_iterator J = I;
if (TriggersPending == true)
- for (; J != List.end(); J++)
+ for (; J != List.end(); ++J)
{
if (J->Op == I->Op)
continue;
@@ -921,7 +921,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
break;
}
else
- for (; J != List.end() && J->Op == I->Op; J++)
+ for (; J != List.end() && J->Op == I->Op; ++J)
/* nothing */;
// Generate the argument list
@@ -1027,7 +1027,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
// Write in the file or package names
if (I->Op == Item::Install)
{
- for (;I != J && Size < MaxArgBytes; I++)
+ for (;I != J && Size < MaxArgBytes; ++I)
{
if (I->File[0] != '/')
return _error->Error("Internal Error, Pathname to install is not absolute '%s'",I->File.c_str());
@@ -1039,7 +1039,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
{
string const nativeArch = _config->Find("APT::Architecture");
unsigned long const oldSize = I->Op == Item::Configure ? Size : 0;
- for (;I != J && Size < MaxArgBytes; I++)
+ for (;I != J && Size < MaxArgBytes; ++I)
{
if((*I).Pkg.end() == true)
continue;
@@ -1477,7 +1477,7 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg)
// log the ordering
const char *ops_str[] = {"Install", "Configure","Remove","Purge"};
fprintf(report, "AptOrdering:\n");
- for (vector<Item>::iterator I = List.begin(); I != List.end(); I++)
+ for (vector<Item>::iterator I = List.begin(); I != List.end(); ++I)
fprintf(report, " %s: %s\n", (*I).Pkg.Name(), ops_str[(*I).Op]);
// attach dmesg log (to learn about segfaults)
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index ee9315069..e9527647e 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -129,7 +129,7 @@ bool pkgDepCache::Init(OpProgress *Prog)
/* Set the current state of everything. In this state all of the
packages are kept exactly as is. See AllUpgrade */
int Done = 0;
- for (PkgIterator I = PkgBegin(); I.end() != true; I++,Done++)
+ for (PkgIterator I = PkgBegin(); I.end() != true; ++I, ++Done)
{
if (Prog != 0 && Done%20 == 0)
Prog->Progress(Done);
@@ -292,7 +292,7 @@ bool pkgDepCache::writeStateFile(OpProgress *prog, bool InstalledOnly) /*{{{*/
// then write the ones we have not seen yet
std::ostringstream ostr;
- for(pkgCache::PkgIterator pkg=Cache->PkgBegin(); !pkg.end(); pkg++) {
+ for(pkgCache::PkgIterator pkg=Cache->PkgBegin(); !pkg.end(); ++pkg) {
StateCache const &P = PkgState[pkg->ID];
if(P.Flags & Flag::Auto) {
if (pkgs_seen.find(pkg.FullName()) != pkgs_seen.end()) {
@@ -365,7 +365,7 @@ bool pkgDepCache::CheckDep(DepIterator Dep,int Type,PkgIterator &Res)
// Check the providing packages
PrvIterator P = Dep.TargetPkg().ProvidesList();
PkgIterator Pkg = Dep.ParentPkg();
- for (; P.end() != true; P++)
+ for (; P.end() != true; ++P)
{
/* Provides may never be applied against the same package (or group)
if it is a conflicts. See the comment above. */
@@ -534,7 +534,7 @@ void pkgDepCache::BuildGroupOrs(VerIterator const &V)
{
unsigned char Group = 0;
- for (DepIterator D = V.DependsList(); D.end() != true; D++)
+ for (DepIterator D = V.DependsList(); D.end() != true; ++D)
{
// Build the dependency state.
unsigned char &State = DepState[D->ID];
@@ -574,7 +574,7 @@ unsigned char pkgDepCache::VersionState(DepIterator D,unsigned char Check,
// Compute a single dependency element (glob or)
DepIterator Start = D;
unsigned char State = 0;
- for (bool LastOR = true; D.end() == false && LastOR == true; D++)
+ for (bool LastOR = true; D.end() == false && LastOR == true; ++D)
{
State |= DepState[D->ID];
LastOR = (D->CompareOp & Dep::Or) == Dep::Or;
@@ -664,15 +664,15 @@ void pkgDepCache::Update(OpProgress *Prog)
// Perform the depends pass
int Done = 0;
- for (PkgIterator I = PkgBegin(); I.end() != true; I++,Done++)
+ for (PkgIterator I = PkgBegin(); I.end() != true; ++I, ++Done)
{
if (Prog != 0 && Done%20 == 0)
Prog->Progress(Done);
- for (VerIterator V = I.VersionList(); V.end() != true; V++)
+ for (VerIterator V = I.VersionList(); V.end() != true; ++V)
{
unsigned char Group = 0;
- for (DepIterator D = V.DependsList(); D.end() != true; D++)
+ for (DepIterator D = V.DependsList(); D.end() != true; ++D)
{
// Build the dependency state.
unsigned char &State = DepState[D->ID];
@@ -709,7 +709,7 @@ void pkgDepCache::Update(OpProgress *Prog)
void pkgDepCache::Update(DepIterator D)
{
// Update the reverse deps
- for (;D.end() != true; D++)
+ for (;D.end() != true; ++D)
{
unsigned char &State = DepState[D->ID];
State = DependencyState(D);
@@ -742,13 +742,13 @@ void pkgDepCache::Update(PkgIterator const &Pkg)
// Update the provides map for the current ver
if (Pkg->CurrentVer != 0)
for (PrvIterator P = Pkg.CurrentVer().ProvidesList();
- P.end() != true; P++)
+ P.end() != true; ++P)
Update(P.ParentPkg().RevDependsList());
// Update the provides map for the candidate ver
if (PkgState[Pkg->ID].CandidateVer != 0)
for (PrvIterator P = PkgState[Pkg->ID].CandidateVerIter(*this).ProvidesList();
- P.end() != true; P++)
+ P.end() != true; ++P)
Update(P.ParentPkg().RevDependsList());
}
/*}}}*/
@@ -1009,7 +1009,7 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
DepIterator Start = Dep;
bool Result = true;
unsigned Ors = 0;
- for (bool LastOR = true; Dep.end() == false && LastOR == true; Dep++,Ors++)
+ for (bool LastOR = true; Dep.end() == false && LastOR == true; ++Dep, ++Ors)
{
LastOR = (Dep->CompareOp & Dep::Or) == Dep::Or;
@@ -1475,12 +1475,12 @@ pkgCache::VerIterator pkgDepCache::Policy::GetCandidateVer(PkgIterator const &Pk
unless they are already installed */
VerIterator Last(*(pkgCache *)this,0);
- for (VerIterator I = Pkg.VersionList(); I.end() == false; I++)
+ for (VerIterator I = Pkg.VersionList(); I.end() == false; ++I)
{
if (Pkg.CurrentVer() == I)
return I;
- for (VerFileIterator J = I.FileList(); J.end() == false; J++)
+ for (VerFileIterator J = I.FileList(); J.end() == false; ++J)
{
if ((J.File()->Flags & Flag::NotSource) != 0)
continue;
diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h
index d935c1887..66cb7dbab 100644
--- a/apt-pkg/depcache.h
+++ b/apt-pkg/depcache.h
@@ -400,7 +400,7 @@ class pkgDepCache : protected pkgCache::Namespace
// @{
bool MarkKeep(PkgIterator const &Pkg, bool Soft = false,
bool FromUser = true, unsigned long Depth = 0);
- bool MarkDelete(PkgIterator const &Pkg, bool Purge = false,
+ bool MarkDelete(PkgIterator const &Pkg, bool MarkPurge = false,
unsigned long Depth = 0, bool FromUser = true);
bool MarkInstall(PkgIterator const &Pkg,bool AutoInst = true,
unsigned long Depth = 0, bool FromUser = true,
@@ -468,7 +468,7 @@ class pkgDepCache : protected pkgCache::Namespace
* \param Depth recursive deep of this Marker call
* \param FromUser was the remove requested by the user?
*/
- virtual bool IsDeleteOk(const PkgIterator &Pkg,bool Purge = false,
+ virtual bool IsDeleteOk(const PkgIterator &Pkg,bool MarkPurge = false,
unsigned long Depth = 0, bool FromUser = true);
// read persistent states
diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc
index 31c577705..747e464be 100644
--- a/apt-pkg/indexcopy.cc
+++ b/apt-pkg/indexcopy.cc
@@ -43,7 +43,7 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector<string> &List,
pkgCdromStatus *log)
{
OpProgress *Progress = NULL;
- if (List.size() == 0)
+ if (List.empty() == true)
return true;
if(log)
@@ -54,7 +54,7 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector<string> &List,
// Prepare the progress indicator
unsigned long TotalSize = 0;
- for (vector<string>::iterator I = List.begin(); I != List.end(); I++)
+ for (vector<string>::iterator I = List.begin(); I != List.end(); ++I)
{
struct stat Buf;
if (stat(string(*I + GetFileName()).c_str(),&Buf) != 0 &&
@@ -68,7 +68,7 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector<string> &List,
unsigned int NotFound = 0;
unsigned int WrongSize = 0;
unsigned int Packages = 0;
- for (vector<string>::iterator I = List.begin(); I != List.end(); I++)
+ for (vector<string>::iterator I = List.begin(); I != List.end(); ++I)
{
string OrigPath = string(*I,CDROM.length());
unsigned long FileSize = 0;
@@ -583,13 +583,13 @@ bool SigVerify::CopyMetaIndex(string CDROM, string CDName, /*{{{*/
bool SigVerify::CopyAndVerify(string CDROM,string Name,vector<string> &SigList, /*{{{*/
vector<string> PkgList,vector<string> SrcList)
{
- if (SigList.size() == 0)
+ if (SigList.empty() == true)
return true;
bool Debug = _config->FindB("Debug::aptcdrom",false);
// Read all Release files
- for (vector<string>::iterator I = SigList.begin(); I != SigList.end(); I++)
+ for (vector<string>::iterator I = SigList.begin(); I != SigList.end(); ++I)
{
if(Debug)
cout << "Signature verify for: " << *I << endl;
@@ -633,7 +633,7 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector<string> &SigList,
// go over the Indexfiles and see if they verify
// if so, remove them from our copy of the lists
vector<string> keys = MetaIndex->MetaKeys();
- for (vector<string>::iterator I = keys.begin(); I != keys.end(); I++)
+ for (vector<string>::iterator I = keys.begin(); I != keys.end(); ++I)
{
if(!Verify(prefix,*I, MetaIndex)) {
// something went wrong, don't copy the Release.gpg
@@ -776,7 +776,7 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/
vector<string> &List, pkgCdromStatus *log)
{
OpProgress *Progress = NULL;
- if (List.size() == 0)
+ if (List.empty() == true)
return true;
if(log)
@@ -786,7 +786,7 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/
// Prepare the progress indicator
unsigned long TotalSize = 0;
- for (vector<string>::iterator I = List.begin(); I != List.end(); I++)
+ for (vector<string>::iterator I = List.begin(); I != List.end(); ++I)
{
struct stat Buf;
if (stat(string(*I).c_str(),&Buf) != 0 &&
@@ -800,7 +800,7 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/
unsigned int NotFound = 0;
unsigned int WrongSize = 0;
unsigned int Packages = 0;
- for (vector<string>::iterator I = List.begin(); I != List.end(); I++)
+ for (vector<string>::iterator I = List.begin(); I != List.end(); ++I)
{
string OrigPath = string(*I,CDROM.length());
unsigned long FileSize = 0;
@@ -885,7 +885,6 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/
this->Section = &Section;
string Prefix;
unsigned long Hits = 0;
- unsigned long Chop = 0;
while (Parser.Step(Section) == true)
{
if(Progress)
@@ -903,7 +902,7 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/
fclose(TargetFl);
if (Debug == true)
- cout << " Processed by using Prefix '" << Prefix << "' and chop " << Chop << endl;
+ cout << " Processed by using Prefix '" << Prefix << "' and chop " << endl;
if (_config->FindB("APT::CDROM::NoAct",false) == false)
{
diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc
index 37be87055..f18ddbfaa 100644
--- a/apt-pkg/indexfile.cc
+++ b/apt-pkg/indexfile.cc
@@ -27,7 +27,8 @@ unsigned long pkgIndexFile::Type::GlobalListLen = 0;
pkgIndexFile::Type::Type()
{
ItmList[GlobalListLen] = this;
- GlobalListLen++;
+ GlobalListLen++;
+ Label = NULL;
}
/*}}}*/
// Type::GetType - Locate the type by name /*{{{*/
diff --git a/apt-pkg/orderlist.cc b/apt-pkg/orderlist.cc
index 19661fc2d..a58efa987 100644
--- a/apt-pkg/orderlist.cc
+++ b/apt-pkg/orderlist.cc
@@ -145,13 +145,13 @@ bool pkgOrderList::DoRun()
Depth = 0;
WipeFlags(Added | AddPending | Loop | InList);
- for (iterator I = List; I != End; I++)
+ for (iterator I = List; I != End; ++I)
Flag(*I,InList);
// Rebuild the main list into the temp list.
iterator OldEnd = End;
End = NList;
- for (iterator I = List; I != OldEnd; I++)
+ for (iterator I = List; I != OldEnd; ++I)
if (VisitNode(PkgIterator(Cache,*I)) == false)
{
End = OldEnd;
@@ -197,7 +197,7 @@ bool pkgOrderList::OrderCritical()
{
clog << "** Critical Unpack ordering done" << endl;
- for (iterator I = List; I != End; I++)
+ for (iterator I = List; I != End; ++I)
{
PkgIterator P(Cache,*I);
if (IsNow(P) == true)
@@ -222,7 +222,7 @@ bool pkgOrderList::OrderUnpack(string *FileList)
WipeFlags(After);
// Set the inlist flag
- for (iterator I = List; I != End; I++)
+ for (iterator I = List; I != End; ++I)
{
PkgIterator P(Cache,*I);
if (IsMissing(P) == true && IsNow(P) == true)
@@ -270,7 +270,7 @@ bool pkgOrderList::OrderUnpack(string *FileList)
{
clog << "** Unpack ordering done" << endl;
- for (iterator I = List; I != End; I++)
+ for (iterator I = List; I != End; ++I)
{
PkgIterator P(Cache,*I);
if (IsNow(P) == true)
@@ -323,7 +323,7 @@ int pkgOrderList::Score(PkgIterator Pkg)
Score += ScoreImmediate;
for (DepIterator D = Cache[Pkg].InstVerIter(Cache).DependsList();
- D.end() == false; D++)
+ D.end() == false; ++D)
if (D->Type == pkgCache::Dep::PreDepends)
{
Score += ScorePreDepends;
@@ -488,7 +488,7 @@ bool pkgOrderList::VisitRProvides(DepFunc F,VerIterator Ver)
return true;
bool Res = true;
- for (PrvIterator P = Ver.ProvidesList(); P.end() == false; P++)
+ for (PrvIterator P = Ver.ProvidesList(); P.end() == false; ++P)
Res &= (this->*F)(P.ParentPkg().RevDependsList());
return Res;
}
@@ -615,7 +615,7 @@ bool pkgOrderList::VisitNode(PkgIterator Pkg)
Loops are preprocessed and logged. */
bool pkgOrderList::DepUnPackCrit(DepIterator D)
{
- for (; D.end() == false; D++)
+ for (; D.end() == false; ++D)
{
if (D.Reverse() == true)
{
@@ -693,7 +693,7 @@ bool pkgOrderList::DepUnPackPreD(DepIterator D)
if (D.Reverse() == true)
return DepUnPackCrit(D);
- for (; D.end() == false; D++)
+ for (; D.end() == false; ++D)
{
if (D.IsCritical() == false)
continue;
@@ -736,7 +736,7 @@ bool pkgOrderList::DepUnPackPre(DepIterator D)
if (D.Reverse() == true)
return true;
- for (; D.end() == false; D++)
+ for (; D.end() == false; ++D)
{
/* Only consider the PreDepends or Depends. Depends are only
considered at the lowest depth or in the case of immediate
@@ -791,7 +791,7 @@ bool pkgOrderList::DepUnPackPre(DepIterator D)
bool pkgOrderList::DepUnPackDep(DepIterator D)
{
- for (; D.end() == false; D++)
+ for (; D.end() == false; ++D)
if (D.IsCritical() == true)
{
if (D.Reverse() == true)
@@ -846,7 +846,7 @@ bool pkgOrderList::DepConfigure(DepIterator D)
if (D.Reverse() == true)
return true;
- for (; D.end() == false; D++)
+ for (; D.end() == false; ++D)
if (D->Type == pkgCache::Dep::Depends)
if (VisitProvides(D,false) == false)
return false;
@@ -868,7 +868,7 @@ bool pkgOrderList::DepRemove(DepIterator D)
{
if (D.Reverse() == false)
return true;
- for (; D.end() == false; D++)
+ for (; D.end() == false; ++D)
if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
{
// Duplication elimination, consider the current version only
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index 1ae09347a..a3ba26f7c 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -63,7 +63,7 @@ bool pkgPackageManager::GetArchives(pkgAcquire *Owner,pkgSourceList *Sources,
if (ordering == false)
return _error->Error("Internal ordering error");
- for (pkgOrderList::iterator I = List->begin(); I != List->end(); I++)
+ for (pkgOrderList::iterator I = List->begin(); I != List->end(); ++I)
{
PkgIterator Pkg(Cache,*I);
FileNames[Pkg->ID] = string();
@@ -99,7 +99,7 @@ bool pkgPackageManager::FixMissing()
List->SetFileList(FileNames);
bool Bad = false;
- for (PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
{
if (List->IsMissing(I) == false)
continue;
@@ -140,7 +140,7 @@ void pkgPackageManager::ImmediateAdd(PkgIterator I, bool UseInstallVer, unsigned
D = I.CurrentVer().DependsList();
}
- for ( /* nothing */ ; D.end() == false; D++)
+ for ( /* nothing */ ; D.end() == false; ++D)
if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
{
if(!List->IsFlag(D.TargetPkg(), pkgOrderList::Immediate))
@@ -169,7 +169,7 @@ bool pkgPackageManager::CreateOrderList()
static bool const NoImmConfigure = !_config->FindB("APT::Immediate-Configure",true);
// Generate the list of affected packages and sort it
- for (PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+ for (PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
{
// Ignore no-version packages
if (I->VersionList == 0)
@@ -229,7 +229,7 @@ bool pkgPackageManager::DepAlwaysTrue(DepIterator D)
bool pkgPackageManager::CheckRConflicts(PkgIterator Pkg,DepIterator D,
const char *Ver)
{
- for (;D.end() == false; D++)
+ for (;D.end() == false; ++D)
{
if (D->Type != pkgCache::Dep::Conflicts &&
D->Type != pkgCache::Dep::Obsoletes)
@@ -262,7 +262,7 @@ bool pkgPackageManager::ConfigureAll()
pkgOrderList OList(&Cache);
// Populate the order list
- for (pkgOrderList::iterator I = List->begin(); I != List->end(); I++)
+ for (pkgOrderList::iterator I = List->begin(); I != List->end(); ++I)
if (List->IsFlag(pkgCache::PkgIterator(Cache,*I),
pkgOrderList::UnPacked) == true)
OList.push_back(*I);
@@ -274,7 +274,7 @@ bool pkgPackageManager::ConfigureAll()
bool const ConfigurePkgs = (conf == "all");
// Perform the configuring
- for (pkgOrderList::iterator I = OList.begin(); I != OList.end(); I++)
+ for (pkgOrderList::iterator I = OList.begin(); I != OList.end(); ++I)
{
PkgIterator Pkg(Cache,*I);
@@ -309,7 +309,7 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg)
return false;
// Perform the configuring
- for (pkgOrderList::iterator I = OList.begin(); I != OList.end(); I++)
+ for (pkgOrderList::iterator I = OList.begin(); I != OList.end(); ++I)
{
PkgIterator Pkg(Cache,*I);
@@ -364,13 +364,13 @@ bool pkgPackageManager::DepAdd(pkgOrderList &OList,PkgIterator Pkg,int Depth)
{
if (D->Type != pkgCache::Dep::Depends && D->Type != pkgCache::Dep::PreDepends)
{
- D++;
+ ++D;
continue;
}
// Grok or groups
Bad = true;
- for (bool LastOR = true; D.end() == false && LastOR == true; D++)
+ for (bool LastOR = true; D.end() == false && LastOR == true; ++D)
{
LastOR = (D->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or;
@@ -378,7 +378,7 @@ bool pkgPackageManager::DepAdd(pkgOrderList &OList,PkgIterator Pkg,int Depth)
continue;
SPtrArray<Version *> VList = D.AllTargets();
- for (Version **I = VList; *I != 0 && Bad == true; I++)
+ for (Version **I = VList; *I != 0 && Bad == true; ++I)
{
VerIterator Ver(Cache,*I);
PkgIterator Pkg = Ver.ParentPkg();
@@ -444,7 +444,7 @@ bool pkgPackageManager::EarlyRemove(PkgIterator Pkg)
if (Pkg->CurrentVer != 0)
{
for (DepIterator D = Pkg.RevDependsList(); D.end() == false &&
- IsEssential == false; D++)
+ IsEssential == false; ++D)
if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
if ((D.ParentPkg()->Flags & pkgCache::Flag::Essential) != 0)
IsEssential = true;
@@ -564,7 +564,7 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate)
return _error->Error("Couldn't configure pre-depend %s for %s, "
"probably a dependency cycle.",
End.TargetPkg().Name(),Pkg.Name());
- Start++;
+ ++Start;
}
else
break;
@@ -597,7 +597,7 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate)
return false;
for (PrvIterator P = instVer.ProvidesList();
- P.end() == false; P++)
+ P.end() == false; ++P)
CheckRConflicts(Pkg,P.ParentPkg().RevDependsList(),P.ProvideVersion());
List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
@@ -652,7 +652,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
clog << "Done ordering" << endl;
bool DoneSomething = false;
- for (pkgOrderList::iterator I = List->begin(); I != List->end(); I++)
+ for (pkgOrderList::iterator I = List->begin(); I != List->end(); ++I)
{
PkgIterator Pkg(Cache,*I);
@@ -701,7 +701,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
return Failed;
// Sanity check
- for (pkgOrderList::iterator I = List->begin(); I != List->end(); I++)
+ for (pkgOrderList::iterator I = List->begin(); I != List->end(); ++I)
{
if (List->IsFlag(*I,pkgOrderList::Configured) == false)
{
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc
index 2b8cb6b86..faccafbef 100644
--- a/apt-pkg/pkgcache.cc
+++ b/apt-pkg/pkgcache.cc
@@ -180,7 +180,7 @@ bool pkgCache::ReMap(bool const &Errorchecks)
unsigned long pkgCache::sHash(const string &Str) const
{
unsigned long Hash = 0;
- for (string::const_iterator I = Str.begin(); I != Str.end(); I++)
+ for (string::const_iterator I = Str.begin(); I != Str.end(); ++I)
Hash = 5*Hash + tolower_ascii(*I);
return Hash % _count(HeaderP->PkgHashTable);
}
@@ -188,7 +188,7 @@ unsigned long pkgCache::sHash(const string &Str) const
unsigned long pkgCache::sHash(const char *Str) const
{
unsigned long Hash = 0;
- for (const char *I = Str; *I != 0; I++)
+ for (const char *I = Str; *I != 0; ++I)
Hash = 5*Hash + tolower_ascii(*I);
return Hash % _count(HeaderP->PkgHashTable);
}
@@ -574,7 +574,7 @@ bool pkgCache::DepIterator::SmartTargetPkg(PkgIterator &Result) const
virtual package libc-dev which is provided by libc5-dev and libc6-dev
we must ignore libc5-dev when considering the provides list. */
PrvIterator PStart = Result.ProvidesList();
- for (; PStart.end() != true && PStart.OwnerPkg() == ParentPkg(); PStart++);
+ for (; PStart.end() != true && PStart.OwnerPkg() == ParentPkg(); ++PStart);
// Nothing but indirect self provides
if (PStart.end() == true)
@@ -582,7 +582,7 @@ bool pkgCache::DepIterator::SmartTargetPkg(PkgIterator &Result) const
// Check for single packages in the provides list
PrvIterator P = PStart;
- for (; P.end() != true; P++)
+ for (; P.end() != true; ++P)
{
// Skip over self provides
if (P.OwnerPkg() == ParentPkg())
@@ -616,7 +616,7 @@ pkgCache::Version **pkgCache::DepIterator::AllTargets() const
PkgIterator DPkg = TargetPkg();
// Walk along the actual package providing versions
- for (VerIterator I = DPkg.VersionList(); I.end() == false; I++)
+ for (VerIterator I = DPkg.VersionList(); I.end() == false; ++I)
{
if (Owner->VS->CheckDep(I.VerStr(),S->CompareOp,TargetVer()) == false)
continue;
@@ -631,7 +631,7 @@ pkgCache::Version **pkgCache::DepIterator::AllTargets() const
}
// Follow all provides
- for (PrvIterator I = DPkg.ProvidesList(); I.end() == false; I++)
+ for (PrvIterator I = DPkg.ProvidesList(); I.end() == false; ++I)
{
if (Owner->VS->CheckDep(I.ProvideVersion(),S->CompareOp,TargetVer()) == false)
continue;
@@ -722,7 +722,7 @@ int pkgCache::VerIterator::CompareVer(const VerIterator &B) const
/* Start at A and look for B. If B is found then A > B otherwise
B was before A so A < B */
VerIterator I = *this;
- for (;I.end() == false; I++)
+ for (;I.end() == false; ++I)
if (I == B)
return 1;
return -1;
@@ -734,7 +734,7 @@ int pkgCache::VerIterator::CompareVer(const VerIterator &B) const
bool pkgCache::VerIterator::Downloadable() const
{
VerFileIterator Files = FileList();
- for (; Files.end() == false; Files++)
+ for (; Files.end() == false; ++Files)
if ((Files.File()->Flags & pkgCache::Flag::NotSource) != pkgCache::Flag::NotSource)
return true;
return false;
@@ -747,7 +747,7 @@ bool pkgCache::VerIterator::Downloadable() const
bool pkgCache::VerIterator::Automatic() const
{
VerFileIterator Files = FileList();
- for (; Files.end() == false; Files++)
+ for (; Files.end() == false; ++Files)
// Do not check ButAutomaticUpgrades here as it is kind of automatic…
if ((Files.File()->Flags & pkgCache::Flag::NotAutomatic) != pkgCache::Flag::NotAutomatic)
return true;
@@ -762,7 +762,7 @@ pkgCache::VerFileIterator pkgCache::VerIterator::NewestFile() const
{
VerFileIterator Files = FileList();
VerFileIterator Highest = Files;
- for (; Files.end() == false; Files++)
+ for (; Files.end() == false; ++Files)
{
if (Owner->VS->CmpReleaseVer(Files.File().Version(),Highest.File().Version()) > 0)
Highest = Files;
@@ -779,7 +779,7 @@ string pkgCache::VerIterator::RelStr() const
{
bool First = true;
string Res;
- for (pkgCache::VerFileIterator I = this->FileList(); I.end() == false; I++)
+ for (pkgCache::VerFileIterator I = this->FileList(); I.end() == false; ++I)
{
// Do not print 'not source' entries'
pkgCache::PkgFileIterator File = I.File();
@@ -788,7 +788,7 @@ string pkgCache::VerIterator::RelStr() const
// See if we have already printed this out..
bool Seen = false;
- for (pkgCache::VerFileIterator J = this->FileList(); I != J; J++)
+ for (pkgCache::VerFileIterator J = this->FileList(); I != J; ++J)
{
pkgCache::PkgFileIterator File2 = J.File();
if (File2->Label == 0 || File->Label == 0)
@@ -889,7 +889,7 @@ pkgCache::DescIterator pkgCache::VerIterator::TranslatedDescription() const
{
std::vector<string> const lang = APT::Configuration::getLanguages();
for (std::vector<string>::const_iterator l = lang.begin();
- l != lang.end(); l++)
+ l != lang.end(); ++l)
{
pkgCache::DescIterator Desc = DescriptionList();
for (; Desc.end() == false; ++Desc)
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index 3c21b2442..f41bb5a0a 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -221,7 +221,7 @@ bool pkgCacheGenerator::MergeList(ListParser &List,
// 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;
@@ -230,7 +230,7 @@ bool pkgCacheGenerator::MergeList(ListParser &List,
for (Desc = Ver.DescriptionList();
Desc.end() == false;
- LastDesc = &Desc->NextDesc, Desc++)
+ LastDesc = &Desc->NextDesc, ++Desc)
{
if (MD5SumValue(Desc.md5()) == CurMd5)
{
@@ -396,7 +396,7 @@ bool pkgCacheGenerator::MergeFileProvides(ListParser &List)
unsigned long Hash = List.VersionHash();
pkgCache::VerIterator Ver = Pkg.VersionList();
Dynamic<pkgCache::VerIterator> DynVer(Ver);
- for (; Ver.end() == false; Ver++)
+ for (; Ver.end() == false; ++Ver)
{
if (Ver->Hash == Hash && Version.c_str() == Ver.VerStr())
{
@@ -512,7 +512,7 @@ bool pkgCacheGenerator::NewFileVer(pkgCache::VerIterator &Ver,
// 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();
@@ -569,7 +569,7 @@ bool pkgCacheGenerator::NewFileDesc(pkgCache::DescIterator &Desc,
// 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;
@@ -624,7 +624,7 @@ bool pkgCacheGenerator::FinishCache(OpProgress *Progress)
// Create Conflicts in between the group
pkgCache::GrpIterator G = GetCache().GrpBegin();
Dynamic<pkgCache::GrpIterator> DynG(G);
- for (; G.end() != true; G++)
+ for (; G.end() != true; ++G)
{
string const PkgName = G.Name();
pkgCache::PkgIterator P = G.PackageList();
@@ -635,7 +635,7 @@ bool pkgCacheGenerator::FinishCache(OpProgress *Progress)
Dynamic<pkgCache::PkgIterator> DynallPkg(allPkg);
pkgCache::VerIterator V = P.VersionList();
Dynamic<pkgCache::VerIterator> 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
@@ -729,7 +729,7 @@ bool pkgCacheGenerator::NewDepends(pkgCache::PkgIterator &Pkg,
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;
@@ -936,7 +936,7 @@ static bool CheckValidity(const string &CacheFile,
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;
@@ -959,7 +959,7 @@ static bool CheckValidity(const string &CacheFile,
verify the IMS data and check that it is on the disk too.. */
SPtrArray<bool> 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() << ": ";
@@ -1026,7 +1026,7 @@ static bool CheckValidity(const string &CacheFile,
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;
@@ -1044,7 +1044,7 @@ static bool BuildCache(pkgCacheGenerator &Gen,
FileIterator Start, FileIterator End)
{
FileIterator I;
- for (I = Start; I != End; I++)
+ for (I = Start; I != End; ++I)
{
if ((*I)->HasPackages() == false)
continue;
@@ -1074,7 +1074,7 @@ static bool BuildCache(pkgCacheGenerator &Gen,
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)
@@ -1121,12 +1121,12 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress
vector<pkgIndexFile *> Files;
for (vector<metaIndex *>::const_iterator i = List.begin();
i != List.end();
- i++)
+ ++i)
{
vector <pkgIndexFile *> *Indexes = (*i)->GetIndexFiles();
for (vector<pkgIndexFile *>::const_iterator j = Indexes->begin();
j != Indexes->end();
- j++)
+ ++j)
Files.push_back (*j);
}
diff --git a/apt-pkg/pkgrecords.cc b/apt-pkg/pkgrecords.cc
index e506de73a..1a7585d8f 100644
--- a/apt-pkg/pkgrecords.cc
+++ b/apt-pkg/pkgrecords.cc
@@ -24,7 +24,7 @@ pkgRecords::pkgRecords(pkgCache &Cache) : Cache(Cache),
Files(Cache.HeaderP->PackageFileCount)
{
for (pkgCache::PkgFileIterator I = Cache.FileBegin();
- I.end() == false; I++)
+ I.end() == false; ++I)
{
const pkgIndexFile::Type *Type = pkgIndexFile::Type::GetType(I.IndexType());
if (Type == 0)
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc
index 2c22fe0da..0cc77e0af 100644
--- a/apt-pkg/policy.cc
+++ b/apt-pkg/policy.cc
@@ -81,7 +81,7 @@ pkgPolicy::pkgPolicy(pkgCache *Owner) : Pins(0), PFPriority(0), Cache(Owner)
bool pkgPolicy::InitDefaults()
{
// Initialize the priorities based on the status of the package file
- for (pkgCache::PkgFileIterator I = Cache->FileBegin(); I != Cache->FileEnd(); I++)
+ for (pkgCache::PkgFileIterator I = Cache->FileBegin(); I != Cache->FileEnd(); ++I)
{
PFPriority[I->ID] = 500;
if ((I->Flags & pkgCache::Flag::NotSource) == pkgCache::Flag::NotSource)
@@ -98,10 +98,10 @@ bool pkgPolicy::InitDefaults()
signed Cur = 989;
StatusOverride = false;
for (vector<Pin>::const_iterator I = Defaults.begin(); I != Defaults.end();
- I++, Cur--)
+ ++I, --Cur)
{
pkgVersionMatch Match(I->Data,I->Type);
- for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F != Cache->FileEnd(); F++)
+ for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F != Cache->FileEnd(); ++F)
{
if (Match.FileMatch(F) == true && Fixed[F->ID] == false)
{
@@ -122,7 +122,7 @@ bool pkgPolicy::InitDefaults()
}
if (_config->FindB("Debug::pkgPolicy",false) == true)
- for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F != Cache->FileEnd(); F++)
+ for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F != Cache->FileEnd(); ++F)
std::clog << "Prio of " << F.FileName() << ' ' << PFPriority[F->ID] << std::endl;
return true;
@@ -162,12 +162,12 @@ pkgCache::VerIterator pkgPolicy::GetCandidateVer(pkgCache::PkgIterator const &Pk
tracks the default when the default is taken away, and a permanent
pin that stays at that setting.
*/
- for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; Ver++)
+ for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; ++Ver)
{
/* Lets see if this version is the installed version */
bool instVer = (Pkg.CurrentVer() == Ver);
- for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; VF++)
+ for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; ++VF)
{
/* If this is the status file, and the current version is not the
version in the status file (ie it is not installed, or somesuch)
@@ -360,7 +360,7 @@ bool ReadPinDir(pkgPolicy &Plcy,string Dir)
vector<string> const List = GetListOfFilesInDir(Dir, "pref", true, true);
// Read the files
- for (vector<string>::const_iterator I = List.begin(); I != List.end(); I++)
+ for (vector<string>::const_iterator I = List.begin(); I != List.end(); ++I)
if (ReadPinFile(Plcy, *I) == false)
return false;
return true;
diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc
index aaff16316..47800b0c2 100644
--- a/apt-pkg/sourcelist.cc
+++ b/apt-pkg/sourcelist.cc
@@ -173,7 +173,7 @@ pkgSourceList::pkgSourceList(string File)
/* */
pkgSourceList::~pkgSourceList()
{
- for (const_iterator I = SrcList.begin(); I != SrcList.end(); I++)
+ for (const_iterator I = SrcList.begin(); I != SrcList.end(); ++I)
delete *I;
}
/*}}}*/
@@ -218,7 +218,7 @@ bool pkgSourceList::ReadMainList()
/* */
void pkgSourceList::Reset()
{
- for (const_iterator I = SrcList.begin(); I != SrcList.end(); I++)
+ for (const_iterator I = SrcList.begin(); I != SrcList.end(); ++I)
delete *I;
SrcList.erase(SrcList.begin(),SrcList.end());
}
@@ -296,11 +296,11 @@ bool pkgSourceList::ReadAppend(string File)
bool pkgSourceList::FindIndex(pkgCache::PkgFileIterator File,
pkgIndexFile *&Found) const
{
- for (const_iterator I = SrcList.begin(); I != SrcList.end(); I++)
+ for (const_iterator I = SrcList.begin(); I != SrcList.end(); ++I)
{
vector<pkgIndexFile *> *Indexes = (*I)->GetIndexFiles();
for (vector<pkgIndexFile *>::const_iterator J = Indexes->begin();
- J != Indexes->end(); J++)
+ J != Indexes->end(); ++J)
{
if ((*J)->FindInCache(*File.Cache()) == File)
{
@@ -318,7 +318,7 @@ bool pkgSourceList::FindIndex(pkgCache::PkgFileIterator File,
/* */
bool pkgSourceList::GetIndexes(pkgAcquire *Owner, bool GetAll) const
{
- for (const_iterator I = SrcList.begin(); I != SrcList.end(); I++)
+ for (const_iterator I = SrcList.begin(); I != SrcList.end(); ++I)
if ((*I)->GetIndexes(Owner,GetAll) == false)
return false;
return true;
@@ -334,7 +334,7 @@ bool pkgSourceList::ReadSourceDir(string Dir)
vector<string> const List = GetListOfFilesInDir(Dir, "list", true);
// Read the files
- for (vector<string>::const_iterator I = List.begin(); I != List.end(); I++)
+ for (vector<string>::const_iterator I = List.begin(); I != List.end(); ++I)
if (ReadAppend(*I) == false)
return false;
return true;
@@ -357,7 +357,7 @@ time_t pkgSourceList::GetLastModifiedTime()
// calculate the time
time_t mtime_sources = GetModificationTime(Main);
- for (vector<string>::const_iterator I = List.begin(); I != List.end(); I++)
+ for (vector<string>::const_iterator I = List.begin(); I != List.end(); ++I)
mtime_sources = std::max(mtime_sources, GetModificationTime(*I));
return mtime_sources;
diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc
index 46a02b55c..946ac1a1a 100644
--- a/apt-pkg/srcrecords.cc
+++ b/apt-pkg/srcrecords.cc
@@ -24,11 +24,11 @@
/* Open all the source index files */
pkgSrcRecords::pkgSrcRecords(pkgSourceList &List) : Files(0), Current(0)
{
- for (pkgSourceList::const_iterator I = List.begin(); I != List.end(); I++)
+ for (pkgSourceList::const_iterator I = List.begin(); I != List.end(); ++I)
{
vector<pkgIndexFile *> *Indexes = (*I)->GetIndexFiles();
for (vector<pkgIndexFile *>::const_iterator J = Indexes->begin();
- J != Indexes->end(); J++)
+ J != Indexes->end(); ++J)
{
Parser* P = (*J)->CreateSrcParser();
if (_error->PendingError() == true)
@@ -66,7 +66,7 @@ bool pkgSrcRecords::Restart()
{
Current = Files.begin();
for (vector<Parser*>::iterator I = Files.begin();
- I != Files.end(); I++)
+ I != Files.end(); ++I)
(*I)->Restart();
return true;
@@ -89,7 +89,7 @@ pkgSrcRecords::Parser *pkgSrcRecords::Find(const char *Package,bool const &SrcOn
{
if (_error->PendingError() == true)
return 0;
- Current++;
+ ++Current;
if (Current == Files.end())
return 0;
}
@@ -107,7 +107,7 @@ pkgSrcRecords::Parser *pkgSrcRecords::Find(const char *Package,bool const &SrcOn
// Check for a binary hit
const char **I = (*Current)->Binaries();
- for (; I != 0 && *I != 0; I++)
+ for (; I != 0 && *I != 0; ++I)
if (strcmp(Package,*I) == 0)
return *Current;
}
diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h
index 23f5c57e6..3a2dee7c7 100644
--- a/apt-pkg/tagfile.h
+++ b/apt-pkg/tagfile.h
@@ -78,7 +78,7 @@ class pkgTagSection
Stop = this->Stop;
};
- pkgTagSection() : Section(0), Stop(0) {};
+ pkgTagSection() : Section(0), TagCount(0), Stop(0) {};
virtual ~pkgTagSection() {};
};
diff --git a/apt-pkg/vendorlist.cc b/apt-pkg/vendorlist.cc
index 48ac12cee..4cc500727 100644
--- a/apt-pkg/vendorlist.cc
+++ b/apt-pkg/vendorlist.cc
@@ -11,7 +11,7 @@
pkgVendorList::~pkgVendorList()
{
for (vector<const Vendor *>::const_iterator I = VendorList.begin();
- I != VendorList.end(); I++)
+ I != VendorList.end(); ++I)
delete *I;
}
@@ -49,7 +49,7 @@ bool pkgVendorList::Read(string File) /*{{{*/
bool pkgVendorList::CreateList(Configuration& Cnf) /*{{{*/
{
for (vector<const Vendor *>::const_iterator I = VendorList.begin();
- I != VendorList.end(); I++)
+ I != VendorList.end(); ++I)
delete *I;
VendorList.erase(VendorList.begin(),VendorList.end());
@@ -129,7 +129,7 @@ const Vendor* pkgVendorList::LookupFingerprint(string Fingerprint) /*{{{*/
/*}}}*/
const Vendor* pkgVendorList::FindVendor(const std::vector<string> GPGVOutput) /*{{{*/
{
- for (std::vector<string>::const_iterator I = GPGVOutput.begin(); I != GPGVOutput.end(); I++)
+ for (std::vector<string>::const_iterator I = GPGVOutput.begin(); I != GPGVOutput.end(); ++I)
{
string::size_type pos = (*I).find("VALIDSIG ");
if (_config->FindB("Debug::Vendor", false))
diff --git a/apt-pkg/versionmatch.cc b/apt-pkg/versionmatch.cc
index c40b1fdbc..6d667acad 100644
--- a/apt-pkg/versionmatch.cc
+++ b/apt-pkg/versionmatch.cc
@@ -60,7 +60,7 @@ pkgVersionMatch::pkgVersionMatch(string Data,MatchType Type) : Type(Type)
// Are we a simple specification?
string::const_iterator I = Data.begin();
- for (; I != Data.end() && *I != '='; I++);
+ for (; I != Data.end() && *I != '='; ++I);
if (I == Data.end())
{
// Temporary
@@ -152,7 +152,7 @@ bool pkgVersionMatch::MatchVer(const char *A,string B,bool Prefix)
pkgCache::VerIterator pkgVersionMatch::Find(pkgCache::PkgIterator Pkg)
{
pkgCache::VerIterator Ver = Pkg.VersionList();
- for (; Ver.end() == false; Ver++)
+ for (; Ver.end() == false; ++Ver)
{
if (Type == Version)
{
@@ -163,7 +163,7 @@ pkgCache::VerIterator pkgVersionMatch::Find(pkgCache::PkgIterator Pkg)
continue;
}
- for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; VF++)
+ for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; ++VF)
if (FileMatch(VF.File()) == true)
return Ver;
}
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index 232bb93ec..db5475227 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -141,7 +141,7 @@ bool ShowUnMet(pkgCache::VerIterator const &V, bool const &Important)
if (Start == End)
break;
- Start++;
+ ++Start;
}
while (1);
@@ -169,7 +169,7 @@ bool ShowUnMet(pkgCache::VerIterator const &V, bool const &Important)
if (Start == End)
break;
cout << " | ";
- Start++;
+ ++Start;
}
while (1);
@@ -187,7 +187,7 @@ bool UnMet(CommandLine &CmdL)
if (CmdL.FileSize() <= 1)
{
- for (pkgCache::PkgIterator P = CacheFile.GetPkgCache()->PkgBegin(); P.end() == false; P++)
+ for (pkgCache::PkgIterator P = CacheFile.GetPkgCache()->PkgBegin(); P.end() == false; ++P)
for (pkgCache::VerIterator V = P.VersionList(); V.end() == false; ++V)
if (ShowUnMet(V, Important) == false)
return false;
@@ -217,13 +217,13 @@ bool DumpPackage(CommandLine &CmdL)
{
cout << "Package: " << Pkg.FullName(true) << endl;
cout << "Versions: " << endl;
- for (pkgCache::VerIterator Cur = Pkg.VersionList(); Cur.end() != true; Cur++)
+ for (pkgCache::VerIterator Cur = Pkg.VersionList(); Cur.end() != true; ++Cur)
{
cout << Cur.VerStr();
- for (pkgCache::VerFileIterator Vf = Cur.FileList(); Vf.end() == false; Vf++)
+ for (pkgCache::VerFileIterator Vf = Cur.FileList(); Vf.end() == false; ++Vf)
cout << " (" << Vf.File().FileName() << ")";
cout << endl;
- for (pkgCache::DescIterator D = Cur.DescriptionList(); D.end() == false; D++)
+ for (pkgCache::DescIterator D = Cur.DescriptionList(); D.end() == false; ++D)
{
cout << " Description Language: " << D.LanguageCode() << endl
<< " File: " << D.FileList().File().FileName() << endl
@@ -235,7 +235,7 @@ bool DumpPackage(CommandLine &CmdL)
cout << endl;
cout << "Reverse Depends: " << endl;
- for (pkgCache::DepIterator D = Pkg.RevDependsList(); D.end() != true; D++)
+ for (pkgCache::DepIterator D = Pkg.RevDependsList(); D.end() != true; ++D)
{
cout << " " << D.ParentPkg().FullName(true) << ',' << D.TargetPkg().FullName(true);
if (D->Version != 0)
@@ -245,24 +245,24 @@ bool DumpPackage(CommandLine &CmdL)
}
cout << "Dependencies: " << endl;
- for (pkgCache::VerIterator Cur = Pkg.VersionList(); Cur.end() != true; Cur++)
+ for (pkgCache::VerIterator Cur = Pkg.VersionList(); Cur.end() != true; ++Cur)
{
cout << Cur.VerStr() << " - ";
- for (pkgCache::DepIterator Dep = Cur.DependsList(); Dep.end() != true; Dep++)
+ for (pkgCache::DepIterator Dep = Cur.DependsList(); Dep.end() != true; ++Dep)
cout << Dep.TargetPkg().FullName(true) << " (" << (int)Dep->CompareOp << " " << DeNull(Dep.TargetVer()) << ") ";
cout << endl;
}
cout << "Provides: " << endl;
- for (pkgCache::VerIterator Cur = Pkg.VersionList(); Cur.end() != true; Cur++)
+ for (pkgCache::VerIterator Cur = Pkg.VersionList(); Cur.end() != true; ++Cur)
{
cout << Cur.VerStr() << " - ";
- for (pkgCache::PrvIterator Prv = Cur.ProvidesList(); Prv.end() != true; Prv++)
+ for (pkgCache::PrvIterator Prv = Cur.ProvidesList(); Prv.end() != true; ++Prv)
cout << Prv.ParentPkg().FullName(true) << " ";
cout << endl;
}
cout << "Reverse Provides: " << endl;
- for (pkgCache::PrvIterator Prv = Pkg.ProvidesList(); Prv.end() != true; Prv++)
+ for (pkgCache::PrvIterator Prv = Pkg.ProvidesList(); Prv.end() != true; ++Prv)
cout << Prv.OwnerPkg().FullName(true) << " " << Prv.OwnerVer().VerStr() << endl;
}
@@ -290,7 +290,7 @@ bool Stats(CommandLine &Cmd)
int DVirt = 0;
int Missing = 0;
pkgCache::PkgIterator I = Cache->PkgBegin();
- for (;I.end() != true; I++)
+ for (;I.end() != true; ++I)
{
if (I->VersionList != 0 && I->ProvidesList == 0)
{
@@ -353,11 +353,11 @@ bool Stats(CommandLine &Cmd)
cout << _("Total globbed strings: ") << Count << " (" << SizeToStr(Size) << ')' << endl;
unsigned long DepVerSize = 0;
- for (pkgCache::PkgIterator P = Cache->PkgBegin(); P.end() == false; P++)
+ for (pkgCache::PkgIterator P = Cache->PkgBegin(); P.end() == false; ++P)
{
- for (pkgCache::VerIterator V = P.VersionList(); V.end() == false; V++)
+ for (pkgCache::VerIterator V = P.VersionList(); V.end() == false; ++V)
{
- for (pkgCache::DepIterator D = V.DependsList(); D.end() == false; D++)
+ for (pkgCache::DepIterator D = V.DependsList(); D.end() == false; ++D)
{
if (D->Version != 0)
DepVerSize += strlen(D.TargetVer()) + 1;
@@ -394,17 +394,17 @@ bool Dump(CommandLine &Cmd)
cout << "Using Versioning System: " << Cache->VS->Label << endl;
- for (pkgCache::PkgIterator P = Cache->PkgBegin(); P.end() == false; P++)
+ for (pkgCache::PkgIterator P = Cache->PkgBegin(); P.end() == false; ++P)
{
cout << "Package: " << P.FullName(true) << endl;
- for (pkgCache::VerIterator V = P.VersionList(); V.end() == false; V++)
+ for (pkgCache::VerIterator V = P.VersionList(); V.end() == false; ++V)
{
cout << " Version: " << V.VerStr() << endl;
cout << " File: " << V.FileList().File().FileName() << endl;
- for (pkgCache::DepIterator D = V.DependsList(); D.end() == false; D++)
+ for (pkgCache::DepIterator D = V.DependsList(); D.end() == false; ++D)
cout << " Depends: " << D.TargetPkg().FullName(true) << ' ' <<
DeNull(D.TargetVer()) << endl;
- for (pkgCache::DescIterator D = V.DescriptionList(); D.end() == false; D++)
+ for (pkgCache::DescIterator D = V.DescriptionList(); D.end() == false; ++D)
{
cout << " Description Language: " << D.LanguageCode() << endl
<< " File: " << D.FileList().File().FileName() << endl
@@ -413,7 +413,7 @@ bool Dump(CommandLine &Cmd)
}
}
- for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F.end() == false; F++)
+ for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F.end() == false; ++F)
{
cout << "File: " << F.FileName() << endl;
cout << " Type: " << F.IndexType() << endl;
@@ -449,7 +449,7 @@ bool DumpAvail(CommandLine &Cmd)
memset(VFList,0,sizeof(*VFList)*Count);
// Map versions that we want to write out onto the VerList array.
- for (pkgCache::PkgIterator P = Cache->PkgBegin(); P.end() == false; P++)
+ for (pkgCache::PkgIterator P = Cache->PkgBegin(); P.end() == false; ++P)
{
if (P->VersionList == 0)
continue;
@@ -466,7 +466,7 @@ bool DumpAvail(CommandLine &Cmd)
}
pkgCache::VerFileIterator VF = V.FileList();
- for (; VF.end() == false ; VF++)
+ for (; VF.end() == false ; ++VF)
if ((VF.File()->Flags & pkgCache::Flag::NotSource) == 0)
break;
@@ -480,9 +480,9 @@ bool DumpAvail(CommandLine &Cmd)
handling works OK. */
if (VF.end() == true)
{
- for (pkgCache::VerIterator Cur = P.VersionList(); Cur.end() != true; Cur++)
+ for (pkgCache::VerIterator Cur = P.VersionList(); Cur.end() != true; ++Cur)
{
- for (VF = Cur.FileList(); VF.end() == false; VF++)
+ for (VF = Cur.FileList(); VF.end() == false; ++VF)
{
if ((VF.File()->Flags & pkgCache::Flag::NotSource) == 0)
{
@@ -615,7 +615,7 @@ bool ShowDepends(CommandLine &CmdL, bool const RevDepends)
if (RevDepends == true)
cout << "Reverse Depends:" << endl;
for (pkgCache::DepIterator D = RevDepends ? Pkg.RevDependsList() : Ver.DependsList();
- D.end() == false; D++)
+ D.end() == false; ++D)
{
switch (D->Type) {
case pkgCache::Dep::PreDepends: if (!ShowPreDepends) continue; break;
@@ -741,7 +741,7 @@ bool XVcg(CommandLine &CmdL)
memset(Flags,0,sizeof(*Flags)*Cache->Head().PackageCount);
// Map the shapes
- for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; Pkg++)
+ for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; ++Pkg)
{
if (Pkg->VersionList == 0)
{
@@ -788,7 +788,7 @@ bool XVcg(CommandLine &CmdL)
while (Act == true)
{
Act = false;
- for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; Pkg++)
+ for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; ++Pkg)
{
// See we need to show this package
if (Show[Pkg->ID] == None || Show[Pkg->ID] >= DoneNR)
@@ -814,14 +814,14 @@ bool XVcg(CommandLine &CmdL)
continue;
pkgCache::VerIterator Ver = Pkg.VersionList();
- for (pkgCache::DepIterator D = Ver.DependsList(); D.end() == false; D++)
+ for (pkgCache::DepIterator D = Ver.DependsList(); D.end() == false; ++D)
{
// See if anything can meet this dep
// Walk along the actual package providing versions
bool Hit = false;
pkgCache::PkgIterator DPkg = D.TargetPkg();
for (pkgCache::VerIterator I = DPkg.VersionList();
- I.end() == false && Hit == false; I++)
+ I.end() == false && Hit == false; ++I)
{
if (Cache->VS->CheckDep(I.VerStr(),D->CompareOp,D.TargetVer()) == true)
Hit = true;
@@ -829,7 +829,7 @@ bool XVcg(CommandLine &CmdL)
// Follow all provides
for (pkgCache::PrvIterator I = DPkg.ProvidesList();
- I.end() == false && Hit == false; I++)
+ I.end() == false && Hit == false; ++I)
{
if (Cache->VS->CheckDep(I.ProvideVersion(),D->CompareOp,D.TargetVer()) == false)
Hit = true;
@@ -889,7 +889,7 @@ bool XVcg(CommandLine &CmdL)
/* Draw the box colours after the fact since we can not tell what colour
they should be until everything is finished drawing */
- for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; Pkg++)
+ for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; ++Pkg)
{
if (Show[Pkg->ID] < DoneNR)
continue;
@@ -953,7 +953,7 @@ bool Dotty(CommandLine &CmdL)
memset(Flags,0,sizeof(*Flags)*Cache->Head().PackageCount);
// Map the shapes
- for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; Pkg++)
+ for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; ++Pkg)
{
if (Pkg->VersionList == 0)
{
@@ -1000,7 +1000,7 @@ bool Dotty(CommandLine &CmdL)
while (Act == true)
{
Act = false;
- for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; Pkg++)
+ for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; ++Pkg)
{
// See we need to show this package
if (Show[Pkg->ID] == None || Show[Pkg->ID] >= DoneNR)
@@ -1024,14 +1024,14 @@ bool Dotty(CommandLine &CmdL)
continue;
pkgCache::VerIterator Ver = Pkg.VersionList();
- for (pkgCache::DepIterator D = Ver.DependsList(); D.end() == false; D++)
+ for (pkgCache::DepIterator D = Ver.DependsList(); D.end() == false; ++D)
{
// See if anything can meet this dep
// Walk along the actual package providing versions
bool Hit = false;
pkgCache::PkgIterator DPkg = D.TargetPkg();
for (pkgCache::VerIterator I = DPkg.VersionList();
- I.end() == false && Hit == false; I++)
+ I.end() == false && Hit == false; ++I)
{
if (Cache->VS->CheckDep(I.VerStr(),D->CompareOp,D.TargetVer()) == true)
Hit = true;
@@ -1039,7 +1039,7 @@ bool Dotty(CommandLine &CmdL)
// Follow all provides
for (pkgCache::PrvIterator I = DPkg.ProvidesList();
- I.end() == false && Hit == false; I++)
+ I.end() == false && Hit == false; ++I)
{
if (Cache->VS->CheckDep(I.ProvideVersion(),D->CompareOp,D.TargetVer()) == false)
Hit = true;
@@ -1094,7 +1094,7 @@ bool Dotty(CommandLine &CmdL)
/* Draw the box colours after the fact since we can not tell what colour
they should be until everything is finished drawing */
- for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; Pkg++)
+ for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; ++Pkg)
{
if (Show[Pkg->ID] < DoneNR)
continue;
@@ -1127,7 +1127,7 @@ bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V)
// Find an appropriate file
pkgCache::VerFileIterator Vf = V.FileList();
- for (; Vf.end() == false; Vf++)
+ for (; Vf.end() == false; ++Vf)
if ((Vf.File()->Flags & pkgCache::Flag::NotSource) == 0)
break;
if (Vf.end() == true)
@@ -1272,7 +1272,7 @@ bool Search(CommandLine &CmdL)
continue;
// Include all the packages that provide matching names too
- for (pkgCache::PrvIterator Prv = P.ProvidesList() ; Prv.end() == false; Prv++)
+ for (pkgCache::PrvIterator Prv = P.ProvidesList() ; Prv.end() == false; ++Prv)
{
pkgCache::VerIterator V = Plcy->GetCandidateVer(Prv.OwnerPkg());
if (V.end() == true)
@@ -1341,13 +1341,13 @@ bool ShowAuto(CommandLine &CmdL)
std::vector<string> packages;
packages.reserve(Cache->HeaderP->PackageCount / 3);
- for (pkgCache::PkgIterator P = Cache->PkgBegin(); P.end() == false; P++)
+ for (pkgCache::PkgIterator P = Cache->PkgBegin(); P.end() == false; ++P)
if ((*DepCache)[P].Flags & pkgCache::Flag::Auto)
packages.push_back(P.Name());
std::sort(packages.begin(), packages.end());
- for (vector<string>::iterator I = packages.begin(); I != packages.end(); I++)
+ for (vector<string>::iterator I = packages.begin(); I != packages.end(); ++I)
cout << *I << "\n";
_error->Notice(_("This command is deprecated. Please use 'apt-mark showauto' instead."));
@@ -1391,7 +1391,7 @@ bool ShowPkgNames(CommandLine &CmdL)
if (CmdL.FileList[1] != 0)
{
- for (;I.end() != true; I++)
+ for (;I.end() != true; ++I)
{
if (All == false && I->FirstPackage == 0)
continue;
@@ -1405,7 +1405,7 @@ bool ShowPkgNames(CommandLine &CmdL)
}
// Show all pkgs
- for (;I.end() != true; I++)
+ for (;I.end() != true; ++I)
{
if (All == false && I->FirstPackage == 0)
continue;
@@ -1476,7 +1476,7 @@ bool Policy(CommandLine &CmdL)
if (CmdL.FileList[1] == 0)
{
cout << _("Package files:") << endl;
- for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F.end() == false; F++)
+ for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F.end() == false; ++F)
{
// Locate the associated index files so we can derive a description
pkgIndexFile *Indx;
@@ -1498,7 +1498,7 @@ bool Policy(CommandLine &CmdL)
// Show any packages have explicit pins
cout << _("Pinned packages:") << endl;
pkgCache::PkgIterator I = Cache->PkgBegin();
- for (;I.end() != true; I++)
+ for (;I.end() != true; ++I)
{
if (Plcy->GetPriority(I) == 0)
continue;
@@ -1560,14 +1560,14 @@ bool Policy(CommandLine &CmdL)
// Show the priority tables
cout << _(" Version table:") << endl;
- for (V = Pkg.VersionList(); V.end() == false; V++)
+ for (V = Pkg.VersionList(); V.end() == false; ++V)
{
if (Pkg.CurrentVer() == V)
cout << " *** " << V.VerStr();
else
cout << " " << V.VerStr();
cout << " " << Plcy->GetPriority(Pkg) << endl;
- for (pkgCache::VerFileIterator VF = V.FileList(); VF.end() == false; VF++)
+ for (pkgCache::VerFileIterator VF = V.FileList(); VF.end() == false; ++VF)
{
// Locate the associated index files so we can derive a description
pkgIndexFile *Indx;
@@ -1607,9 +1607,9 @@ bool Madison(CommandLine &CmdL)
APT::PackageSet pkgset = APT::PackageSet::FromString(CacheFile, *I, helper);
for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg)
{
- for (pkgCache::VerIterator V = Pkg.VersionList(); V.end() == false; V++)
+ for (pkgCache::VerIterator V = Pkg.VersionList(); V.end() == false; ++V)
{
- for (pkgCache::VerFileIterator VF = V.FileList(); VF.end() == false; VF++)
+ for (pkgCache::VerFileIterator VF = V.FileList(); VF.end() == false; ++VF)
{
// This might be nice, but wouldn't uniquely identify the source -mdz
// if (VF.File().Archive() != 0)
@@ -1619,11 +1619,11 @@ bool Madison(CommandLine &CmdL)
// }
// Locate the associated index files so we can derive a description
- for (pkgSourceList::const_iterator S = SrcList->begin(); S != SrcList->end(); S++)
+ for (pkgSourceList::const_iterator S = SrcList->begin(); S != SrcList->end(); ++S)
{
vector<pkgIndexFile *> *Indexes = (*S)->GetIndexFiles();
for (vector<pkgIndexFile *>::const_iterator IF = Indexes->begin();
- IF != Indexes->end(); IF++)
+ IF != Indexes->end(); ++IF)
{
if ((*IF)->FindInCache(*(VF.File().Cache())) == VF.File())
{
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index a81e829e8..4a05648fa 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -368,7 +368,7 @@ void ShowBroken(ostream &out,CacheFile &Cache,bool Now)
if (Start == End)
break;
- Start++;
+ ++Start;
}
}
}
@@ -542,7 +542,7 @@ bool ShowEssential(ostream &out,CacheFile &Cache)
continue;
// Print out any essential package depenendents that are to be removed
- for (pkgCache::DepIterator D = I.CurrentVer().DependsList(); D.end() == false; D++)
+ for (pkgCache::DepIterator D = I.CurrentVer().DependsList(); D.end() == false; ++D)
{
// Skip everything but depends
if (D->Type != pkgCache::Dep::PreDepends &&
@@ -579,7 +579,7 @@ void Stats(ostream &out,pkgDepCache &Dep)
unsigned long Downgrade = 0;
unsigned long Install = 0;
unsigned long ReInstall = 0;
- for (pkgCache::PkgIterator I = Dep.PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Dep.PkgBegin(); I.end() == false; ++I)
{
if (Dep[I].NewInstall() == true)
Install++;
@@ -671,7 +671,7 @@ public:
}
// if we found no candidate which provide this package, show non-candidates
if (provider == 0)
- for (I = Pkg.ProvidesList(); I.end() == false; I++)
+ for (I = Pkg.ProvidesList(); I.end() == false; ++I)
out << " " << I.OwnerPkg().FullName(true) << " " << I.OwnerVer().VerStr()
<< _(" [Not candidate version]") << endl;
else
@@ -687,7 +687,7 @@ public:
SPtrArray<bool> Seen = new bool[Cache.GetPkgCache()->Head().PackageCount];
memset(Seen,0,Cache.GetPkgCache()->Head().PackageCount*sizeof(*Seen));
for (pkgCache::DepIterator Dep = Pkg.RevDependsList();
- Dep.end() == false; Dep++) {
+ Dep.end() == false; ++Dep) {
if (Dep->Type != pkgCache::Dep::Replaces)
continue;
if (Seen[Dep.ParentPkg()->ID] == true)
@@ -874,9 +874,7 @@ struct TryToInstall {
struct TryToRemove {
pkgCacheFile* Cache;
pkgProblemResolver* Fix;
- bool FixBroken;
bool PurgePkgs;
- unsigned long AutoMarkChanged;
TryToRemove(pkgCacheFile &Cache, pkgProblemResolver *PM) : Cache(&Cache), Fix(PM),
PurgePkgs(_config->FindB("APT::Get::Purge", false)) {};
@@ -928,7 +926,7 @@ void CacheFile::Sort()
List = new pkgCache::Package *[Cache->Head().PackageCount];
memset(List,0,sizeof(*List)*Cache->Head().PackageCount);
pkgCache::PkgIterator I = Cache->PkgBegin();
- for (;I.end() != true; I++)
+ for (;I.end() != true; ++I)
List[I->ID] = I;
SortCache = *this;
@@ -960,7 +958,7 @@ bool CacheFile::CheckDeps(bool AllowBroken)
if ((DCache->PolicyBrokenCount() > 0))
{
// upgrade all policy-broken packages with ForceImportantDeps=True
- for (pkgCache::PkgIterator I = Cache->PkgBegin(); !I.end(); I++)
+ for (pkgCache::PkgIterator I = Cache->PkgBegin(); !I.end(); ++I)
if ((*DCache)[I].NowPolicyBroken() == true)
DCache->MarkInstall(I,true,0, false, true);
}
@@ -1051,7 +1049,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
if (_config->FindB("APT::Get::Purge",false) == true)
{
pkgCache::PkgIterator I = Cache->PkgBegin();
- for (; I.end() == false; I++)
+ for (; I.end() == false; ++I)
{
if (I.Purge() == false && Cache[I].Mode == pkgDepCache::ModeDelete)
Cache->MarkDelete(I,true);
@@ -1245,7 +1243,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
if (_config->FindB("APT::Get::Print-URIs") == true)
{
pkgAcquire::UriIterator I = Fetcher.UriBegin();
- for (; I != Fetcher.UriEnd(); I++)
+ for (; I != Fetcher.UriEnd(); ++I)
cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' <<
I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl;
return true;
@@ -1269,7 +1267,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
{
if ((*I)->Local == true)
{
- I++;
+ ++I;
continue;
}
@@ -1289,7 +1287,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
// Print out errors
bool Failed = false;
- for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); I++)
+ for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); ++I)
{
if ((*I)->Status == pkgAcquire::Item::StatDone &&
(*I)->Complete == true)
@@ -1449,7 +1447,7 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
// we have a default release, try to locate the pkg. we do it like
// this because GetCandidateVer() will not "downgrade", that means
// "apt-get source -t stable apt" won't work on a unstable system
- for (pkgCache::VerIterator Ver = Pkg.VersionList();; Ver++)
+ for (pkgCache::VerIterator Ver = Pkg.VersionList();; ++Ver)
{
// try first only exact matches, later fuzzy matches
if (Ver.end() == true)
@@ -1470,7 +1468,7 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
continue;
for (pkgCache::VerFileIterator VF = Ver.FileList();
- VF.end() == false; VF++)
+ VF.end() == false; ++VF)
{
/* If this is the status file, and the current version is not the
version in the status file (ie it is not installed, or somesuch)
@@ -1622,7 +1620,7 @@ bool DoUpdate(CommandLine &CmdL)
return false;
pkgAcquire::UriIterator I = Fetcher.UriBegin();
- for (; I != Fetcher.UriEnd(); I++)
+ for (; I != Fetcher.UriEnd(); ++I)
cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' <<
I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl;
return true;
@@ -2007,7 +2005,7 @@ bool DoInstall(CommandLine &CmdL)
if(Start.TargetPkg().ProvidesList() != 0)
{
pkgCache::PrvIterator I = Start.TargetPkg().ProvidesList();
- for (; I.end() == false; I++)
+ for (; I.end() == false; ++I)
{
pkgCache::PkgIterator Pkg = I.OwnerPkg();
if (Cache[Pkg].CandidateVerIter(Cache) == I.OwnerVer() &&
@@ -2030,7 +2028,7 @@ bool DoInstall(CommandLine &CmdL)
if (Start >= End)
break;
- Start++;
+ ++Start;
}
if(foundInstalledInOrGroup == false)
@@ -2144,7 +2142,7 @@ bool DoDSelectUpgrade(CommandLine &CmdL)
// Install everything with the install flag set
pkgCache::PkgIterator I = Cache->PkgBegin();
- for (;I.end() != true; I++)
+ for (;I.end() != true; ++I)
{
/* Install the package only if it is a new install, the autoupgrader
will deal with the rest */
@@ -2154,7 +2152,7 @@ bool DoDSelectUpgrade(CommandLine &CmdL)
/* Now install their deps too, if we do this above then order of
the status file is significant for | groups */
- for (I = Cache->PkgBegin();I.end() != true; I++)
+ for (I = Cache->PkgBegin();I.end() != true; ++I)
{
/* Install the package only if it is a new install, the autoupgrader
will deal with the rest */
@@ -2163,7 +2161,7 @@ bool DoDSelectUpgrade(CommandLine &CmdL)
}
// Apply erasures now, they override everything else.
- for (I = Cache->PkgBegin();I.end() != true; I++)
+ for (I = Cache->PkgBegin();I.end() != true; ++I)
{
// Remove packages
if (I->SelectedState == pkgCache::State::DeInstall ||
@@ -2180,7 +2178,7 @@ bool DoDSelectUpgrade(CommandLine &CmdL)
// Hold back held packages.
if (_config->FindB("APT::Ignore-Hold",false) == false)
{
- for (pkgCache::PkgIterator I = Cache->PkgBegin(); I.end() == false; I++)
+ for (pkgCache::PkgIterator I = Cache->PkgBegin(); I.end() == false; ++I)
{
if (I->SelectedState == pkgCache::State::Hold)
{
@@ -2328,7 +2326,7 @@ bool DoDownload(CommandLine &CmdL)
if (_config->FindB("APT::Get::Print-URIs") == true)
{
pkgAcquire::UriIterator I = Fetcher.UriBegin();
- for (; I != Fetcher.UriEnd(); I++)
+ for (; I != Fetcher.UriEnd(); ++I)
cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' <<
I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl;
return true;
@@ -2446,7 +2444,7 @@ bool DoSource(CommandLine &CmdL)
// Load them into the fetcher
for (vector<pkgSrcRecords::File>::const_iterator I = Lst.begin();
- I != Lst.end(); I++)
+ I != Lst.end(); ++I)
{
// Try to guess what sort of file it is we are getting.
if (I->Type == "dsc")
@@ -2548,7 +2546,7 @@ bool DoSource(CommandLine &CmdL)
if (_config->FindB("APT::Get::Print-URIs") == true)
{
pkgAcquire::UriIterator I = Fetcher.UriBegin();
- for (; I != Fetcher.UriEnd(); I++)
+ for (; I != Fetcher.UriEnd(); ++I)
cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' <<
I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl;
delete[] Dsc;
@@ -2564,7 +2562,7 @@ bool DoSource(CommandLine &CmdL)
// Print error messages
bool Failed = false;
- for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); I++)
+ for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); ++I)
{
if ((*I)->Status == pkgAcquire::Item::StatDone &&
(*I)->Complete == true)
@@ -2593,7 +2591,7 @@ bool DoSource(CommandLine &CmdL)
if (Process == 0)
{
bool const fixBroken = _config->FindB("APT::Get::Fix-Broken", false);
- for (unsigned I = 0; I != J; I++)
+ for (unsigned I = 0; I != J; ++I)
{
string Dir = Dsc[I].Package + '-' + Cache->VS().UpstreamVersion(Dsc[I].Version.c_str());
@@ -2742,7 +2740,7 @@ bool DoBuildDep(CommandLine &CmdL)
BuildDeps.push_back(rec);
}
- if (BuildDeps.size() == 0)
+ if (BuildDeps.empty() == true)
{
ioprintf(c1out,_("%s has no build depends.\n"),Src.c_str());
continue;
@@ -2752,7 +2750,7 @@ bool DoBuildDep(CommandLine &CmdL)
vector <pkgSrcRecords::Parser::BuildDepRec>::iterator D;
pkgProblemResolver Fix(Cache);
bool skipAlternatives = false; // skip remaining alternatives in an or group
- for (D = BuildDeps.begin(); D != BuildDeps.end(); D++)
+ for (D = BuildDeps.begin(); D != BuildDeps.end(); ++D)
{
bool hasAlternatives = (((*D).Op & pkgCache::Dep::Or) == pkgCache::Dep::Or);
@@ -2931,7 +2929,7 @@ bool DoBuildDep(CommandLine &CmdL)
* installed
*/
pkgCache::PrvIterator Prv = Pkg.ProvidesList();
- for (; Prv.end() != true; Prv++)
+ for (; Prv.end() != true; ++Prv)
{
if (_config->FindB("Debug::BuildDeps",false) == true)
cout << " Checking provider " << Prv.OwnerPkg().FullName() << endl;
diff --git a/cmdline/apt-sortpkgs.cc b/cmdline/apt-sortpkgs.cc
index 171b0ba13..f95a434cc 100644
--- a/cmdline/apt-sortpkgs.cc
+++ b/cmdline/apt-sortpkgs.cc
@@ -106,7 +106,7 @@ bool DoIt(string InFile)
// Emit
unsigned char *Buffer = new unsigned char[Largest+1];
- for (vector<PkgName>::iterator I = List.begin(); I != List.end(); I++)
+ for (vector<PkgName>::iterator I = List.begin(); I != List.end(); ++I)
{
// Read in the Record.
if (Fd.Seek(I->Offset) == false || Fd.Read(Buffer,I->Length) == false)
diff --git a/debian/changelog b/debian/changelog
index c4197721f..000459c5c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,6 @@
apt (0.8.16~exp5) experimental; urgency=low
+ * merged the latest debian-sid fixes
* apt-pkg/makefile:
- install sha256.h compat header
* apt-pkg/pkgcachegen.{cc,h}:
@@ -109,6 +110,32 @@ apt (0.8.16~exp1) experimental; urgency=low
-- Michael Vogt <mvo@debian.org> Wed, 29 Jun 2011 12:40:31 +0200
+apt (0.8.15.6) unstable; urgency=low
+
+ [ Michael Vogt ]
+ * apt-pkg/contrib/fileutl.{cc,h}:
+ - add GetModificationTime() helper
+ * apt-pkg/pkgcachegen.cc:
+ - regenerate the cache if the sources.list changes to ensure
+ that changes in the ordering there will be honored by apt
+ * apt-pkg/sourcelist.{cc,h}:
+ - add pkgSourceList::GetLastModifiedTime() helper
+ * apt-pkg/pkgcachegen.{cc,h}:
+ - use ref-to-ptr semantic in NewDepends() to ensure that the
+ libapt does not segfault if the cache is remapped in between
+ (LP: #812862)
+ - fix crash when P.Arch() was used but the cache got remapped
+ * test/integration/test-hashsum-verification:
+ - add regression test for hashsum verification
+ * 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 <mvo@debian.org> Mon, 15 Aug 2011 09:20:35 +0200
+
apt (0.8.15.5) unstable; urgency=low
[ David Kalnischkies ]
diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc
index 0762a2b28..fabaaec1d 100644
--- a/ftparchive/apt-ftparchive.cc
+++ b/ftparchive/apt-ftparchive.cc
@@ -384,7 +384,7 @@ bool PackageMap::GenContents(Configuration &Setup,
files associated with this contents file into one great big honking
memory structure, then dump the sorted version */
c0out << ' ' << this->Contents << ":" << flush;
- for (vector<PackageMap>::iterator I = Begin; I != End; I++)
+ for (vector<PackageMap>::iterator I = Begin; I != End; ++I)
{
if (I->Contents != this->Contents)
continue;
@@ -770,10 +770,10 @@ bool Generate(CommandLine &CmdL)
// Generate packages
if (CmdL.FileSize() <= 2)
{
- for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); I++)
+ for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); ++I)
if (I->GenPackages(Setup,Stats) == false)
_error->DumpErrors();
- for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); I++)
+ for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); ++I)
if (I->GenSources(Setup,SrcStats) == false)
_error->DumpErrors();
}
@@ -782,7 +782,7 @@ bool Generate(CommandLine &CmdL)
// Make a choice list out of the package list..
RxChoiceList *List = new RxChoiceList[2*PkgList.size()+1];
RxChoiceList *End = List;
- for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); I++)
+ for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); ++I)
{
End->UserData = &(*I);
End->Str = I->BaseDir.c_str();
@@ -832,7 +832,7 @@ bool Generate(CommandLine &CmdL)
}
// close the Translation master files
- for (vector<PackageMap>::reverse_iterator I = PkgList.rbegin(); I != PkgList.rend(); I++)
+ for (vector<PackageMap>::reverse_iterator I = PkgList.rbegin(); I != PkgList.rend(); ++I)
if (I->TransWriter != NULL && I->TransWriter->DecreaseRefCounter() == 0)
delete I->TransWriter;
@@ -843,7 +843,7 @@ bool Generate(CommandLine &CmdL)
// Sort the contents file list by date
string ArchiveDir = Setup.FindDir("Dir::ArchiveDir");
- for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); I++)
+ for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); ++I)
{
struct stat A;
if (MultiCompress::GetStat(flCombine(ArchiveDir,I->Contents),
@@ -860,7 +860,7 @@ bool Generate(CommandLine &CmdL)
hashes of the .debs this means they have not changed either so the
contents must be up to date. */
unsigned long MaxContentsChange = Setup.FindI("Default::MaxContentsChange",UINT_MAX)*1024;
- for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); I++)
+ for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); ++I)
{
// This record is not relevent
if (I->ContentsDone == true ||
@@ -936,7 +936,7 @@ bool Clean(CommandLine &CmdL)
_error->DumpErrors();
string CacheDB = I->BinCacheDB;
- for (; I != PkgList.end() && I->BinCacheDB == CacheDB; I++);
+ for (; I != PkgList.end() && I->BinCacheDB == CacheDB; ++I);
}
return true;
diff --git a/ftparchive/multicompress.cc b/ftparchive/multicompress.cc
index f82879015..08853b0aa 100644
--- a/ftparchive/multicompress.cc
+++ b/ftparchive/multicompress.cc
@@ -48,11 +48,11 @@ MultiCompress::MultiCompress(string const &Output,string const &Compress,
string::const_iterator I = Compress.begin();
for (; I != Compress.end();)
{
- for (; I != Compress.end() && isspace(*I); I++);
+ for (; I != Compress.end() && isspace(*I); ++I);
// Grab a word
string::const_iterator Start = I;
- for (; I != Compress.end() && !isspace(*I); I++);
+ for (; I != Compress.end() && !isspace(*I); ++I);
// Find the matching compressor
std::vector<APT::Configuration::Compressor> Compressors = APT::Configuration::getCompressors();
@@ -129,11 +129,11 @@ bool MultiCompress::GetStat(string const &Output,string const &Compress,struct s
bool DidStat = false;
for (; I != Compress.end();)
{
- for (; I != Compress.end() && isspace(*I); I++);
+ for (; I != Compress.end() && isspace(*I); ++I);
// Grab a word
string::const_iterator Start = I;
- for (; I != Compress.end() && !isspace(*I); I++);
+ for (; I != Compress.end() && !isspace(*I); ++I);
// Find the matching compressor
std::vector<APT::Configuration::Compressor> Compressors = APT::Configuration::getCompressors();
diff --git a/ftparchive/override.cc b/ftparchive/override.cc
index 3cf10b89b..bd583a66f 100644
--- a/ftparchive/override.cc
+++ b/ftparchive/override.cc
@@ -231,7 +231,7 @@ Override::Item* Override::GetItem(string const &Package, string const &Architect
if (R->OldMaint != "") result->OldMaint = R->OldMaint;
if (R->NewMaint != "") result->NewMaint = R->NewMaint;
for (map<string,string>::const_iterator foI = R->FieldOverride.begin();
- foI != R->FieldOverride.end(); foI++)
+ foI != R->FieldOverride.end(); ++foI)
{
result->FieldOverride[foI->first] = foI->second;
}
@@ -268,7 +268,7 @@ string Override::Item::SwapMaint(string const &Orig,bool &Failed)
string::const_iterator Start = End;
for (; End < OldMaint.end() &&
(End + 3 >= OldMaint.end() || End[0] != ' ' ||
- End[1] != '/' || End[2] != '/'); End++);
+ End[1] != '/' || End[2] != '/'); ++End);
if (stringcasecmp(Start,End,Orig.begin(),Orig.end()) == 0)
return NewMaint;
@@ -276,7 +276,7 @@ string Override::Item::SwapMaint(string const &Orig,bool &Failed)
break;
// Skip the divider and white space
- for (; End < OldMaint.end() && (*End == '/' || *End == ' '); End++);
+ for (; End < OldMaint.end() && (*End == '/' || *End == ' '); ++End);
}
#else
if (stringcasecmp(OldMaint.begin(),OldMaint.end(),Orig.begin(),Orig.end()) == 0)
diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc
index 60db8b990..9741aec78 100644
--- a/ftparchive/writer.cc
+++ b/ftparchive/writer.cc
@@ -494,7 +494,7 @@ bool PackagesWriter::DoPackage(string FileName)
}
for (map<string,string>::const_iterator I = OverItem->FieldOverride.begin();
- I != OverItem->FieldOverride.end(); I++)
+ I != OverItem->FieldOverride.end(); ++I)
SetTFRewriteData(Changes[End++],I->first.c_str(),I->second.c_str());
SetTFRewriteData(Changes[End++], 0, 0);
@@ -830,7 +830,7 @@ bool SourcesWriter::DoPackage(string FileName)
SetTFRewriteData(Changes[End++], "Maintainer", NewMaint.c_str());
for (map<string,string>::const_iterator I = SOverItem->FieldOverride.begin();
- I != SOverItem->FieldOverride.end(); I++)
+ I != SOverItem->FieldOverride.end(); ++I)
SetTFRewriteData(Changes[End++],I->first.c_str(),I->second.c_str());
SetTFRewriteData(Changes[End++], 0, 0);
diff --git a/methods/cdrom.cc b/methods/cdrom.cc
index b25fdf5a8..ae699dfc3 100644
--- a/methods/cdrom.cc
+++ b/methods/cdrom.cc
@@ -54,7 +54,8 @@ class CDROMMethod : public pkgAcqMethod
CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly |
SendConfig | NeedsCleanup |
Removable),
- DatabaseLoaded(false),
+ DatabaseLoaded(false),
+ Debug(false),
MountedByApt(false)
{
UdevCdroms.Dlopen();
diff --git a/methods/ftp.cc b/methods/ftp.cc
index 97248f900..eb7fedd85 100644
--- a/methods/ftp.cc
+++ b/methods/ftp.cc
@@ -69,7 +69,8 @@ time_t FtpMethod::FailTime = 0;
// ---------------------------------------------------------------------
/* */
FTPConn::FTPConn(URI Srv) : Len(0), ServerFd(-1), DataFd(-1),
- DataListenFd(-1), ServerName(Srv)
+ DataListenFd(-1), ServerName(Srv),
+ ForceExtended(false), TryPassive(true)
{
Debug = _config->FindB("Debug::Acquire::Ftp",false);
PasvAddr = 0;
@@ -559,7 +560,7 @@ bool FTPConn::ExtGoPasv()
string::const_iterator List[4];
unsigned Count = 0;
Pos++;
- for (string::const_iterator I = Msg.begin() + Pos; I < Msg.end(); I++)
+ for (string::const_iterator I = Msg.begin() + Pos; I < Msg.end(); ++I)
{
if (*I != Msg[Pos])
continue;
diff --git a/methods/gpgv.cc b/methods/gpgv.cc
index 960c06180..3ad3e8d84 100644
--- a/methods/gpgv.cc
+++ b/methods/gpgv.cc
@@ -213,21 +213,21 @@ bool GPGVMethod::Fetch(FetchItem *Itm)
{
errmsg += _("The following signatures were invalid:\n");
for (vector<string>::iterator I = BadSigners.begin();
- I != BadSigners.end(); I++)
+ I != BadSigners.end(); ++I)
errmsg += (*I + "\n");
}
if (!WorthlessSigners.empty())
{
errmsg += _("The following signatures were invalid:\n");
for (vector<string>::iterator I = WorthlessSigners.begin();
- I != WorthlessSigners.end(); I++)
+ I != WorthlessSigners.end(); ++I)
errmsg += (*I + "\n");
}
if (!NoPubKeySigners.empty())
{
errmsg += _("The following signatures couldn't be verified because the public key is not available:\n");
for (vector<string>::iterator I = NoPubKeySigners.begin();
- I != NoPubKeySigners.end(); I++)
+ I != NoPubKeySigners.end(); ++I)
errmsg += (*I + "\n");
}
}
diff --git a/methods/http.cc b/methods/http.cc
index 13f9cbe06..65a0cbbb7 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -402,10 +402,10 @@ ServerState::RunHeadersResult ServerState::RunHeaders()
if (Debug == true)
clog << Data;
- for (string::const_iterator I = Data.begin(); I < Data.end(); I++)
+ for (string::const_iterator I = Data.begin(); I < Data.end(); ++I)
{
string::const_iterator J = I;
- for (; J != Data.end() && *J != '\n' && *J != '\r';J++);
+ for (; J != Data.end() && *J != '\n' && *J != '\r'; ++J);
if (HeaderLine(string(I,J)) == false)
return RUN_HEADERS_PARSE_ERROR;
I = J;
@@ -1325,7 +1325,7 @@ int HttpMethod::Loop()
StopRedirects = true;
else
{
- for (StringVectorIterator I = R.begin(); I != R.end(); I++)
+ for (StringVectorIterator I = R.begin(); I != R.end(); ++I)
if (Queue->Uri == *I)
{
R[0] = "STOP";
diff --git a/methods/http.h b/methods/http.h
index aa96c6810..6302807c5 100644
--- a/methods/http.h
+++ b/methods/http.h
@@ -36,14 +36,14 @@ class CircleBuf
static struct timeval BwReadTick;
static const unsigned int BW_HZ;
- unsigned long LeftRead()
+ unsigned long LeftRead() const
{
unsigned long Sz = Size - (InP - OutP);
if (Sz > Size - (InP%Size))
Sz = Size - (InP%Size);
return Sz;
}
- unsigned long LeftWrite()
+ unsigned long LeftWrite() const
{
unsigned long Sz = InP - OutP;
if (InP > MaxGet)
@@ -68,12 +68,12 @@ class CircleBuf
// Control the write limit
void Limit(long Max) {if (Max == -1) MaxGet = 0-1; else MaxGet = OutP + Max;}
- bool IsLimit() {return MaxGet == OutP;};
- void Print() {cout << MaxGet << ',' << OutP << endl;};
+ bool IsLimit() const {return MaxGet == OutP;};
+ void Print() const {cout << MaxGet << ',' << OutP << endl;};
// Test for free space in the buffer
- bool ReadSpace() {return Size - (InP - OutP) > 0;};
- bool WriteSpace() {return InP - OutP > 0;};
+ bool ReadSpace() const {return Size - (InP - OutP) > 0;};
+ bool WriteSpace() const {return InP - OutP > 0;};
// Dump everything
void Reset();
@@ -113,7 +113,7 @@ struct ServerState
URI ServerName;
bool HeaderLine(string Line);
- bool Comp(URI Other) {return Other.Host == ServerName.Host && Other.Port == ServerName.Port;};
+ bool Comp(URI Other) const {return Other.Host == ServerName.Host && Other.Port == ServerName.Port;};
void Reset() {Major = 0; Minor = 0; Result = 0; Size = 0; StartPos = 0;
Encoding = Closes; time(&Date); ServerFd = -1;
Pipeline = true;};
diff --git a/methods/mirror.cc b/methods/mirror.cc
index 713dc211a..cb24a06cf 100644
--- a/methods/mirror.cc
+++ b/methods/mirror.cc
@@ -54,7 +54,7 @@ using namespace std;
*/
MirrorMethod::MirrorMethod()
- : HttpMethod(), DownloadedMirrorFile(false)
+ : HttpMethod(), DownloadedMirrorFile(false), Debug(false)
{
};
@@ -107,7 +107,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)
@@ -330,7 +330,7 @@ string MirrorMethod::GetMirrorFileName(string mirror_uri_str)
vector<metaIndex *>::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)
diff --git a/methods/rred.cc b/methods/rred.cc
index 849973e1a..6c55880ca 100644
--- a/methods/rred.cc
+++ b/methods/rred.cc
@@ -51,7 +51,7 @@ protected:
virtual bool Fetch(FetchItem *Itm);
public:
- RredMethod() : pkgAcqMethod("1.1",SingleInstance | SendConfig) {};
+ RredMethod() : pkgAcqMethod("1.1",SingleInstance | SendConfig), Debug(false) {};
};
/*}}}*/
/** \brief applyFile - in reverse order with a tail recursion {{{
@@ -239,7 +239,9 @@ RredMethod::State RredMethod::patchFile(FileFd &Patch, FileFd &From, /*{{{*/
return result;
}
/*}}}*/
-struct EdCommand { /*{{{*/
+/* struct EdCommand {{{*/
+#ifdef _POSIX_MAPPED_FILES
+struct EdCommand {
size_t data_start;
size_t data_end;
size_t data_lines;
@@ -248,6 +250,7 @@ struct EdCommand { /*{{{*/
char type;
};
#define IOV_COUNT 1024 /* Don't really want IOV_MAX since it can be arbitrarily large */
+#endif
/*}}}*/
RredMethod::State RredMethod::patchMMap(FileFd &Patch, FileFd &From, /*{{{*/
FileFd &out_file, Hashes *hash) const {
diff --git a/methods/rsh.h b/methods/rsh.h
index b06d5a94e..98ca6a88c 100644
--- a/methods/rsh.h
+++ b/methods/rsh.h
@@ -34,7 +34,7 @@ class RSHConn
// Raw connection IO
bool WriteMsg(string &Text,bool Sync,const char *Fmt,...);
bool Connect(string Host, string User);
- bool Comp(URI Other) {return Other.Host == ServerName.Host && Other.Port == ServerName.Port;};
+ bool Comp(URI Other) const {return Other.Host == ServerName.Host && Other.Port == ServerName.Port;};
// Connection control
bool Open();
diff --git a/test/integration/Packages-hashsum-verification b/test/integration/Packages-hashsum-verification
new file mode 100644
index 000000000..29a385f4f
--- /dev/null
+++ b/test/integration/Packages-hashsum-verification
@@ -0,0 +1,18 @@
+Package: apt
+Version: 0.7.25.3
+Architecture: i386
+Maintainer: APT Development Team <deity@lists.debian.org>
+Installed-Size: 5244
+Replaces: libapt-pkg-dev (<< 0.3.7), libapt-pkg-doc (<< 0.3.7)
+Provides: libapt-pkg-libc6.9-6-4.8
+Suggests: aptitude | synaptic | wajig, dpkg-dev, apt-doc, bzip2, lzma, python-apt
+Filename: apt.deb
+Size: 0
+MD5sum: d41d8cd98f00b204e9800998ecf8427e
+Description: Advanced front-end for dpkg
+ This is Debian's next generation front-end for the dpkg package manager.
+ It provides the apt-get utility and APT dselect method that provides a
+ simpler, safer way to install and upgrade packages.
+ .
+ APT features complete installation ordering, multiple source capability
+ and several other unique features, see the Users Guide in apt-doc.
diff --git a/test/integration/test-hashsum-verification b/test/integration/test-hashsum-verification
new file mode 100755
index 000000000..033096ee8
--- /dev/null
+++ b/test/integration/test-hashsum-verification
@@ -0,0 +1,83 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "i386"
+
+buildaptarchive
+setupflataptarchive
+changetowebserver
+
+prepare() {
+ local DATE="${2:-now}"
+ if [ "$DATE" = 'now' -a "$1" = "${PKGFILE}-new" ]; then
+ DATE='now + 6 days'
+ fi
+ for release in $(find rootdir/var/lib/apt/lists 2> /dev/null); do
+ touch -d 'now - 6 hours' $release
+ done
+ rm -rf rootdir/var/cache/apt/archives
+ rm -f rootdir/var/cache/apt/*.bin
+ cp $1 aptarchive/Packages
+ find aptarchive -name 'Release' -delete
+ cat aptarchive/Packages | gzip > aptarchive/Packages.gz
+ cat aptarchive/Packages | bzip2 > aptarchive/Packages.bz2
+ cat aptarchive/Packages | lzma > aptarchive/Packages.lzma
+ # create Release file with incorret checksums
+ cat > aptarchive/Release <<EOF
+Date: Fri, 05 Aug 2011 09:22:08 UTC
+MD5Sum:
+ x15c483ac486f5dbe95095c7ec08626f 760 Packages
+ x0579797df4792164a17305fb0b317e9 546 Packages.bz2
+ xc532a82873d2206b4e4503e92d167bd 489 Packages.gz
+ x4d1d25661377dd4bb95a1736e2624d3 527 Packages.lzma
+ xf1cc221194edbaa943d2375d6f44a88 572 Packages.xz
+SHA1:
+ x0d3317839cf68cd40c28f0bddca8d2ce5a29cad 760 Packages
+ xffddf046ad8dfd8338a355d76fb08d143c8b636 546 Packages.bz2
+ xa27a3df51ca4474b880a6594c4811957079b613 489 Packages.gz
+ x9d7bba4e6fa927a34dcd797694c2893c21f1004 527 Packages.lzma
+ x7d988fe59cf67298828e5299a15d329c0f00f1b 572 Packages.xz
+SHA256:
+ x5a47d72f6b97bfa164b23326b6ad3cb019b5c6cc73769f8c0187616933d1b2b 760 Packages
+ x617252f5bfe3e9126352c7c2f8122d9c3b2c5e1a6c8a9616d62adc0ed164172 546 Packages.bz2
+ xc6abc6fe9a4fcf0758ec5366dfd19bcba90af026a7017c3f6198c59eccd8ef5 489 Packages.gz
+ xb306e66e5e6a7169c8d281a888539d1fdca9cecc99ae605717df579d5b9c166 527 Packages.lzma
+ x9585d0e66b74c9385727fbea11fea9ab33c716b18a32f3036f037a2b9b57120 572 Packages.xz
+EOF
+ cp aptarchive/Release aptarchive/InRelease
+}
+
+# fake our downloadable file
+touch aptarchive/apt.deb
+
+PKGFILE="${TESTDIR}/$(echo "$(basename $0)" | sed 's#^test-#Packages-#')"
+
+runtest() {
+ prepare ${PKGFILE}
+ rm -rf rootdir/var/lib/apt/lists
+ signreleasefiles 'Joe Sixpack'
+ find aptarchive/ -name "$DELETEFILE" -delete
+
+ # test signed release file
+ msgtest 'apt-get update gets the expected hashsum mismatch'
+ aptget update 2>&1 | grep "Hash Sum mismatch" > /dev/null && msgpass || msgfail
+ msgtest 'No package from the source available'
+ [ "$(aptcache show apt 2>&1)" = "E: No packages found" ] && msgpass || msgfail
+ msgtest 'No Packages file in /var/lib/apt/lists'
+ [ "$(ls rootdir/var/lib/apt/lists/*Package* 2>/dev/null)" = "" ] && msgpass || msgfail
+
+ # now with the unsigned Release file
+ rm -rf rootdir/var/lib/apt/lists
+ rm aptarchive/InRelease aptarchive/Release.gpg
+ msgtest 'unsigned apt-get update gets the expected hashsum mismatch'
+ aptget update 2>&1 | grep "Hash Sum mismatch" > /dev/null && msgpass || msgfail
+
+
+}
+
+runtest
+
diff --git a/test/libapt/assert.h b/test/libapt/assert.h
index 92b662dfa..fae9b6c64 100644
--- a/test/libapt/assert.h
+++ b/test/libapt/assert.h
@@ -53,3 +53,11 @@ void assertEqualsOr2(int const &expect1, int const &expect2, unsigned int const
assertEqualsOr2<unsigned int const&, unsigned int const&>(expect1, expect2, get, line);
}
+
+// simple helper to quickly output a vectors
+template < typename X >
+void dumpVector(X vec) {
+ for (typename X::const_iterator v = vec.begin();
+ v != vec.end(); ++v)
+ std::cout << *v << std::endl;
+}
diff --git a/test/libapt/getarchitectures_test.cc b/test/libapt/getarchitectures_test.cc
index e3ca7bbc2..807469263 100644
--- a/test/libapt/getarchitectures_test.cc
+++ b/test/libapt/getarchitectures_test.cc
@@ -7,13 +7,6 @@
#include <iostream>
-// simple helper to quickly output a vector of strings
-void dumpVector(std::vector<std::string> vec) {
- for (std::vector<std::string>::const_iterator v = vec.begin();
- v != vec.end(); v++)
- std::cout << *v << std::endl;
-}
-
int main(int argc,char *argv[])
{
std::vector<std::string> vec;
diff --git a/test/libapt/getlanguages_test.cc b/test/libapt/getlanguages_test.cc
index 3d63e0e74..f6aa7a697 100644
--- a/test/libapt/getlanguages_test.cc
+++ b/test/libapt/getlanguages_test.cc
@@ -7,13 +7,6 @@
#include <iostream>
-// simple helper to quickly output a vector of strings
-void dumpVector(std::vector<std::string> vec) {
- for (std::vector<std::string>::const_iterator v = vec.begin();
- v != vec.end(); v++)
- std::cout << *v << std::endl;
-}
-
int main(int argc,char *argv[])
{
if (argc != 2) {
diff --git a/test/libapt/getlistoffilesindir_test.cc b/test/libapt/getlistoffilesindir_test.cc
index ed8d2dad6..5ee014cca 100644
--- a/test/libapt/getlistoffilesindir_test.cc
+++ b/test/libapt/getlistoffilesindir_test.cc
@@ -7,13 +7,6 @@
#include <stdio.h>
#include <iostream>
-// simple helper to quickly output a vector of strings
-void dumpVector(std::vector<std::string> vec) {
- for (std::vector<std::string>::const_iterator v = vec.begin();
- v != vec.end(); v++)
- std::cout << *v << std::endl;
-}
-
#define P(x) string(argv[1]).append("/").append(x)
int main(int argc,char *argv[])
diff --git a/test/test_udevcdrom.cc b/test/test_udevcdrom.cc
index e65c7a297..577e2d013 100644
--- a/test/test_udevcdrom.cc
+++ b/test/test_udevcdrom.cc
@@ -10,7 +10,7 @@ int main()
vector<CdromDevice> l;
l = c.Scan();
- assert(l.size() > 0);
+ assert(l.empty() == false);
for (i=0;i<l.size();i++)
std::cerr << l[i].DeviceName << " "
<< l[i].Mounted << " "