summaryrefslogtreecommitdiff
path: root/apt-private
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-03-05 22:11:25 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2014-03-13 13:58:45 +0100
commit453b82a388013e522b3a1b9fcd6ed0810dab1f4f (patch)
treebaa519d4f494816eb31b4cd4d06351c2ba23a1b7 /apt-private
parent54298f49d71347616df19b8d2f59c907374e07b3 (diff)
cleanup headers and especially #includes everywhere
Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use)
Diffstat (limited to 'apt-private')
-rw-r--r--apt-private/acqprogress.cc5
-rw-r--r--apt-private/private-cachefile.cc12
-rw-r--r--apt-private/private-cachefile.h2
-rw-r--r--apt-private/private-cacheset.cc13
-rw-r--r--apt-private/private-cacheset.h15
-rw-r--r--apt-private/private-cmndline.cc6
-rw-r--r--apt-private/private-download.cc6
-rw-r--r--apt-private/private-download.h2
-rw-r--r--apt-private/private-install.cc68
-rw-r--r--apt-private/private-install.h18
-rw-r--r--apt-private/private-list.cc43
-rw-r--r--apt-private/private-list.h2
-rw-r--r--apt-private/private-main.cc12
-rw-r--r--apt-private/private-main.h3
-rw-r--r--apt-private/private-moo.cc12
-rw-r--r--apt-private/private-output.cc14
-rw-r--r--apt-private/private-output.h5
-rw-r--r--apt-private/private-search.cc44
-rw-r--r--apt-private/private-search.h2
-rw-r--r--apt-private/private-show.cc40
-rw-r--r--apt-private/private-show.h2
-rw-r--r--apt-private/private-sources.cc21
-rw-r--r--apt-private/private-sources.h7
-rw-r--r--apt-private/private-update.cc39
-rw-r--r--apt-private/private-upgrade.cc18
-rw-r--r--apt-private/private-upgrade.h4
-rw-r--r--apt-private/private-utils.cc8
-rw-r--r--apt-private/private-utils.h2
28 files changed, 226 insertions, 199 deletions
diff --git a/apt-private/acqprogress.cc b/apt-private/acqprogress.cc
index d08ed072f..fe7a45e12 100644
--- a/apt-private/acqprogress.cc
+++ b/apt-private/acqprogress.cc
@@ -10,18 +10,21 @@
// Include files /*{{{*/
#include<config.h>
+#include <apt-pkg/acquire.h>
#include <apt-pkg/acquire-item.h>
#include <apt-pkg/acquire-worker.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/error.h>
+#include <apt-private/acqprogress.h>
+
+#include <string.h>
#include <stdio.h>
#include <signal.h>
#include <iostream>
#include <unistd.h>
-#include "acqprogress.h"
#include <apti18n.h>
/*}}}*/
diff --git a/apt-private/private-cachefile.cc b/apt-private/private-cachefile.cc
index c822b9bad..5e955ac39 100644
--- a/apt-private/private-cachefile.cc
+++ b/apt-private/private-cachefile.cc
@@ -4,11 +4,17 @@
#include <apt-pkg/algorithms.h>
#include <apt-pkg/upgrade.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/depcache.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
-#include <cstdlib>
+#include <apt-private/private-output.h>
+#include <apt-private/private-cachefile.h>
-#include "private-output.h"
-#include "private-cachefile.h"
+#include <string.h>
+#include <ostream>
+#include <cstdlib>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-private/private-cachefile.h b/apt-private/private-cachefile.h
index f24d93020..94d93df2c 100644
--- a/apt-private/private-cachefile.h
+++ b/apt-private/private-cachefile.h
@@ -3,6 +3,8 @@
#include <apt-pkg/cachefile.h>
#include <apt-pkg/progress.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/pkgcache.h>
// class CacheFile - Cover class for some dependency cache functions /*{{{*/
diff --git a/apt-private/private-cacheset.cc b/apt-private/private-cacheset.cc
index a7dc0e800..4a63c7e81 100644
--- a/apt-private/private-cacheset.cc
+++ b/apt-private/private-cacheset.cc
@@ -1,9 +1,18 @@
+#include <config.h>
+
#include <apt-pkg/cachefile.h>
#include <apt-pkg/pkgcache.h>
#include <apt-pkg/depcache.h>
-#include <apt-pkg/strutl.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/progress.h>
+#include <apt-pkg/policy.h>
+
+#include <apt-private/private-cacheset.h>
+
+#include <stddef.h>
-#include "private-cacheset.h"
+#include <apti18n.h>
bool GetLocalitySortedVersionSet(pkgCacheFile &CacheFile,
LocalitySortedVersionSet &output_set,
diff --git a/apt-private/private-cacheset.h b/apt-private/private-cacheset.h
index 26c7f1ac2..854d16922 100644
--- a/apt-private/private-cacheset.h
+++ b/apt-private/private-cacheset.h
@@ -1,17 +1,32 @@
#ifndef APT_PRIVATE_CACHESET_H
#define APT_PRIVATE_CACHESET_H
+#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/cachefile.h>
#include <apt-pkg/cacheset.h>
#include <apt-pkg/sptr.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/depcache.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/macros.h>
#include <algorithm>
#include <vector>
+#include <string.h>
+#include <list>
+#include <ostream>
+#include <set>
+#include <string>
+#include <utility>
#include "private-output.h"
#include <apti18n.h>
+class OpProgress;
+
struct VersionSortDescriptionLocality
{
bool operator () (const pkgCache::VerIterator &v_lhs,
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc
index 132da04d5..2b2a35637 100644
--- a/apt-private/private-cmndline.cc
+++ b/apt-private/private-cmndline.cc
@@ -2,15 +2,13 @@
#include <config.h>
#include <apt-pkg/cmndline.h>
-#include <apt-pkg/configuration.h>
-#include <vector>
+#include <apt-private/private-cmndline.h>
+#include <vector>
#include <stdarg.h>
#include <string.h>
-#include "private-cmndline.h"
-
#include <apti18n.h>
/*}}}*/
diff --git a/apt-private/private-download.cc b/apt-private/private-download.cc
index 80795f964..a095f0c67 100644
--- a/apt-private/private-download.cc
+++ b/apt-private/private-download.cc
@@ -7,10 +7,8 @@
#include <apt-pkg/error.h>
#include <apt-pkg/strutl.h>
-#include "private-output.h"
-#include "private-download.h"
-
-#include <locale.h>
+#include <apt-private/private-output.h>
+#include <apt-private/private-download.h>
#include <fstream>
#include <string>
diff --git a/apt-private/private-download.h b/apt-private/private-download.h
index b8cc8da1e..1447845ed 100644
--- a/apt-private/private-download.h
+++ b/apt-private/private-download.h
@@ -1,7 +1,7 @@
#ifndef APT_PRIVATE_DOWNLOAD_H
#define APT_PRIVATE_DOWNLOAD_H
-#include <apt-pkg/acquire.h>
+class pkgAcquire;
bool CheckAuth(pkgAcquire& Fetcher, bool const PromptUser);
bool AcquireRun(pkgAcquire &Fetcher, int const PulseInterval, bool * const Failure, bool * const TransientNetworkFailure);
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc
index ff609f567..8092af939 100644
--- a/apt-private/private-install.cc
+++ b/apt-private/private-install.cc
@@ -1,57 +1,45 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/aptconfiguration.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/cmndline.h>
-#include <apt-pkg/init.h>
-#include <apt-pkg/depcache.h>
-#include <apt-pkg/sourcelist.h>
-#include <apt-pkg/algorithms.h>
+#include <apt-pkg/acquire.h>
#include <apt-pkg/acquire-item.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/fileutl.h>
-#include <apt-pkg/clean.h>
-#include <apt-pkg/srcrecords.h>
-#include <apt-pkg/version.h>
+#include <apt-pkg/algorithms.h>
#include <apt-pkg/cachefile.h>
#include <apt-pkg/cacheset.h>
-#include <apt-pkg/sptr.h>
-#include <apt-pkg/md5.h>
-#include <apt-pkg/versionmatch.h>
-#include <apt-pkg/progress.h>
-#include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/cmndline.h>
+#include <apt-pkg/depcache.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/pkgrecords.h>
-#include <apt-pkg/indexfile.h>
-#include <apt-pkg/install-progress.h>
-#include <apt-pkg/init.h>
+#include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/sptr.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/macros.h>
+#include <apt-pkg/packagemanager.h>
+#include <apt-pkg/pkgcache.h>
-#include <set>
-#include <locale.h>
-#include <langinfo.h>
-#include <fstream>
-#include <termios.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
#include <sys/statfs.h>
#include <sys/statvfs.h>
-#include <signal.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <errno.h>
-#include <regex.h>
-#include <sys/wait.h>
-#include <sstream>
+#include <algorithm>
+#include <iostream>
+#include <set>
+#include <vector>
-#include "private-install.h"
-#include "private-download.h"
-#include "private-cachefile.h"
-#include "private-output.h"
-#include "private-cacheset.h"
-#include "acqprogress.h"
+#include <apt-private/acqprogress.h>
+#include <apt-private/private-install.h>
+#include <apt-private/private-cachefile.h>
+#include <apt-private/private-cacheset.h>
+#include <apt-private/private-download.h>
+#include <apt-private/private-output.h>
#include <apti18n.h>
/*}}}*/
+class pkgSourceList;
// InstallPackages - Actually download and install the packages /*{{{*/
// ---------------------------------------------------------------------
diff --git a/apt-private/private-install.h b/apt-private/private-install.h
index 2187146d3..79769d470 100644
--- a/apt-private/private-install.h
+++ b/apt-private/private-install.h
@@ -1,15 +1,29 @@
#ifndef APT_PRIVATE_INSTALL_H
#define APT_PRIVATE_INSTALL_H
+#include <apt-pkg/cachefile.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/depcache.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/cacheset.h>
-#include <apt-pkg/cmndline.h>
#include <apt-pkg/strutl.h>
+#include <apt-pkg/algorithms.h>
+
+#include <stddef.h>
+#include <iosfwd>
+#include <list>
+#include <map>
+#include <string>
+#include <utility>
-#include "private-cachefile.h"
#include "private-output.h"
#include <apti18n.h>
+class CacheFile;
+class CommandLine;
+
#define RAMFS_MAGIC 0x858458f6
bool DoInstall(CommandLine &Cmd);
diff --git a/apt-private/private-list.cc b/apt-private/private-list.cc
index bc4539aeb..7664ca134 100644
--- a/apt-private/private-list.cc
+++ b/apt-private/private-list.cc
@@ -1,43 +1,28 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/error.h>
#include <apt-pkg/cachefile.h>
#include <apt-pkg/cachefilter.h>
#include <apt-pkg/cacheset.h>
-#include <apt-pkg/init.h>
-#include <apt-pkg/progress.h>
-#include <apt-pkg/sourcelist.h>
#include <apt-pkg/cmndline.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/fileutl.h>
#include <apt-pkg/pkgrecords.h>
-#include <apt-pkg/srcrecords.h>
-#include <apt-pkg/version.h>
-#include <apt-pkg/policy.h>
-#include <apt-pkg/tagfile.h>
-#include <apt-pkg/algorithms.h>
-#include <apt-pkg/sptr.h>
-#include <apt-pkg/pkgsystem.h>
-#include <apt-pkg/indexfile.h>
-#include <apt-pkg/metaindex.h>
+#include <apt-pkg/progress.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+
+#include <apt-private/private-cacheset.h>
+#include <apt-private/private-list.h>
+#include <apt-private/private-output.h>
+#include <iostream>
#include <sstream>
-#include <vector>
+#include <map>
+#include <string>
#include <utility>
-#include <cassert>
-#include <locale.h>
-#include <iostream>
-#include <unistd.h>
-#include <errno.h>
-#include <regex.h>
-#include <stdio.h>
-#include <algorithm>
-
-#include "private-cmndline.h"
-#include "private-list.h"
-#include "private-output.h"
-#include "private-cacheset.h"
+#include <vector>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-private/private-list.h b/apt-private/private-list.h
index 6f5aad27a..749744dd1 100644
--- a/apt-private/private-list.h
+++ b/apt-private/private-list.h
@@ -1,7 +1,7 @@
#ifndef APT_PRIVATE_LIST_H
#define APT_PRIVATE_LIST_H
-#include <apt-pkg/cmndline.h>
+class CommandLine;
bool List(CommandLine &Cmd);
diff --git a/apt-private/private-main.cc b/apt-private/private-main.cc
index 1fdf3f0be..2d3965172 100644
--- a/apt-private/private-main.cc
+++ b/apt-private/private-main.cc
@@ -1,9 +1,13 @@
+#include <config.h>
-#include<unistd.h>
-#include<cstring>
-
+#include <apt-pkg/cmndline.h>
#include <apt-pkg/configuration.h>
-#include "private-main.h"
+
+#include <apt-private/private-main.h>
+
+#include <iostream>
+#include <string.h>
+#include <unistd.h>
#include <apti18n.h>
diff --git a/apt-private/private-main.h b/apt-private/private-main.h
index f9a95c4ec..257c51a0b 100644
--- a/apt-private/private-main.h
+++ b/apt-private/private-main.h
@@ -1,9 +1,8 @@
#ifndef APT_PRIVATE_MAIN_H
#define APT_PRIVATE_MAIN_H
-#include <apt-pkg/cmndline.h>
+class CommandLine;
void CheckSimulateMode(CommandLine &CmdL);
-
#endif
diff --git a/apt-private/private-moo.cc b/apt-private/private-moo.cc
index 9c4f6bf15..a87999150 100644
--- a/apt-private/private-moo.cc
+++ b/apt-private/private-moo.cc
@@ -13,11 +13,15 @@
#include <apt-pkg/cmndline.h>
#include <apt-pkg/strutl.h>
-#include <strings.h>
-#include <sstream>
+#include <apt-private/private-moo.h>
+#include <apt-private/private-output.h>
-#include "private-moo.h"
-#include "private-output.h"
+#include <stddef.h>
+#include <string.h>
+#include <time.h>
+#include <iostream>
+#include <sstream>
+#include <string>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-private/private-output.cc b/apt-private/private-output.cc
index 52f65d794..bbd8545ad 100644
--- a/apt-private/private-output.cc
+++ b/apt-private/private-output.cc
@@ -7,16 +7,22 @@
#include <apt-pkg/cachefile.h>
#include <apt-pkg/pkgrecords.h>
#include <apt-pkg/policy.h>
+#include <apt-pkg/depcache.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-private/private-output.h>
+#include <apt-private/private-cachefile.h>
+
+#include <regex.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <iomanip>
#include <iostream>
-#include <locale.h>
#include <langinfo.h>
#include <unistd.h>
-#include "private-output.h"
-#include "private-cachefile.h"
-
#include <apti18n.h>
/*}}}*/
diff --git a/apt-private/private-output.h b/apt-private/private-output.h
index 2a2a69458..81643f90a 100644
--- a/apt-private/private-output.h
+++ b/apt-private/private-output.h
@@ -1,17 +1,14 @@
#ifndef APT_PRIVATE_OUTPUT_H
#define APT_PRIVATE_OUTPUT_H
+#include <apt-pkg/pkgcache.h>
-#include <iostream>
#include <fstream>
#include <string>
-#include "private-cachefile.h"
-
// forward declaration
class pkgCacheFile;
class CacheFile;
-class pkgCache;
class pkgDepCache;
class pkgRecords;
diff --git a/apt-private/private-search.cc b/apt-private/private-search.cc
index 0b1a929b0..8106333b6 100644
--- a/apt-private/private-search.cc
+++ b/apt-private/private-search.cc
@@ -1,40 +1,30 @@
// Includes /*{{{*/
-#include <apt-pkg/error.h>
+#include <config.h>
+
#include <apt-pkg/cachefile.h>
-#include <apt-pkg/cachefilter.h>
#include <apt-pkg/cacheset.h>
-#include <apt-pkg/init.h>
-#include <apt-pkg/progress.h>
-#include <apt-pkg/sourcelist.h>
#include <apt-pkg/cmndline.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/fileutl.h>
#include <apt-pkg/pkgrecords.h>
-#include <apt-pkg/srcrecords.h>
-#include <apt-pkg/version.h>
#include <apt-pkg/policy.h>
-#include <apt-pkg/tagfile.h>
-#include <apt-pkg/algorithms.h>
-#include <apt-pkg/sptr.h>
-#include <apt-pkg/pkgsystem.h>
-#include <apt-pkg/indexfile.h>
-#include <apt-pkg/metaindex.h>
+#include <apt-pkg/progress.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/depcache.h>
+#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
-#include <sstream>
-#include <utility>
-#include <cassert>
-#include <locale.h>
+#include <apt-private/private-cacheset.h>
+#include <apt-private/private-output.h>
+#include <apt-private/private-search.h>
+
+#include <string.h>
#include <iostream>
-#include <unistd.h>
-#include <errno.h>
-#include <regex.h>
-#include <stdio.h>
-#include <iomanip>
-#include <algorithm>
+#include <sstream>
#include <map>
+#include <string>
+#include <utility>
-#include "private-search.h"
-#include "private-cacheset.h"
+#include <apti18n.h>
/*}}}*/
bool FullTextSearch(CommandLine &CmdL) /*{{{*/
diff --git a/apt-private/private-search.h b/apt-private/private-search.h
index 17faffebc..539915f1f 100644
--- a/apt-private/private-search.h
+++ b/apt-private/private-search.h
@@ -1,7 +1,7 @@
#ifndef APT_PRIVATE_SEARCH_H
#define APT_PRIVATE_SEARCH_H
-#include <apt-pkg/cmndline.h>
+class CommandLine;
bool FullTextSearch(CommandLine &CmdL);
diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc
index 94f944af1..8ae6a6dac 100644
--- a/apt-private/private-show.cc
+++ b/apt-private/private-show.cc
@@ -1,30 +1,32 @@
// Includes /*{{{*/
-#include <apt-pkg/error.h>
+#include <config.h>
+
#include <apt-pkg/cachefile.h>
-#include <apt-pkg/cachefilter.h>
#include <apt-pkg/cacheset.h>
-#include <apt-pkg/init.h>
-#include <apt-pkg/progress.h>
-#include <apt-pkg/sourcelist.h>
#include <apt-pkg/cmndline.h>
-#include <apt-pkg/strutl.h>
+#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/indexfile.h>
#include <apt-pkg/pkgrecords.h>
-#include <apt-pkg/srcrecords.h>
-#include <apt-pkg/version.h>
-#include <apt-pkg/policy.h>
-#include <apt-pkg/tagfile.h>
-#include <apt-pkg/algorithms.h>
-#include <apt-pkg/sptr.h>
#include <apt-pkg/pkgsystem.h>
-#include <apt-pkg/indexfile.h>
-#include <apt-pkg/metaindex.h>
+#include <apt-pkg/sourcelist.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/tagfile.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/depcache.h>
+#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
-#include <apti18n.h>
+#include <apt-private/private-cacheset.h>
+#include <apt-private/private-output.h>
+#include <apt-private/private-show.h>
+
+#include <stdio.h>
+#include <ostream>
+#include <string>
-#include "private-output.h"
-#include "private-cacheset.h"
-#include "private-show.h"
+#include <apti18n.h>
/*}}}*/
namespace APT {
@@ -33,7 +35,7 @@ namespace APT {
// DisplayRecord - Displays the complete record for the package /*{{{*/
// ---------------------------------------------------------------------
static bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V,
- ostream &out)
+ std::ostream &out)
{
pkgCache *Cache = CacheFile.GetPkgCache();
if (unlikely(Cache == NULL))
diff --git a/apt-private/private-show.h b/apt-private/private-show.h
index b428c7af0..a15367e28 100644
--- a/apt-private/private-show.h
+++ b/apt-private/private-show.h
@@ -1,7 +1,7 @@
#ifndef APT_PRIVATE_SHOW_H
#define APT_PRIVATE_SHOW_H
-#include <apt-pkg/cmndline.h>
+class CommandLine;
namespace APT {
namespace Cmd {
diff --git a/apt-private/private-sources.cc b/apt-private/private-sources.cc
index 41cf6b313..301936b9d 100644
--- a/apt-private/private-sources.cc
+++ b/apt-private/private-sources.cc
@@ -1,10 +1,23 @@
+#include <config.h>
#include <apt-pkg/hashes.h>
-#include <apti18n.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/sourcelist.h>
+#include <apt-pkg/cmndline.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
+
+#include <apt-private/private-output.h>
+#include <apt-private/private-sources.h>
+#include <apt-private/private-utils.h>
-#include "private-output.h"
-#include "private-sources.h"
-#include "private-utils.h"
+#include <stddef.h>
+#include <unistd.h>
+#include <iostream>
+#include <string>
+
+#include <apti18n.h>
/* Interface discussion with donkult (for the future):
apt [add-{archive,release,component}|edit|change-release|disable]-sources
diff --git a/apt-private/private-sources.h b/apt-private/private-sources.h
index b394622be..4c58af180 100644
--- a/apt-private/private-sources.h
+++ b/apt-private/private-sources.h
@@ -1,3 +1,8 @@
-#include <apt-pkg/cmndline.h>
+#ifndef APT_PRIVATE_SOURCES_H
+#define APT_PRIVATE_SOURCES_H
+
+class CommandLine;
bool EditSources(CommandLine &CmdL);
+
+#endif
diff --git a/apt-private/private-update.cc b/apt-private/private-update.cc
index 1f6fb6f79..da83d7741 100644
--- a/apt-private/private-update.cc
+++ b/apt-private/private-update.cc
@@ -1,38 +1,23 @@
// Include files /*{{{*/
#include<config.h>
-#include <apt-pkg/aptconfiguration.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/cmndline.h>
-#include <apt-pkg/init.h>
-#include <apt-pkg/depcache.h>
-#include <apt-pkg/sourcelist.h>
-#include <apt-pkg/algorithms.h>
#include <apt-pkg/acquire-item.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/fileutl.h>
-#include <apt-pkg/clean.h>
-#include <apt-pkg/srcrecords.h>
-#include <apt-pkg/version.h>
#include <apt-pkg/cachefile.h>
-#include <apt-pkg/cacheset.h>
-#include <apt-pkg/sptr.h>
-#include <apt-pkg/md5.h>
-#include <apt-pkg/versionmatch.h>
-#include <apt-pkg/progress.h>
-#include <apt-pkg/pkgsystem.h>
-#include <apt-pkg/pkgrecords.h>
-#include <apt-pkg/indexfile.h>
+#include <apt-pkg/cmndline.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/sourcelist.h>
#include <apt-pkg/update.h>
+#include <apt-pkg/acquire.h>
+#include <apt-pkg/configuration.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
+#include <apt-private/acqprogress.h>
+#include <apt-private/private-cachefile.h>
+#include <apt-private/private-output.h>
+#include <apt-private/private-update.h>
-#include "private-cachefile.h"
-#include "private-output.h"
-#include "private-update.h"
-#include "acqprogress.h"
+#include <ostream>
+#include <string>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-private/private-upgrade.cc b/apt-private/private-upgrade.cc
index a97e6d25b..68b2c5e00 100644
--- a/apt-private/private-upgrade.cc
+++ b/apt-private/private-upgrade.cc
@@ -1,12 +1,18 @@
-
// Includes /*{{{*/
-#include <apt-pkg/algorithms.h>
+#include <config.h>
+
#include <apt-pkg/upgrade.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/error.h>
+
+#include <apt-private/private-install.h>
+#include <apt-private/private-cachefile.h>
+#include <apt-private/private-upgrade.h>
+#include <apt-private/private-output.h>
+
#include <iostream>
-#include "private-install.h"
-#include "private-cachefile.h"
-#include "private-upgrade.h"
-#include "private-output.h"
+
+#include <apti18n.h>
/*}}}*/
// this is actually performing the various upgrade operations
diff --git a/apt-private/private-upgrade.h b/apt-private/private-upgrade.h
index 5efc66bf7..64c4c0874 100644
--- a/apt-private/private-upgrade.h
+++ b/apt-private/private-upgrade.h
@@ -1,13 +1,11 @@
#ifndef APTPRIVATE_PRIVATE_UPGRADE_H
#define APTPRIVATE_PRIVATE_UPGRADE_H
-#include <apt-pkg/cmndline.h>
-
+class CommandLine;
bool DoDistUpgrade(CommandLine &CmdL);
bool DoUpgrade(CommandLine &CmdL);
bool DoUpgradeNoNewPackages(CommandLine &CmdL);
bool DoUpgradeWithAllowNewPackages(CommandLine &CmdL);
-
#endif
diff --git a/apt-private/private-utils.cc b/apt-private/private-utils.cc
index 813f19329..9547a1b75 100644
--- a/apt-private/private-utils.cc
+++ b/apt-private/private-utils.cc
@@ -1,9 +1,12 @@
-#include <cstdlib>
+#include <config.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/fileutl.h>
-#include "private-utils.h"
+#include <apt-private/private-utils.h>
+
+#include <cstdlib>
+#include <unistd.h>
// DisplayFileInPager - Display File with pager /*{{{*/
void DisplayFileInPager(std::string filename)
@@ -26,7 +29,6 @@ void DisplayFileInPager(std::string filename)
ExecWait(Process, "sensible-pager", false);
}
/*}}}*/
-
// EditFileInSensibleEditor - Edit File with editor /*{{{*/
void EditFileInSensibleEditor(std::string filename)
{
diff --git a/apt-private/private-utils.h b/apt-private/private-utils.h
index 258dd06a8..4bb535e86 100644
--- a/apt-private/private-utils.h
+++ b/apt-private/private-utils.h
@@ -6,6 +6,4 @@
void DisplayFileInPager(std::string filename);
void EditFileInSensibleEditor(std::string filename);
-
-
#endif