summaryrefslogtreecommitdiff
path: root/apt-pkg/deb
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r--apt-pkg/deb/debindexfile.cc2
-rw-r--r--apt-pkg/deb/deblistparser.h11
-rw-r--r--apt-pkg/deb/debmetaindex.cc8
-rw-r--r--apt-pkg/deb/debmetaindex.h3
-rw-r--r--apt-pkg/deb/debsrcrecords.cc8
-rw-r--r--apt-pkg/deb/dpkgpm.cc3
6 files changed, 25 insertions, 10 deletions
diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc
index 7cb8e3b68..3bdc551b4 100644
--- a/apt-pkg/deb/debindexfile.cc
+++ b/apt-pkg/deb/debindexfile.cc
@@ -526,7 +526,7 @@ bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const
if (FileExists(TranslationFile))
{
FileFd Trans(TranslationFile,FileFd::ReadOnly, FileFd::Extension);
- debListParser TransParser(&Trans);
+ debTranslationsParser TransParser(&Trans);
if (_error->PendingError() == true)
return false;
diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h
index 5a2282f9c..56a83b36e 100644
--- a/apt-pkg/deb/deblistparser.h
+++ b/apt-pkg/deb/deblistparser.h
@@ -115,4 +115,15 @@ class debDebFileParser : public debListParser
pkgCache::VerIterator &Ver);
};
+class debTranslationsParser : public debListParser
+{
+ public:
+ // a translation can never be a real package
+ virtual std::string Architecture() { return ""; }
+ virtual std::string Version() { return ""; }
+
+ debTranslationsParser(FileFd *File, std::string const &Arch = "")
+ : debListParser(File, Arch) {};
+};
+
#endif
diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc
index 607dae882..73010e867 100644
--- a/apt-pkg/deb/debmetaindex.cc
+++ b/apt-pkg/deb/debmetaindex.cc
@@ -186,8 +186,8 @@ debReleaseIndex::~debReleaseIndex() {
delete *S;
}
-vector <struct IndexTarget *>* debReleaseIndex::ComputeIndexTargets() const {
- vector <struct IndexTarget *>* IndexTargets = new vector <IndexTarget *>;
+vector <IndexTarget *>* debReleaseIndex::ComputeIndexTargets() const {
+ vector <IndexTarget *>* IndexTargets = new vector <IndexTarget *>;
map<string, vector<debSectionEntry const*> >::const_iterator const src = ArchEntries.find("source");
if (src != ArchEntries.end()) {
@@ -255,8 +255,8 @@ 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) {
+ vector <IndexTarget *> *targets = ComputeIndexTargets();
+ for (vector <IndexTarget*>::const_iterator Target = targets->begin(); Target != targets->end(); ++Target) {
new pkgAcqIndex(Owner, (*Target)->URI, (*Target)->Description,
(*Target)->ShortDesc, HashStringList());
}
diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h
index 0e70bba87..7091c198f 100644
--- a/apt-pkg/deb/debmetaindex.h
+++ b/apt-pkg/deb/debmetaindex.h
@@ -19,6 +19,7 @@
class pkgAcquire;
class pkgIndexFile;
class debDebPkgFileIndex;
+class IndexTarget;
class debReleaseIndex : public metaIndex {
public:
@@ -45,7 +46,7 @@ class debReleaseIndex : public metaIndex {
virtual std::string ArchiveURI(std::string const &File) const {return URI + File;};
virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const;
- std::vector <struct IndexTarget *>* ComputeIndexTargets() const;
+ std::vector <IndexTarget *>* ComputeIndexTargets() const;
std::string Info(const char *Type, std::string const &Section, std::string const &Arch="") const;
std::string MetaIndexInfo(const char *Type) const;
diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc
index bf5e56ec9..97f43aca2 100644
--- a/apt-pkg/deb/debsrcrecords.cc
+++ b/apt-pkg/deb/debsrcrecords.cc
@@ -57,12 +57,13 @@ const char **debSrcRecordParser::Binaries()
char* binStartNext = strchrnul(bin, ',');
char* binEnd = binStartNext - 1;
for (; isspace(*binEnd) != 0; --binEnd)
- binEnd = '\0';
+ binEnd = 0;
StaticBinList.push_back(bin);
if (*binStartNext != ',')
break;
*binStartNext = '\0';
- for (bin = binStartNext + 1; isspace(*bin) != 0; ++bin);
+ for (bin = binStartNext + 1; isspace(*bin) != 0; ++bin)
+ ;
} while (*bin != '\0');
StaticBinList.push_back(NULL);
@@ -238,7 +239,8 @@ bool debSrcRecordParser::Files(std::vector<pkgSrcRecords::File> &List)
/* */
debSrcRecordParser::~debSrcRecordParser()
{
- delete[] Buffer;
+ // was allocated via strndup()
+ free(Buffer);
}
/*}}}*/
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 32ef343aa..76b708359 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -1438,7 +1438,8 @@ bool pkgDPkgPM::GoNoABIBreak(APT::Progress::PackageManager *progress)
if (_config->FindB("DPkg::FlushSTDIN",true) == true && isatty(STDIN_FILENO))
{
- int Flags,dummy;
+ int Flags;
+ int dummy = 0;
if ((Flags = fcntl(STDIN_FILENO,F_GETFL,dummy)) < 0)
_exit(100);