summaryrefslogtreecommitdiff
path: root/apt-pkg/cdrom.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-11-10 16:32:52 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2011-11-10 16:32:52 +0100
commit71ecaad29d8066a494f516efc5efd80860653fe2 (patch)
treeb0769df88e2b6496f23e3d899aeb1c240a3488d9 /apt-pkg/cdrom.cc
parenta865ed25fa54514224cf4d6f83dd9cf48b7ed02b (diff)
parent37adedc9d0b66eeae7efb88aebd08dfbc6e06f77 (diff)
merged from http://bzr.debian.org/bzr/apt/apt/debian-experimental2
Diffstat (limited to 'apt-pkg/cdrom.cc')
-rw-r--r--apt-pkg/cdrom.cc33
1 files changed, 18 insertions, 15 deletions
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc
index 0ad1c69e5..a9c63fd21 100644
--- a/apt-pkg/cdrom.cc
+++ b/apt-pkg/cdrom.cc
@@ -1,5 +1,6 @@
/*
*/
+#include<config.h>
#include<apt-pkg/init.h>
#include<apt-pkg/error.h>
@@ -7,11 +8,11 @@
#include<apt-pkg/strutl.h>
#include<apt-pkg/cdrom.h>
#include<apt-pkg/aptconfiguration.h>
+#include<apt-pkg/configuration.h>
+#include<apt-pkg/fileutl.h>
#include<sstream>
#include<fstream>
-#include<config.h>
-#include<apti18n.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
@@ -22,6 +23,8 @@
#include "indexcopy.h"
+#include<apti18n.h>
+
using namespace std;
// FindPackages - Find the package files on the CDROM /*{{{*/
@@ -310,7 +313,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 +325,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 +408,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 +458,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 +492,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 +664,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 +691,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 +715,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 +760,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 +807,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 +826,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)