summaryrefslogtreecommitdiff
path: root/ftparchive
diff options
context:
space:
mode:
Diffstat (limited to 'ftparchive')
-rw-r--r--ftparchive/apt-ftparchive.cc37
-rw-r--r--ftparchive/cachedb.cc4
-rw-r--r--ftparchive/cachedb.h8
-rw-r--r--ftparchive/contents.cc5
-rw-r--r--ftparchive/contents.h8
-rw-r--r--ftparchive/multicompress.cc6
-rw-r--r--ftparchive/multicompress.h3
-rw-r--r--ftparchive/override.cc13
-rw-r--r--ftparchive/writer.cc31
-rw-r--r--ftparchive/writer.h4
10 files changed, 76 insertions, 43 deletions
diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc
index 712f8469a..692f19e25 100644
--- a/ftparchive/apt-ftparchive.cc
+++ b/ftparchive/apt-ftparchive.cc
@@ -17,14 +17,23 @@
#include <apt-pkg/cmndline.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/init.h>
-#include <algorithm>
+#include <apt-pkg/fileutl.h>
+#include <algorithm>
#include <climits>
#include <sys/time.h>
-#include <regex.h>
-
+#include <locale.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <functional>
+#include <iostream>
+#include <string>
+#include <vector>
+
+#include "cachedb.h"
+#include "override.h"
#include "apt-ftparchive.h"
-#include "contents.h"
#include "multicompress.h"
#include "writer.h"
@@ -438,7 +447,7 @@ bool PackageMap::GenContents(Configuration &Setup,
// ---------------------------------------------------------------------
/* This populates the PkgList with all the possible permutations of the
section/arch lists. */
-void LoadTree(vector<PackageMap> &PkgList,Configuration &Setup)
+static void LoadTree(vector<PackageMap> &PkgList,Configuration &Setup)
{
// Load the defaults
string DDir = Setup.Find("TreeDefault::Directory",
@@ -484,7 +493,7 @@ void LoadTree(vector<PackageMap> &PkgList,Configuration &Setup)
struct SubstVar const Vars[] = {{"$(DIST)",&Dist},
{"$(SECTION)",&Section},
{"$(ARCH)",&Arch},
- {}};
+ {NULL, NULL}};
mode_t const Perms = Block.FindI("FileMode", Permissions);
bool const LongDesc = Block.FindB("LongDescription", LongDescription);
TranslationWriter *TransWriter;
@@ -550,7 +559,7 @@ void LoadTree(vector<PackageMap> &PkgList,Configuration &Setup)
// LoadBinDir - Load a 'bindirectory' section from the Generate Config /*{{{*/
// ---------------------------------------------------------------------
/* */
-void LoadBinDir(vector<PackageMap> &PkgList,Configuration &Setup)
+static void LoadBinDir(vector<PackageMap> &PkgList,Configuration &Setup)
{
mode_t const Permissions = Setup.FindI("Default::FileMode",0644);
@@ -586,7 +595,7 @@ void LoadBinDir(vector<PackageMap> &PkgList,Configuration &Setup)
// ShowHelp - Show the help text /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool ShowHelp(CommandLine &CmdL)
+static bool ShowHelp(CommandLine &)
{
ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
COMMON_ARCH,__DATE__,__TIME__);
@@ -639,7 +648,7 @@ bool ShowHelp(CommandLine &CmdL)
// SimpleGenPackages - Generate a Packages file for a directory tree /*{{{*/
// ---------------------------------------------------------------------
/* This emulates dpkg-scanpackages's command line interface. 'mostly' */
-bool SimpleGenPackages(CommandLine &CmdL)
+static bool SimpleGenPackages(CommandLine &CmdL)
{
if (CmdL.FileSize() < 2)
return ShowHelp(CmdL);
@@ -667,7 +676,7 @@ bool SimpleGenPackages(CommandLine &CmdL)
// SimpleGenContents - Generate a Contents listing /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool SimpleGenContents(CommandLine &CmdL)
+static bool SimpleGenContents(CommandLine &CmdL)
{
if (CmdL.FileSize() < 2)
return ShowHelp(CmdL);
@@ -689,7 +698,7 @@ bool SimpleGenContents(CommandLine &CmdL)
// SimpleGenSources - Generate a Sources file for a directory tree /*{{{*/
// ---------------------------------------------------------------------
/* This emulates dpkg-scanpackages's command line interface. 'mostly' */
-bool SimpleGenSources(CommandLine &CmdL)
+static bool SimpleGenSources(CommandLine &CmdL)
{
if (CmdL.FileSize() < 2)
return ShowHelp(CmdL);
@@ -722,7 +731,7 @@ bool SimpleGenSources(CommandLine &CmdL)
/*}}}*/
// SimpleGenRelease - Generate a Release file for a directory tree /*{{{*/
// ---------------------------------------------------------------------
-bool SimpleGenRelease(CommandLine &CmdL)
+static bool SimpleGenRelease(CommandLine &CmdL)
{
if (CmdL.FileSize() < 2)
return ShowHelp(CmdL);
@@ -747,7 +756,7 @@ bool SimpleGenRelease(CommandLine &CmdL)
// Generate - Full generate, using a config file /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool Generate(CommandLine &CmdL)
+static bool Generate(CommandLine &CmdL)
{
struct CacheDB::Stats SrcStats;
if (CmdL.FileSize() < 2)
@@ -911,7 +920,7 @@ bool Generate(CommandLine &CmdL)
// Clean - Clean out the databases /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool Clean(CommandLine &CmdL)
+static bool Clean(CommandLine &CmdL)
{
if (CmdL.FileSize() != 2)
return ShowHelp(CmdL);
diff --git a/ftparchive/cachedb.cc b/ftparchive/cachedb.cc
index c2318bf53..523c6b5fa 100644
--- a/ftparchive/cachedb.cc
+++ b/ftparchive/cachedb.cc
@@ -19,8 +19,12 @@
#include <apt-pkg/strutl.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/debfile.h>
#include <netinet/in.h> // htonl, etc
+#include <ctype.h>
+#include <stddef.h>
+#include <sys/stat.h>
#include "cachedb.h"
diff --git a/ftparchive/cachedb.h b/ftparchive/cachedb.h
index b9ced9418..49b9a0ef5 100644
--- a/ftparchive/cachedb.h
+++ b/ftparchive/cachedb.h
@@ -12,17 +12,19 @@
#ifndef CACHEDB_H
#define CACHEDB_H
-
#include <apt-pkg/debfile.h>
#include <db.h>
-#include <inttypes.h>
-#include <sys/stat.h>
#include <errno.h>
#include <string>
+#include <string.h>
+#include <stdint.h>
+#include <stdio.h>
#include "contents.h"
+class FileFd;
+
class CacheDB
{
protected:
diff --git a/ftparchive/contents.cc b/ftparchive/contents.cc
index 80fe6e17e..7a1fb779e 100644
--- a/ftparchive/contents.cc
+++ b/ftparchive/contents.cc
@@ -36,13 +36,12 @@
#include <config.h>
#include <apt-pkg/debfile.h>
-#include <apt-pkg/extracttar.h>
+#include <apt-pkg/dirstream.h>
#include <apt-pkg/error.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <malloc.h>
#include "contents.h"
@@ -316,7 +315,7 @@ bool ContentsExtract::Read(debDebFile &Deb)
// ContentsExtract::DoItem - Extract an item /*{{{*/
// ---------------------------------------------------------------------
/* This just tacks the name onto the end of our memory buffer */
-bool ContentsExtract::DoItem(Item &Itm,int &Fd)
+bool ContentsExtract::DoItem(Item &Itm, int &/*Fd*/)
{
unsigned long Len = strlen(Itm.Name);
diff --git a/ftparchive/contents.h b/ftparchive/contents.h
index 4af9db574..dbbb83350 100644
--- a/ftparchive/contents.h
+++ b/ftparchive/contents.h
@@ -9,11 +9,13 @@
/*}}}*/
#ifndef CONTENTS_H
#define CONTENTS_H
-
-#include <stdlib.h>
-#include <stdio.h>
+
#include <apt-pkg/dirstream.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string>
+
class debDebFile;
class GenContents
diff --git a/ftparchive/multicompress.cc b/ftparchive/multicompress.cc
index 1555d2f2d..f35d5304a 100644
--- a/ftparchive/multicompress.cc
+++ b/ftparchive/multicompress.cc
@@ -20,13 +20,15 @@
#include <apt-pkg/strutl.h>
#include <apt-pkg/error.h>
#include <apt-pkg/md5.h>
+#include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/hashsum_template.h>
-#include <fcntl.h>
+#include <ctype.h>
+#include <vector>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <unistd.h>
-#include <iostream>
#include "multicompress.h"
#include <apti18n.h>
diff --git a/ftparchive/multicompress.h b/ftparchive/multicompress.h
index 388fad22e..ddd1815a3 100644
--- a/ftparchive/multicompress.h
+++ b/ftparchive/multicompress.h
@@ -22,7 +22,8 @@
#include <string>
#include <stdio.h>
#include <sys/types.h>
-
+#include <time.h>
+
class MultiCompress
{
// An output file
diff --git a/ftparchive/override.cc b/ftparchive/override.cc
index d2130db8a..b4cd49b6c 100644
--- a/ftparchive/override.cc
+++ b/ftparchive/override.cc
@@ -16,6 +16,9 @@
#include <apt-pkg/error.h>
#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+#include <utility>
#include "override.h"
@@ -129,7 +132,7 @@ bool Override::ReadOverride(string const &File,bool const &Source)
// Override::ReadExtraOverride - Read the extra override file /*{{{*/
// ---------------------------------------------------------------------
/* This parses the extra override file and reads it into the map */
-bool Override::ReadExtraOverride(string const &File,bool const &Source)
+bool Override::ReadExtraOverride(string const &File,bool const &/*Source*/)
{
if (File.empty() == true)
return true;
@@ -201,7 +204,7 @@ bool Override::ReadExtraOverride(string const &File,bool const &Source)
}
/*}}}*/
-// Override::GetItem - Get a architecture specific item /*{{{*/
+// Override::GetItem - Get a architecture specific item /*{{{*/
// ---------------------------------------------------------------------
/* Returns a override item for the given package and the given architecture.
* Treats "all" special
@@ -232,10 +235,10 @@ Override::Item* Override::GetItem(string const &Package, string const &Architect
{
result->FieldOverride[foI->first] = foI->second;
}
- }
- }
+ }
+ }
return result;
-};
+}
// Override::Item::SwapMaint - Swap the maintainer field if necessary /*{{{*/
diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc
index 7ecfe78ed..153c4fb42 100644
--- a/ftparchive/writer.cc
+++ b/ftparchive/writer.cc
@@ -13,28 +13,37 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/error.h>
#include <apt-pkg/configuration.h>
-#include <apt-pkg/aptconfiguration.h>
-#include <apt-pkg/md5.h>
-#include <apt-pkg/hashes.h>
#include <apt-pkg/deblistparser.h>
+#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/gpgv.h>
+#include <apt-pkg/hashes.h>
+#include <apt-pkg/md5.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/debfile.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/sha1.h>
+#include <apt-pkg/sha2.h>
+#include <apt-pkg/tagfile.h>
+#include <ctype.h>
+#include <fnmatch.h>
+#include <ftw.h>
+#include <locale.h>
+#include <string.h>
+#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <ctime>
-#include <ftw.h>
-#include <fnmatch.h>
#include <iostream>
#include <sstream>
#include <memory>
+#include <utility>
+#include "apt-ftparchive.h"
#include "writer.h"
#include "cachedb.h"
-#include "apt-ftparchive.h"
#include "multicompress.h"
#include <apti18n.h>
@@ -72,9 +81,9 @@ FTWScanner::FTWScanner(string const &Arch): Arch(Arch)
/*}}}*/
// FTWScanner::Scanner - FTW Scanner /*{{{*/
// ---------------------------------------------------------------------
-/* This is the FTW scanner, it processes each directory element in the
+/* This is the FTW scanner, it processes each directory element in the
directory tree. */
-int FTWScanner::ScannerFTW(const char *File,const struct stat *sb,int Flag)
+int FTWScanner::ScannerFTW(const char *File,const struct stat * /*sb*/,int Flag)
{
if (Flag == FTW_DNR)
{
@@ -951,7 +960,7 @@ bool ContentsWriter::ReadFromPkgs(string const &PkgFile,string const &PkgCompres
// ReleaseWriter::ReleaseWriter - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-ReleaseWriter::ReleaseWriter(string const &DB)
+ReleaseWriter::ReleaseWriter(string const &/*DB*/)
{
if (_config->FindB("APT::FTPArchive::Release::Default-Patterns", true) == true)
{
diff --git a/ftparchive/writer.h b/ftparchive/writer.h
index 4932b0cc8..86884dcfc 100644
--- a/ftparchive/writer.h
+++ b/ftparchive/writer.h
@@ -13,14 +13,16 @@
#ifndef WRITER_H
#define WRITER_H
-
#include <string>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include <set>
+#include <stdlib.h>
+#include <sys/types.h>
+#include "contents.h"
#include "cachedb.h"
#include "override.h"
#include "apt-ftparchive.h"