summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.clang-format16
-rw-r--r--apt-inst/contrib/arfile.cc8
-rw-r--r--apt-inst/contrib/arfile.h3
-rw-r--r--apt-inst/contrib/extracttar.cc16
-rw-r--r--apt-inst/deb/debfile.cc10
-rw-r--r--apt-inst/deb/debfile.h3
-rw-r--r--apt-inst/dirstream.cc4
-rw-r--r--apt-inst/extract.cc19
-rw-r--r--apt-inst/extract.h1
-rw-r--r--apt-inst/filelist.cc6
-rw-r--r--apt-pkg/acquire-item.cc33
-rw-r--r--apt-pkg/acquire-item.h9
-rw-r--r--apt-pkg/acquire-method.cc12
-rw-r--r--apt-pkg/acquire-worker.cc18
-rw-r--r--apt-pkg/acquire-worker.h2
-rw-r--r--apt-pkg/acquire.cc26
-rw-r--r--apt-pkg/acquire.h4
-rw-r--r--apt-pkg/algorithms.cc11
-rw-r--r--apt-pkg/algorithms.h6
-rw-r--r--apt-pkg/aptconfiguration.cc12
-rw-r--r--apt-pkg/aptconfiguration.h2
-rw-r--r--apt-pkg/cachefile.cc22
-rw-r--r--apt-pkg/cachefile.h1
-rw-r--r--apt-pkg/cachefilter.cc7
-rw-r--r--apt-pkg/cachefilter.h1
-rw-r--r--apt-pkg/cacheiterators.h10
-rw-r--r--apt-pkg/cacheset.cc19
-rw-r--r--apt-pkg/cacheset.h13
-rw-r--r--apt-pkg/cdrom.cc27
-rw-r--r--apt-pkg/cdrom.h4
-rw-r--r--apt-pkg/clean.cc15
-rw-r--r--apt-pkg/contrib/cdromutl.cc14
-rw-r--r--apt-pkg/contrib/cmndline.cc6
-rw-r--r--apt-pkg/contrib/configuration.cc10
-rw-r--r--apt-pkg/contrib/configuration.h2
-rw-r--r--apt-pkg/contrib/error.cc35
-rw-r--r--apt-pkg/contrib/error.h2
-rw-r--r--apt-pkg/contrib/fileutl.cc48
-rw-r--r--apt-pkg/contrib/fileutl.h4
-rw-r--r--apt-pkg/contrib/gpgv.cc18
-rw-r--r--apt-pkg/contrib/hashes.cc12
-rw-r--r--apt-pkg/contrib/hashes.h3
-rw-r--r--apt-pkg/contrib/hashsum.cc2
-rw-r--r--apt-pkg/contrib/hashsum_template.h3
-rw-r--r--apt-pkg/contrib/md5.h4
-rw-r--r--apt-pkg/contrib/mmap.cc8
-rw-r--r--apt-pkg/contrib/mmap.h1
-rw-r--r--apt-pkg/contrib/netrc.cc4
-rw-r--r--apt-pkg/contrib/progress.cc10
-rw-r--r--apt-pkg/contrib/progress.h3
-rw-r--r--apt-pkg/contrib/proxy.cc14
-rw-r--r--apt-pkg/contrib/sha1.h4
-rw-r--r--apt-pkg/contrib/sha2.h4
-rw-r--r--apt-pkg/contrib/sha2_internal.cc6
-rw-r--r--apt-pkg/contrib/sha2_internal.h2
-rw-r--r--apt-pkg/contrib/srvrec.cc4
-rw-r--r--apt-pkg/contrib/srvrec.h4
-rw-r--r--apt-pkg/contrib/string_view.h4
-rw-r--r--apt-pkg/contrib/strutl.cc22
-rw-r--r--apt-pkg/contrib/strutl.h7
-rw-r--r--apt-pkg/deb/debindexfile.cc9
-rw-r--r--apt-pkg/deb/debindexfile.h1
-rw-r--r--apt-pkg/deb/deblistparser.cc19
-rw-r--r--apt-pkg/deb/deblistparser.h6
-rw-r--r--apt-pkg/deb/debmetaindex.cc24
-rw-r--r--apt-pkg/deb/debmetaindex.h2
-rw-r--r--apt-pkg/deb/debrecords.cc11
-rw-r--r--apt-pkg/deb/debrecords.h4
-rw-r--r--apt-pkg/deb/debsrcrecords.cc14
-rw-r--r--apt-pkg/deb/debsrcrecords.h4
-rw-r--r--apt-pkg/deb/debsystem.cc17
-rw-r--r--apt-pkg/deb/debsystem.h3
-rw-r--r--apt-pkg/deb/debversion.cc4
-rw-r--r--apt-pkg/deb/dpkgpm.cc19
-rw-r--r--apt-pkg/deb/dpkgpm.h6
-rw-r--r--apt-pkg/depcache.cc33
-rw-r--r--apt-pkg/depcache.h7
-rw-r--r--apt-pkg/edsp.cc19
-rw-r--r--apt-pkg/edsp.h3
-rw-r--r--apt-pkg/edsp/edspindexfile.cc4
-rw-r--r--apt-pkg/edsp/edsplistparser.cc7
-rw-r--r--apt-pkg/edsp/edsplistparser.h4
-rw-r--r--apt-pkg/edsp/edspsystem.cc3
-rw-r--r--apt-pkg/edsp/edspsystem.h3
-rw-r--r--apt-pkg/indexcopy.cc24
-rw-r--r--apt-pkg/indexfile.cc17
-rw-r--r--apt-pkg/indexfile.h7
-rw-r--r--apt-pkg/init.cc12
-rw-r--r--apt-pkg/install-progress.cc14
-rw-r--r--apt-pkg/install-progress.h4
-rw-r--r--apt-pkg/metaindex.cc4
-rw-r--r--apt-pkg/metaindex.h2
-rw-r--r--apt-pkg/orderlist.cc11
-rw-r--r--apt-pkg/orderlist.h3
-rw-r--r--apt-pkg/packagemanager.cc21
-rw-r--r--apt-pkg/packagemanager.h6
-rw-r--r--apt-pkg/pkgcache.cc24
-rw-r--r--apt-pkg/pkgcache.h18
-rw-r--r--apt-pkg/pkgcachegen.cc25
-rw-r--r--apt-pkg/pkgcachegen.h5
-rw-r--r--apt-pkg/pkgrecords.cc9
-rw-r--r--apt-pkg/pkgrecords.h2
-rw-r--r--apt-pkg/pkgsystem.cc6
-rw-r--r--apt-pkg/pkgsystem.h1
-rw-r--r--apt-pkg/policy.cc23
-rw-r--r--apt-pkg/policy.h3
-rw-r--r--apt-pkg/prettyprinters.h2
-rw-r--r--apt-pkg/sourcelist.cc27
-rw-r--r--apt-pkg/sourcelist.h5
-rw-r--r--apt-pkg/srcrecords.cc10
-rw-r--r--apt-pkg/srcrecords.h2
-rw-r--r--apt-pkg/statechanges.cc4
-rw-r--r--apt-pkg/statechanges.h2
-rw-r--r--apt-pkg/tagfile-compat.cc2
-rw-r--r--apt-pkg/tagfile.cc10
-rw-r--r--apt-pkg/tagfile.h4
-rw-r--r--apt-pkg/update.cc2
-rw-r--r--apt-pkg/upgrade.cc5
-rw-r--r--apt-pkg/upgrade.h2
-rw-r--r--apt-pkg/version.cc4
-rw-r--r--apt-pkg/versionmatch.cc15
-rw-r--r--apt-pkg/versionmatch.h1
-rw-r--r--apt-private/acqprogress.cc12
-rw-r--r--apt-private/acqprogress.h2
-rw-r--r--apt-private/private-cachefile.cc14
-rw-r--r--apt-private/private-cachefile.h6
-rw-r--r--apt-private/private-cacheset.cc9
-rw-r--r--apt-private/private-cacheset.h2
-rw-r--r--apt-private/private-cmndline.cc8
-rw-r--r--apt-private/private-depends.cc5
-rw-r--r--apt-private/private-download.cc16
-rw-r--r--apt-private/private-install.cc23
-rw-r--r--apt-private/private-install.h5
-rw-r--r--apt-private/private-list.cc9
-rw-r--r--apt-private/private-main.cc3
-rw-r--r--apt-private/private-moo.cc10
-rw-r--r--apt-private/private-output.cc23
-rw-r--r--apt-private/private-output.h6
-rw-r--r--apt-private/private-search.cc11
-rw-r--r--apt-private/private-search.h2
-rw-r--r--apt-private/private-show.cc15
-rw-r--r--apt-private/private-show.h2
-rw-r--r--apt-private/private-source.cc5
-rw-r--r--apt-private/private-sources.cc18
-rw-r--r--apt-private/private-unmet.cc2
-rw-r--r--apt-private/private-update.cc6
-rw-r--r--apt-private/private-upgrade.cc6
-rw-r--r--cmdline/apt-cache.cc27
-rw-r--r--cmdline/apt-cdrom.cc16
-rw-r--r--cmdline/apt-config.cc10
-rw-r--r--cmdline/apt-extracttemplates.cc23
-rw-r--r--cmdline/apt-extracttemplates.h2
-rw-r--r--cmdline/apt-get.cc23
-rw-r--r--cmdline/apt-helper.cc18
-rw-r--r--cmdline/apt-internal-planner.cc27
-rw-r--r--cmdline/apt-internal-solver.cc27
-rw-r--r--cmdline/apt-mark.cc23
-rw-r--r--cmdline/apt-sortpkgs.cc18
-rw-r--r--cmdline/apt.cc26
-rw-r--r--ftparchive/apt-ftparchive.cc24
-rw-r--r--ftparchive/apt-ftparchive.h1
-rw-r--r--ftparchive/byhash.cc8
-rw-r--r--ftparchive/cachedb.cc14
-rw-r--r--ftparchive/cachedb.h6
-rw-r--r--ftparchive/contents.h2
-rw-r--r--ftparchive/multicompress.cc10
-rw-r--r--ftparchive/multicompress.h2
-rw-r--r--ftparchive/override.cc6
-rw-r--r--ftparchive/override.h2
-rw-r--r--ftparchive/sources.cc2
-rw-r--r--ftparchive/writer.cc22
-rw-r--r--ftparchive/writer.h10
-rw-r--r--methods/aptmethod.h3
-rw-r--r--methods/basehttp.cc10
-rw-r--r--methods/basehttp.h8
-rw-r--r--methods/cdrom.cc4
-rw-r--r--methods/connect.cc20
-rw-r--r--methods/connect.h2
-rw-r--r--methods/copy.cc8
-rw-r--r--methods/curl.cc15
-rw-r--r--methods/curl.h6
-rw-r--r--methods/file.cc4
-rw-r--r--methods/ftp.cc20
-rw-r--r--methods/ftp.h2
-rw-r--r--methods/gpgv.cc10
-rw-r--r--methods/http.cc16
-rw-r--r--methods/http_main.cc2
-rw-r--r--methods/mirror.cc20
-rw-r--r--methods/rfc2553emu.cc6
-rw-r--r--methods/rfc2553emu.h2
-rw-r--r--methods/rred.cc14
-rw-r--r--methods/rsh.cc12
-rw-r--r--methods/store.cc8
-rw-r--r--test/interactive-helper/aptwebserver.cc4
-rw-r--r--test/interactive-helper/extract-control.cc2
-rw-r--r--test/interactive-helper/rpmver.cc6
-rw-r--r--test/interactive-helper/teestream.h2
-rw-r--r--test/interactive-helper/test_fileutl.cc8
-rw-r--r--test/interactive-helper/test_udevcdrom.cc6
-rw-r--r--test/interactive-helper/testdeb.cc4
-rw-r--r--test/libapt/acqprogress_test.cc8
-rw-r--r--test/libapt/cdrom_test.cc4
-rw-r--r--test/libapt/cdromfindpackages_test.cc2
-rw-r--r--test/libapt/compareversion_test.cc4
-rw-r--r--test/libapt/extracttar_test.cc2
-rw-r--r--test/libapt/file-helpers.cc4
-rw-r--r--test/libapt/fileutl_test.cc4
-rw-r--r--test/libapt/getlanguages_test.cc4
-rw-r--r--test/libapt/getlistoffilesindir_test.cc4
-rw-r--r--test/libapt/globalerror_test.cc2
-rw-r--r--test/libapt/gtest_runner.cc2
-rw-r--r--test/libapt/hashsums_test.cc6
-rw-r--r--test/libapt/indexcopytosourcelist_test.cc2
-rw-r--r--test/libapt/parsedepends_test.cc4
-rw-r--r--test/libapt/priority_test.cc2
-rw-r--r--test/libapt/sourcelist_test.cc2
-rw-r--r--test/libapt/strutil_test.cc2
-rw-r--r--test/libapt/tagfile_test.cc2
-rw-r--r--test/libapt/tagsection_test.cc2
-rw-r--r--test/libapt/teestream_test.cc6
-rw-r--r--test/libapt/uri_test.cc2
221 files changed, 988 insertions, 1039 deletions
diff --git a/.clang-format b/.clang-format
index 3f5e0c127..654100364 100644
--- a/.clang-format
+++ b/.clang-format
@@ -7,4 +7,18 @@ IndentWidth: 3
ColumnLimit: 0
BreakBeforeBraces: Allman
AccessModifierOffset: 0
-SortIncludes: false
+IncludeCategories:
+ - Regex: 'apti18n.h'
+ Priority: 9999
+ - Regex: 'apt-[^/]*/'
+ Priority: 20
+ - Regex: '^"'
+ Priority: 10
+ - Regex: 'config.h'
+ Priority: 0
+ - Regex: '(zlib|bzlib|lzma|lz4frame|gtest/gtest|db|gnutls/.*)\.h'
+ Priority: 30
+ - Regex: '\.h'
+ Priority: 100
+ - Regex: '.*'
+ Priority: 99
diff --git a/apt-inst/contrib/arfile.cc b/apt-inst/contrib/arfile.cc
index 905110781..26c85d066 100644
--- a/apt-inst/contrib/arfile.cc
+++ b/apt-inst/contrib/arfile.cc
@@ -14,16 +14,16 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
#include <apt-pkg/arfile.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/fileutl.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/strutl.h>
+#include <string>
#include <string.h>
#include <sys/types.h>
-#include <string>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-inst/contrib/arfile.h b/apt-inst/contrib/arfile.h
index 297303a9d..47624c72a 100644
--- a/apt-inst/contrib/arfile.h
+++ b/apt-inst/contrib/arfile.h
@@ -15,9 +15,8 @@
#ifndef PKGLIB_ARFILE_H
#define PKGLIB_ARFILE_H
-
-#include <string>
#include <apt-pkg/macros.h>
+#include <string>
#ifndef APT_8_CLEANER_HEADERS
#include <apt-pkg/fileutl.h>
#endif
diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc
index 60360053e..69e43d6a1 100644
--- a/apt-inst/contrib/extracttar.cc
+++ b/apt-inst/contrib/extracttar.cc
@@ -16,22 +16,22 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/dirstream.h>
-#include <apt-pkg/extracttar.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/configuration.h>
+#include <apt-pkg/extracttar.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/strutl.h>
-#include <string.h>
#include <algorithm>
+#include <iostream>
#include <string>
-#include <unistd.h>
-#include <signal.h>
#include <fcntl.h>
-#include <iostream>
+#include <signal.h>
+#include <string.h>
+#include <unistd.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-inst/deb/debfile.cc b/apt-inst/deb/debfile.cc
index 474fb1cbe..8eef446bb 100644
--- a/apt-inst/deb/debfile.cc
+++ b/apt-inst/deb/debfile.cc
@@ -16,20 +16,20 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
-#include <apt-pkg/debfile.h>
-#include <apt-pkg/extracttar.h>
-#include <apt-pkg/error.h>
#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/arfile.h>
+#include <apt-pkg/debfile.h>
#include <apt-pkg/dirstream.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/extracttar.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/tagfile.h>
-#include <string.h>
#include <string>
#include <vector>
+#include <string.h>
#include <sys/stat.h>
#include <apti18n.h>
diff --git a/apt-inst/deb/debfile.h b/apt-inst/deb/debfile.h
index 02ebaae2e..0bc3254d6 100644
--- a/apt-inst/deb/debfile.h
+++ b/apt-inst/deb/debfile.h
@@ -23,11 +23,10 @@
#ifndef PKGLIB_DEBFILE_H
#define PKGLIB_DEBFILE_H
-
#include <apt-pkg/arfile.h>
#include <apt-pkg/dirstream.h>
-#include <apt-pkg/tagfile.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/tagfile.h>
#include <string>
diff --git a/apt-inst/dirstream.cc b/apt-inst/dirstream.cc
index 888020bfb..f43e9953b 100644
--- a/apt-inst/dirstream.cc
+++ b/apt-inst/dirstream.cc
@@ -11,15 +11,15 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
#include <apt-pkg/dirstream.h>
#include <apt-pkg/error.h>
+#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/time.h>
-#include <errno.h>
#include <unistd.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-inst/extract.cc b/apt-inst/extract.cc
index f50c23e46..667524c9e 100644
--- a/apt-inst/extract.cc
+++ b/apt-inst/extract.cc
@@ -44,25 +44,24 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
-#include <apt-pkg/extract.h>
-#include <apt-pkg/error.h>
#include <apt-pkg/debversion.h>
-#include <apt-pkg/fileutl.h>
#include <apt-pkg/dirstream.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/extract.h>
#include <apt-pkg/filelist.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/mmap.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
-#include <string.h>
+#include <iostream>
#include <string>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <errno.h>
#include <dirent.h>
-#include <iostream>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/stat.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-inst/extract.h b/apt-inst/extract.h
index a62ff51bd..d2e355474 100644
--- a/apt-inst/extract.h
+++ b/apt-inst/extract.h
@@ -20,7 +20,6 @@
#include <apt-pkg/dirstream.h>
#include <apt-pkg/filelist.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <string>
diff --git a/apt-inst/filelist.cc b/apt-inst/filelist.cc
index 6251b79b5..8a16574ea 100644
--- a/apt-inst/filelist.cc
+++ b/apt-inst/filelist.cc
@@ -32,15 +32,15 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
+#include <apt-pkg/error.h>
#include <apt-pkg/filelist.h>
#include <apt-pkg/mmap.h>
-#include <apt-pkg/error.h>
#include <apt-pkg/strutl.h>
-#include <string.h>
#include <iostream>
+#include <string.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index f807178e6..668b68ed4 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -16,37 +16,36 @@
#include <config.h>
#include <apt-pkg/acquire-item.h>
-#include <apt-pkg/configuration.h>
+#include <apt-pkg/acquire.h>
#include <apt-pkg/aptconfiguration.h>
-#include <apt-pkg/sourcelist.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/strutl.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/tagfile.h>
-#include <apt-pkg/metaindex.h>
-#include <apt-pkg/acquire.h>
+#include <apt-pkg/gpgv.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/indexfile.h>
+#include <apt-pkg/metaindex.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/pkgrecords.h>
-#include <apt-pkg/gpgv.h>
+#include <apt-pkg/sourcelist.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/tagfile.h>
#include <algorithm>
+#include <ctime>
+#include <iostream>
+#include <numeric>
+#include <random>
+#include <sstream>
+#include <string>
+#include <vector>
+#include <errno.h>
#include <stddef.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <iostream>
-#include <vector>
#include <sys/stat.h>
#include <unistd.h>
-#include <errno.h>
-#include <string>
-#include <stdio.h>
-#include <ctime>
-#include <sstream>
-#include <numeric>
-#include <random>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h
index 343144122..a5c7d848a 100644
--- a/apt-pkg/acquire-item.h
+++ b/apt-pkg/acquire-item.h
@@ -20,19 +20,18 @@
#define PKGLIB_ACQUIRE_ITEM_H
#include <apt-pkg/acquire.h>
-#include <apt-pkg/indexfile.h>
#include <apt-pkg/hashes.h>
-#include <apt-pkg/weakptr.h>
+#include <apt-pkg/indexfile.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/weakptr.h>
+#include <map>
#include <string>
#include <vector>
-#include <map>
#ifndef APT_8_CLEANER_HEADERS
-#include <apt-pkg/sourcelist.h>
#include <apt-pkg/pkgrecords.h>
+#include <apt-pkg/sourcelist.h>
#endif
/** \addtogroup acquire
diff --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc
index ab0908014..058ec7945 100644
--- a/apt-pkg/acquire-method.cc
+++ b/apt-pkg/acquire-method.cc
@@ -18,23 +18,23 @@
#include <config.h>
#include <apt-pkg/acquire-method.h>
-#include <apt-pkg/error.h>
#include <apt-pkg/configuration.h>
-#include <apt-pkg/strutl.h>
+#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/md5.h>
#include <apt-pkg/sha1.h>
#include <apt-pkg/sha2.h>
+#include <apt-pkg/strutl.h>
+#include <iostream>
+#include <string>
+#include <vector>
#include <stdarg.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <string>
-#include <vector>
-#include <iostream>
-#include <stdio.h>
/*}}}*/
using namespace std;
diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc
index c15e7ab4c..4aa55a743 100644
--- a/apt-pkg/acquire-worker.cc
+++ b/apt-pkg/acquire-worker.cc
@@ -14,27 +14,27 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/acquire.h>
-#include <apt-pkg/acquire-worker.h>
#include <apt-pkg/acquire-item.h>
+#include <apt-pkg/acquire-worker.h>
+#include <apt-pkg/acquire.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/strutl.h>
#include <apt-pkg/hashes.h>
+#include <apt-pkg/strutl.h>
#include <algorithm>
+#include <iostream>
#include <string>
#include <vector>
-#include <iostream>
-#include <sys/stat.h>
-#include <stdlib.h>
-#include <unistd.h>
+#include <sstream>
+#include <errno.h>
#include <signal.h>
#include <stdio.h>
-#include <errno.h>
-#include <sstream>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/acquire-worker.h b/apt-pkg/acquire-worker.h
index 42762abe0..8fc686880 100644
--- a/apt-pkg/acquire-worker.h
+++ b/apt-pkg/acquire-worker.h
@@ -21,9 +21,9 @@
#include <apt-pkg/acquire.h>
#include <apt-pkg/weakptr.h>
-#include <sys/types.h>
#include <string>
#include <vector>
+#include <sys/types.h>
/** \brief A fetch subprocess.
*
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index f1dbff9f1..05f22f243 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -15,35 +15,35 @@
// 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/acquire.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/strutl.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/strutl.h>
#include <algorithm>
+#include <iomanip>
+#include <iostream>
+#include <memory>
#include <numeric>
+#include <sstream>
#include <string>
#include <vector>
-#include <iostream>
-#include <sstream>
-#include <iomanip>
-#include <memory>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <grp.h>
+#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <pwd.h>
-#include <grp.h>
-#include <dirent.h>
-#include <sys/time.h>
#include <sys/select.h>
-#include <errno.h>
#include <sys/stat.h>
+#include <sys/time.h>
+#include <unistd.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/acquire.h b/apt-pkg/acquire.h
index 8331c56e9..e58aeef65 100644
--- a/apt-pkg/acquire.h
+++ b/apt-pkg/acquire.h
@@ -65,16 +65,16 @@
#ifndef PKGLIB_ACQUIRE_H
#define PKGLIB_ACQUIRE_H
+#include <apt-pkg/hashes.h>
#include <apt-pkg/macros.h>
#include <apt-pkg/weakptr.h>
-#include <apt-pkg/hashes.h>
#include <string>
#include <vector>
#include <stddef.h>
-#include <sys/time.h>
#include <sys/select.h>
+#include <sys/time.h>
#ifndef APT_10_CLEANER_HEADERS
#include <unistd.h>
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc
index 2c0cd1104..643ff8afd 100644
--- a/apt-pkg/algorithms.cc
+++ b/apt-pkg/algorithms.cc
@@ -17,21 +17,20 @@
#include <config.h>
#include <apt-pkg/algorithms.h>
-#include <apt-pkg/error.h>
#include <apt-pkg/configuration.h>
-#include <apt-pkg/edsp.h>
#include <apt-pkg/depcache.h>
+#include <apt-pkg/dpkgpm.h>
+#include <apt-pkg/edsp.h>
+#include <apt-pkg/error.h>
#include <apt-pkg/packagemanager.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/prettyprinters.h>
-#include <apt-pkg/dpkgpm.h>
-#include <string.h>
-#include <string>
#include <cstdlib>
#include <iostream>
+#include <string>
#include <utility>
+#include <string.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h
index 5148ff19d..c5c9f4c69 100644
--- a/apt-pkg/algorithms.h
+++ b/apt-pkg/algorithms.h
@@ -29,11 +29,9 @@
#ifndef PKGLIB_ALGORITHMS_H
#define PKGLIB_ALGORITHMS_H
-
-#include <apt-pkg/packagemanager.h>
#include <apt-pkg/depcache.h>
+#include <apt-pkg/packagemanager.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <iostream>
#include <string>
@@ -47,8 +45,8 @@ using std::ostream;
#ifndef APT_9_CLEANER_HEADERS
// include pkg{DistUpgrade,AllUpgrade,MiniizeUpgrade} here for compatibility
-#include <apt-pkg/upgrade.h>
#include <apt-pkg/update.h>
+#include <apt-pkg/upgrade.h>
#endif
diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc
index 0035f70df..405472a72 100644
--- a/apt-pkg/aptconfiguration.cc
+++ b/apt-pkg/aptconfiguration.cc
@@ -15,20 +15,20 @@
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/macros.h>
-#include <apt-pkg/strutl.h>
#include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/strutl.h>
+#include <algorithm>
+#include <string>
+#include <vector>
+#include <ctype.h>
#include <dirent.h>
-#include <stdio.h>
#include <fcntl.h>
-#include <ctype.h>
#include <stddef.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <algorithm>
-#include <string>
-#include <vector>
/*}}}*/
namespace APT {
diff --git a/apt-pkg/aptconfiguration.h b/apt-pkg/aptconfiguration.h
index fbd9b02e6..6776f96ef 100644
--- a/apt-pkg/aptconfiguration.h
+++ b/apt-pkg/aptconfiguration.h
@@ -11,9 +11,9 @@
#ifndef APT_CONFIGURATION_H
#define APT_CONFIGURATION_H
// Include Files /*{{{*/
+#include <limits>
#include <string>
#include <vector>
-#include <limits>
/*}}}*/
namespace APT {
namespace Configuration { /*{{{*/
diff --git a/apt-pkg/cachefile.cc b/apt-pkg/cachefile.cc
index b5f32fc29..0116308e5 100644
--- a/apt-pkg/cachefile.cc
+++ b/apt-pkg/cachefile.cc
@@ -15,24 +15,24 @@
#include <config.h>
#include <apt-pkg/cachefile.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/sourcelist.h>
-#include <apt-pkg/pkgcachegen.h>
#include <apt-pkg/configuration.h>
-#include <apt-pkg/policy.h>
-#include <apt-pkg/pkgsystem.h>
-#include <apt-pkg/fileutl.h>
-#include <apt-pkg/progress.h>
#include <apt-pkg/depcache.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/indexfile.h>
#include <apt-pkg/mmap.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/indexfile.h>
+#include <apt-pkg/pkgcachegen.h>
+#include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/policy.h>
+#include <apt-pkg/progress.h>
+#include <apt-pkg/sourcelist.h>
-#include <string.h>
-#include <unistd.h>
+#include <memory>
#include <string>
#include <vector>
-#include <memory>
+#include <string.h>
+#include <unistd.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/cachefile.h b/apt-pkg/cachefile.h
index e23f37675..097876b3a 100644
--- a/apt-pkg/cachefile.h
+++ b/apt-pkg/cachefile.h
@@ -21,7 +21,6 @@
#include <apt-pkg/depcache.h>
#include <apt-pkg/macros.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#ifndef APT_8_CLEANER_HEADERS
#include <apt-pkg/acquire.h>
diff --git a/apt-pkg/cachefilter.cc b/apt-pkg/cachefilter.cc
index cc4cdf73c..4cbe162e9 100644
--- a/apt-pkg/cachefilter.cc
+++ b/apt-pkg/cachefilter.cc
@@ -9,17 +9,16 @@
#include <apt-pkg/cachefile.h>
#include <apt-pkg/cachefilter.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/macros.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/strutl.h>
-#include <apt-pkg/macros.h>
#include <algorithm>
#include <string>
#include <unordered_map>
-#include <string.h>
-#include <regex.h>
#include <fnmatch.h>
+#include <regex.h>
+#include <string.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/cachefilter.h b/apt-pkg/cachefilter.h
index 30a3368e5..8a6c01341 100644
--- a/apt-pkg/cachefilter.h
+++ b/apt-pkg/cachefilter.h
@@ -7,7 +7,6 @@
#define APT_CACHEFILTER_H
// Include Files /*{{{*/
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <string>
#include <vector>
diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h
index 62d0ab59c..0cb684382 100644
--- a/apt-pkg/cacheiterators.h
+++ b/apt-pkg/cacheiterators.h
@@ -29,17 +29,19 @@
/*}}}*/
#ifndef PKGLIB_CACHEITERATORS_H
#define PKGLIB_CACHEITERATORS_H
-#include<apt-pkg/pkgcache.h>
-#include<apt-pkg/macros.h>
+#ifndef __PKGLIB_IN_PKGCACHE_H
+#warning apt-pkg/cacheiterators.h should not be included directly, include apt-pkg/pkgcache.h instead
+#endif
+#include <apt-pkg/macros.h>
-#include<iterator>
#include <iosfwd>
+#include <iterator>
#include <string>
#ifdef APT_PKG_EXPOSE_STRING_VIEW
#include <apt-pkg/string_view.h>
#endif
-#include<string.h>
+#include <string.h>
// abstract Iterator template /*{{{*/
/* This template provides the very basic iterator methods we
diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc
index f8ab7acb9..92f707cba 100644
--- a/apt-pkg/cacheset.cc
+++ b/apt-pkg/cacheset.cc
@@ -15,24 +15,23 @@
#include <apt-pkg/cachefile.h>
#include <apt-pkg/cachefilter.h>
#include <apt-pkg/cacheset.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/versionmatch.h>
-#include <apt-pkg/pkgrecords.h>
-#include <apt-pkg/policy.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/depcache.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/macros.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/fileutl.h>
+#include <apt-pkg/pkgrecords.h>
+#include <apt-pkg/policy.h>
+#include <apt-pkg/versionmatch.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#include <regex.h>
#include <list>
#include <string>
#include <vector>
+#include <regex.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h
index 1ac61af59..157f6139e 100644
--- a/apt-pkg/cacheset.h
+++ b/apt-pkg/cacheset.h
@@ -13,23 +13,22 @@
#include <map>
#include <set>
#if __cplusplus >= 201103L
-#include <unordered_set>
#include <forward_list>
#include <initializer_list>
+#include <unordered_set>
#endif
-#include <list>
+#include <algorithm>
#include <deque>
-#include <vector>
-#include <string>
#include <iterator>
-#include <algorithm>
+#include <list>
+#include <string>
+#include <vector>
#include <stddef.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
#ifndef APT_8_CLEANER_HEADERS
#include <apt-pkg/cachefile.h>
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc
index a3248fc17..2dccc6d12 100644
--- a/apt-pkg/cdrom.cc
+++ b/apt-pkg/cdrom.cc
@@ -2,31 +2,30 @@
*/
#include <config.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/cdromutl.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/cdrom.h>
#include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/cdrom.h>
+#include <apt-pkg/cdromutl.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/indexcopy.h>
+#include <apt-pkg/strutl.h>
-
-#include <string.h>
+#include <algorithm>
+#include <fstream>
+#include <iostream>
#include <iostream>
+#include <sstream>
#include <string>
#include <vector>
-#include <sys/stat.h>
#include <dirent.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <algorithm>
#include <dlfcn.h>
-#include <iostream>
-#include <sstream>
-#include <fstream>
+#include <stdio.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <unistd.h>
-#include<apti18n.h>
+#include <apti18n.h>
using namespace std;
diff --git a/apt-pkg/cdrom.h b/apt-pkg/cdrom.h
index ab1e046bf..7425c09c1 100644
--- a/apt-pkg/cdrom.h
+++ b/apt-pkg/cdrom.h
@@ -3,8 +3,8 @@
#include <apt-pkg/macros.h>
-#include<string>
-#include<vector>
+#include <string>
+#include <vector>
#include <stddef.h>
diff --git a/apt-pkg/clean.cc b/apt-pkg/clean.cc
index 9f408e46e..e9bf73b6c 100644
--- a/apt-pkg/clean.cc
+++ b/apt-pkg/clean.cc
@@ -8,24 +8,23 @@
##################################################################### */
/*}}}*/
// Includes /*{{{*/
-#include<config.h>
+#include <config.h>
+#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/clean.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/error.h>
#include <apt-pkg/configuration.h>
-#include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/strutl.h>
#include <string>
-#include <string.h>
#include <dirent.h>
-#include <sys/types.h>
+#include <fcntl.h>
+#include <string.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <unistd.h>
-#include <fcntl.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/contrib/cdromutl.cc b/apt-pkg/contrib/cdromutl.cc
index 3628f6173..93bfb9f42 100644
--- a/apt-pkg/contrib/cdromutl.cc
+++ b/apt-pkg/contrib/cdromutl.cc
@@ -10,26 +10,26 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
#include <apt-pkg/cdromutl.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/md5.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/configuration.h>
+#include <apt-pkg/md5.h>
#include <apt-pkg/strutl.h>
-#include <stdlib.h>
-#include <string.h>
#include <iostream>
#include <string>
#include <vector>
-#include <sys/statvfs.h>
#include <dirent.h>
#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <sys/stat.h>
+#include <sys/statvfs.h>
#include <unistd.h>
-#include <stdio.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/contrib/cmndline.cc b/apt-pkg/contrib/cmndline.cc
index 029ec3060..2b8bef2c5 100644
--- a/apt-pkg/contrib/cmndline.cc
+++ b/apt-pkg/contrib/cmndline.cc
@@ -11,17 +11,17 @@
##################################################################### */
/*}}}*/
// Include files /*{{{*/
-#include<config.h>
+#include <config.h>
-#include <apt-pkg/configuration.h>
#include <apt-pkg/cmndline.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/strutl.h>
+#include <string>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
-#include <string>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc
index 78a98d614..442e31dff 100644
--- a/apt-pkg/contrib/configuration.cc
+++ b/apt-pkg/contrib/configuration.cc
@@ -19,9 +19,9 @@
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/strutl.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/strutl.h>
#include <ctype.h>
#include <regex.h>
@@ -31,13 +31,13 @@
#include <string.h>
#include <algorithm>
-#include <iterator>
-#include <string>
-#include <stack>
-#include <vector>
#include <fstream>
+#include <iterator>
#include <sstream>
+#include <stack>
+#include <string>
#include <unordered_map>
+#include <vector>
#include <apti18n.h>
diff --git a/apt-pkg/contrib/configuration.h b/apt-pkg/contrib/configuration.h
index 97a01e4cf..8d0835cf5 100644
--- a/apt-pkg/contrib/configuration.h
+++ b/apt-pkg/contrib/configuration.h
@@ -30,9 +30,9 @@
#include <regex.h>
+#include <iostream>
#include <string>
#include <vector>
-#include <iostream>
#include <apt-pkg/macros.h>
diff --git a/apt-pkg/contrib/error.cc b/apt-pkg/contrib/error.cc
index c06ea8364..0233dfd59 100644
--- a/apt-pkg/contrib/error.cc
+++ b/apt-pkg/contrib/error.cc
@@ -17,17 +17,17 @@
#include <apt-pkg/error.h>
-#include <stdarg.h>
-#include <stddef.h>
-#include <list>
+#include <algorithm>
+#include <cstring>
#include <iostream>
+#include <list>
+#include <string>
#include <errno.h>
+#include <stdarg.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include <string>
-#include <cstring>
-#include <algorithm>
/*}}}*/
@@ -37,20 +37,21 @@
Per-Thread error object is maintained in much the same manner as libc
manages errno */
#if defined(_POSIX_THREADS) && defined(HAVE_PTHREAD)
- #include <pthread.h>
+#include <pthread.h>
- static pthread_key_t ErrorKey;
- static void ErrorDestroy(void *Obj) {delete (GlobalError *)Obj;};
- static void KeyAlloc() {pthread_key_create(&ErrorKey,ErrorDestroy);};
+static pthread_key_t ErrorKey;
+static void ErrorDestroy(void *Obj) { delete (GlobalError *)Obj; };
+static void KeyAlloc() { pthread_key_create(&ErrorKey, ErrorDestroy); };
- GlobalError *_GetErrorObj() {
- static pthread_once_t Once = PTHREAD_ONCE_INIT;
- pthread_once(&Once,KeyAlloc);
+GlobalError *_GetErrorObj()
+{
+ static pthread_once_t Once = PTHREAD_ONCE_INIT;
+ pthread_once(&Once, KeyAlloc);
- void *Res = pthread_getspecific(ErrorKey);
- if (Res == 0)
- pthread_setspecific(ErrorKey,Res = new GlobalError);
- return (GlobalError *)Res;
+ void *Res = pthread_getspecific(ErrorKey);
+ if (Res == 0)
+ pthread_setspecific(ErrorKey, Res = new GlobalError);
+ return (GlobalError *)Res;
}
#else
GlobalError *_GetErrorObj() {
diff --git a/apt-pkg/contrib/error.h b/apt-pkg/contrib/error.h
index b01a5fc1b..74b5cd5cf 100644
--- a/apt-pkg/contrib/error.h
+++ b/apt-pkg/contrib/error.h
@@ -46,8 +46,8 @@
#include <list>
#include <string>
-#include <stddef.h>
#include <stdarg.h>
+#include <stddef.h>
class GlobalError /*{{{*/
{
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index e87102cbc..630a98ce4 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -19,52 +19,52 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/fileutl.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/sptr.h>
#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/sptr.h>
+#include <apt-pkg/strutl.h>
-#include <ctype.h>
-#include <stdarg.h>
-#include <stddef.h>
-#include <sys/select.h>
-#include <time.h>
-#include <string>
-#include <vector>
+#include <cstdio>
#include <cstdlib>
#include <cstring>
-#include <cstdio>
#include <iostream>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/wait.h>
+#include <string>
+#include <vector>
+#include <ctype.h>
#include <dirent.h>
-#include <signal.h>
#include <errno.h>
+#include <fcntl.h>
#include <glob.h>
-#include <pwd.h>
#include <grp.h>
+#include <pwd.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <sys/select.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/wait.h>
+#include <time.h>
+#include <unistd.h>
-#include <set>
#include <algorithm>
#include <memory>
+#include <set>
#ifdef HAVE_ZLIB
- #include <zlib.h>
+#include <zlib.h>
#endif
#ifdef HAVE_BZ2
- #include <bzlib.h>
+#include <bzlib.h>
#endif
#ifdef HAVE_LZMA
- #include <lzma.h>
+#include <lzma.h>
#endif
#ifdef HAVE_LZ4
- #include <lz4frame.h>
+#include <lz4frame.h>
#endif
#include <endian.h>
#include <stdint.h>
diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h
index b3804cccc..5e857b5c8 100644
--- a/apt-pkg/contrib/fileutl.h
+++ b/apt-pkg/contrib/fileutl.h
@@ -21,12 +21,12 @@
#ifndef PKGLIB_FILEUTL_H
#define PKGLIB_FILEUTL_H
-#include <apt-pkg/macros.h>
#include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/macros.h>
+#include <set>
#include <string>
#include <vector>
-#include <set>
#include <time.h>
#include <zlib.h>
diff --git a/apt-pkg/contrib/gpgv.cc b/apt-pkg/contrib/gpgv.cc
index cdf9481cb..cc1fbc5aa 100644
--- a/apt-pkg/contrib/gpgv.cc
+++ b/apt-pkg/contrib/gpgv.cc
@@ -1,21 +1,21 @@
// -*- mode: cpp; mode: fold -*-
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
-#include<apt-pkg/configuration.h>
-#include<apt-pkg/error.h>
-#include<apt-pkg/strutl.h>
-#include<apt-pkg/fileutl.h>
-#include<apt-pkg/gpgv.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/gpgv.h>
+#include <apt-pkg/strutl.h>
#include <errno.h>
+#include <fcntl.h>
+#include <stddef.h>
#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
-#include <fcntl.h>
+#include <string.h>
#include <sys/wait.h>
#include <unistd.h>
-#include <stddef.h>
#include <algorithm>
#include <fstream>
diff --git a/apt-pkg/contrib/hashes.cc b/apt-pkg/contrib/hashes.cc
index 4727d489e..5a1d356f1 100644
--- a/apt-pkg/contrib/hashes.cc
+++ b/apt-pkg/contrib/hashes.cc
@@ -13,19 +13,19 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/hashes.h>
-#include <apt-pkg/fileutl.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/hashes.h>
#include <apt-pkg/md5.h>
#include <apt-pkg/sha1.h>
#include <apt-pkg/sha2.h>
-#include <stddef.h>
#include <algorithm>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string>
#include <iostream>
+#include <string>
+#include <stddef.h>
+#include <stdlib.h>
+#include <unistd.h>
/*}}}*/
const char * HashString::_SupportedHashes[] =
diff --git a/apt-pkg/contrib/hashes.h b/apt-pkg/contrib/hashes.h
index 1fe0afc00..1f8f45cb1 100644
--- a/apt-pkg/contrib/hashes.h
+++ b/apt-pkg/contrib/hashes.h
@@ -13,11 +13,10 @@
#ifndef APTPKG_HASHES_H
#define APTPKG_HASHES_H
-
+#include <apt-pkg/macros.h>
#include <apt-pkg/md5.h>
#include <apt-pkg/sha1.h>
#include <apt-pkg/sha2.h>
-#include <apt-pkg/macros.h>
#include <cstring>
#include <string>
diff --git a/apt-pkg/contrib/hashsum.cc b/apt-pkg/contrib/hashsum.cc
index 25ccc187d..e8e86e92c 100644
--- a/apt-pkg/contrib/hashsum.cc
+++ b/apt-pkg/contrib/hashsum.cc
@@ -3,9 +3,9 @@
#include <apt-pkg/fileutl.h>
+#include "hashsum_template.h"
#include <algorithm>
#include <unistd.h>
-#include "hashsum_template.h"
// Summation::AddFD - Add content of file into the checksum /*{{{*/
// ---------------------------------------------------------------------
diff --git a/apt-pkg/contrib/hashsum_template.h b/apt-pkg/contrib/hashsum_template.h
index e5032d02f..2594f6aeb 100644
--- a/apt-pkg/contrib/hashsum_template.h
+++ b/apt-pkg/contrib/hashsum_template.h
@@ -10,9 +10,8 @@
#ifndef APTPKG_HASHSUM_TEMPLATE_H
#define APTPKG_HASHSUM_TEMPLATE_H
-
-#include <string>
#include <cstring>
+#include <string>
#ifdef APT_PKG_EXPOSE_STRING_VIEW
#include <apt-pkg/string_view.h>
#endif
diff --git a/apt-pkg/contrib/md5.h b/apt-pkg/contrib/md5.h
index a286f092a..ad0d31374 100644
--- a/apt-pkg/contrib/md5.h
+++ b/apt-pkg/contrib/md5.h
@@ -28,9 +28,9 @@
#include "hashsum_template.h"
#ifndef APT_10_CLEANER_HEADERS
-#include <string>
-#include <cstring>
#include <algorithm>
+#include <cstring>
+#include <string>
#endif
#ifndef APT_8_CLEANER_HEADERS
using std::string;
diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc
index cd24a2808..100796cdf 100644
--- a/apt-pkg/contrib/mmap.cc
+++ b/apt-pkg/contrib/mmap.cc
@@ -19,17 +19,17 @@
#define _DEFAULT_SOURCE
#include <config.h>
-#include <apt-pkg/mmap.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/mmap.h>
+#include <cstring>
#include <string>
+#include <errno.h>
+#include <stdlib.h>
#include <sys/mman.h>
#include <unistd.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <cstring>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/contrib/mmap.h b/apt-pkg/contrib/mmap.h
index 62e64b95e..df02b1b85 100644
--- a/apt-pkg/contrib/mmap.h
+++ b/apt-pkg/contrib/mmap.h
@@ -25,7 +25,6 @@
#ifndef PKGLIB_MMAP_H
#define PKGLIB_MMAP_H
-
#include <string>
#ifndef APT_8_CLEANER_HEADERS
diff --git a/apt-pkg/contrib/netrc.cc b/apt-pkg/contrib/netrc.cc
index 8840de72c..88027c989 100644
--- a/apt-pkg/contrib/netrc.cc
+++ b/apt-pkg/contrib/netrc.cc
@@ -17,12 +17,12 @@
#include <apt-pkg/strutl.h>
#include <iostream>
+#include <pwd.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <stddef.h>
-#include <pwd.h>
#include "netrc.h"
diff --git a/apt-pkg/contrib/progress.cc b/apt-pkg/contrib/progress.cc
index b93018154..7c5b15e6b 100644
--- a/apt-pkg/contrib/progress.cc
+++ b/apt-pkg/contrib/progress.cc
@@ -10,15 +10,15 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/progress.h>
-#include <apt-pkg/error.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/progress.h>
-#include <sys/time.h>
-#include <string>
+#include <cstring>
#include <iostream>
+#include <string>
#include <stdio.h>
-#include <cstring>
+#include <sys/time.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/contrib/progress.h b/apt-pkg/contrib/progress.h
index 427b1bd35..43c84da71 100644
--- a/apt-pkg/contrib/progress.h
+++ b/apt-pkg/contrib/progress.h
@@ -21,10 +21,9 @@
#ifndef PKGLIB_PROGRESS_H
#define PKGLIB_PROGRESS_H
-
+#include <apt-pkg/macros.h>
#include <string>
#include <sys/time.h>
-#include <apt-pkg/macros.h>
#ifndef APT_8_CLEANER_HEADERS
using std::string;
diff --git a/apt-pkg/contrib/proxy.cc b/apt-pkg/contrib/proxy.cc
index 9af76bdce..86582e1aa 100644
--- a/apt-pkg/contrib/proxy.cc
+++ b/apt-pkg/contrib/proxy.cc
@@ -7,15 +7,15 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<apt-pkg/configuration.h>
-#include<apt-pkg/error.h>
-#include<apt-pkg/fileutl.h>
-#include<apt-pkg/strutl.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/strutl.h>
#include <algorithm>
-#include<iostream>
-#include<fcntl.h>
-#include<unistd.h>
+#include <iostream>
+#include <fcntl.h>
+#include <unistd.h>
#include "proxy.h"
/*}}}*/
diff --git a/apt-pkg/contrib/sha1.h b/apt-pkg/contrib/sha1.h
index 3387c1cfd..967e2eae0 100644
--- a/apt-pkg/contrib/sha1.h
+++ b/apt-pkg/contrib/sha1.h
@@ -17,9 +17,9 @@
#include "hashsum_template.h"
#ifndef APT_10_CLEANER_HEADERS
-#include <string>
-#include <cstring>
#include <algorithm>
+#include <cstring>
+#include <string>
#endif
#ifndef APT_8_CLEANER_HEADERS
using std::string;
diff --git a/apt-pkg/contrib/sha2.h b/apt-pkg/contrib/sha2.h
index 164840d3b..d8127c66b 100644
--- a/apt-pkg/contrib/sha2.h
+++ b/apt-pkg/contrib/sha2.h
@@ -16,12 +16,12 @@
#include <cstring>
-#include "sha2_internal.h"
#include "hashsum_template.h"
+#include "sha2_internal.h"
#ifndef APT_10_CLEANER_HEADERS
-#include <string>
#include <algorithm>
+#include <string>
#include <stdint.h>
#endif
diff --git a/apt-pkg/contrib/sha2_internal.cc b/apt-pkg/contrib/sha2_internal.cc
index 1c9844ca8..419b92aca 100644
--- a/apt-pkg/contrib/sha2_internal.cc
+++ b/apt-pkg/contrib/sha2_internal.cc
@@ -33,10 +33,10 @@
*/
#include <config.h>
-#include <endian.h>
-#include <string.h> /* memcpy()/memset() or bcopy()/bzero() */
-#include <assert.h> /* assert() */
#include "sha2_internal.h"
+#include <assert.h> /* assert() */
+#include <endian.h>
+#include <string.h> /* memcpy()/memset() or bcopy()/bzero() */
/*
* ASSERT NOTE:
diff --git a/apt-pkg/contrib/sha2_internal.h b/apt-pkg/contrib/sha2_internal.h
index 1b82d965d..fa4bfc4df 100644
--- a/apt-pkg/contrib/sha2_internal.h
+++ b/apt-pkg/contrib/sha2_internal.h
@@ -44,8 +44,8 @@
#ifdef SHA2_USE_INTTYPES_H
-#include <stddef.h>
#include <inttypes.h>
+#include <stddef.h>
#endif /* SHA2_USE_INTTYPES_H */
diff --git a/apt-pkg/contrib/srvrec.cc b/apt-pkg/contrib/srvrec.cc
index 327e59937..930989bfc 100644
--- a/apt-pkg/contrib/srvrec.cc
+++ b/apt-pkg/contrib/srvrec.cc
@@ -10,8 +10,8 @@
#include <netdb.h>
-#include <netinet/in.h>
#include <arpa/nameser.h>
+#include <netinet/in.h>
#include <resolv.h>
#include <time.h>
@@ -22,10 +22,8 @@
#include <apt-pkg/error.h>
#include <apt-pkg/strutl.h>
-
#include "srvrec.h"
-
bool SrvRec::operator==(SrvRec const &other) const
{
return (std::tie(target, priority, weight, port) ==
diff --git a/apt-pkg/contrib/srvrec.h b/apt-pkg/contrib/srvrec.h
index 01b810281..e22b7a1c6 100644
--- a/apt-pkg/contrib/srvrec.h
+++ b/apt-pkg/contrib/srvrec.h
@@ -9,9 +9,9 @@
#ifndef SRVREC_H
#define SRVREC_H
-#include <arpa/nameser.h>
-#include <vector>
#include <string>
+#include <vector>
+#include <arpa/nameser.h>
class SrvRec
{
diff --git a/apt-pkg/contrib/string_view.h b/apt-pkg/contrib/string_view.h
index c504edd27..536744e32 100644
--- a/apt-pkg/contrib/string_view.h
+++ b/apt-pkg/contrib/string_view.h
@@ -11,9 +11,9 @@
#if !defined(APT_STRINGVIEW_H) && defined(APT_PKG_EXPOSE_STRING_VIEW)
#define APT_STRINGVIEW_H
-#include <string.h>
-#include <string>
#include <apt-pkg/macros.h>
+#include <string>
+#include <string.h>
namespace APT {
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index 88113f7a4..964f0d6c6 100644
--- a/apt-pkg/contrib/strutl.cc
+++ b/apt-pkg/contrib/strutl.cc
@@ -17,30 +17,30 @@
// Includes /*{{{*/
#include <config.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/fileutl.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/strutl.h>
-#include <array>
#include <algorithm>
+#include <array>
#include <iomanip>
#include <locale>
#include <sstream>
-#include <string>
#include <sstream>
+#include <string>
#include <vector>
+#include <ctype.h>
+#include <errno.h>
+#include <iconv.h>
+#include <regex.h>
+#include <stdarg.h>
#include <stddef.h>
+#include <stdio.h>
#include <stdlib.h>
-#include <time.h>
-#include <ctype.h>
#include <string.h>
-#include <stdio.h>
+#include <time.h>
#include <unistd.h>
-#include <regex.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <iconv.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h
index 73f27aa6c..cc39521da 100644
--- a/apt-pkg/contrib/strutl.h
+++ b/apt-pkg/contrib/strutl.h
@@ -16,17 +16,16 @@
#ifndef STRUTL_H
#define STRUTL_H
-
+#include <cstring>
+#include <iostream>
#include <limits>
#include <string>
-#include <cstring>
#include <vector>
-#include <iostream>
#ifdef APT_PKG_EXPOSE_STRING_VIEW
#include <apt-pkg/string_view.h>
#endif
-#include <time.h>
#include <stddef.h>
+#include <time.h>
#include "macros.h"
diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc
index 799144ecb..6aa3af162 100644
--- a/apt-pkg/deb/debindexfile.cc
+++ b/apt-pkg/deb/debindexfile.cc
@@ -11,24 +11,23 @@
// Include Files /*{{{*/
#include <config.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/debindexfile.h>
-#include <apt-pkg/debsrcrecords.h>
#include <apt-pkg/deblistparser.h>
#include <apt-pkg/debrecords.h>
-#include <apt-pkg/configuration.h>
+#include <apt-pkg/debsrcrecords.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/indexfile.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/pkgrecords.h>
#include <apt-pkg/srcrecords.h>
-#include <stdio.h>
#include <iostream>
#include <memory>
-#include <string>
#include <sstream>
+#include <string>
+#include <stdio.h>
#include <sys/stat.h>
#include <unistd.h>
diff --git a/apt-pkg/deb/debindexfile.h b/apt-pkg/deb/debindexfile.h
index 3652f631c..40a9e4bbc 100644
--- a/apt-pkg/deb/debindexfile.h
+++ b/apt-pkg/deb/debindexfile.h
@@ -16,7 +16,6 @@
#define PKGLIB_DEBINDEXFILE_H
#include <apt-pkg/indexfile.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/pkgcache.h>
#include <apt-pkg/srcrecords.h>
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 3a26b40c4..378988a1c 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -12,26 +12,25 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/deblistparser.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/cachefilter.h>
#include <apt-pkg/aptconfiguration.h>
-#include <apt-pkg/strutl.h>
+#include <apt-pkg/cachefilter.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/crc-16.h>
+#include <apt-pkg/deblistparser.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/macros.h>
#include <apt-pkg/md5.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
-#include <apt-pkg/tagfile.h>
+#include <apt-pkg/strutl.h>
#include <apt-pkg/tagfile-keys.h>
-#include <apt-pkg/macros.h>
+#include <apt-pkg/tagfile.h>
-#include <stddef.h>
-#include <string.h>
#include <algorithm>
#include <string>
#include <vector>
#include <ctype.h>
+#include <stddef.h>
+#include <string.h>
/*}}}*/
using std::string;
diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h
index 39f42915c..8d7efc746 100644
--- a/apt-pkg/deb/deblistparser.h
+++ b/apt-pkg/deb/deblistparser.h
@@ -11,11 +11,11 @@
#ifndef PKGLIB_DEBLISTPARSER_H
#define PKGLIB_DEBLISTPARSER_H
-#include <apt-pkg/pkgcachegen.h>
-#include <apt-pkg/tagfile.h>
+#include <apt-pkg/macros.h>
#include <apt-pkg/md5.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcachegen.h>
+#include <apt-pkg/tagfile.h>
#include <string>
#include <vector>
diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc
index d7c458e66..a0adf85be 100644
--- a/apt-pkg/deb/debmetaindex.cc
+++ b/apt-pkg/deb/debmetaindex.cc
@@ -1,30 +1,30 @@
#include <config.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/debmetaindex.h>
-#include <apt-pkg/debindexfile.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/fileutl.h>
#include <apt-pkg/acquire-item.h>
-#include <apt-pkg/configuration.h>
#include <apt-pkg/aptconfiguration.h>
-#include <apt-pkg/sourcelist.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/debindexfile.h>
+#include <apt-pkg/debmetaindex.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/gpgv.h>
#include <apt-pkg/hashes.h>
+#include <apt-pkg/macros.h>
#include <apt-pkg/metaindex.h>
#include <apt-pkg/pkgcachegen.h>
+#include <apt-pkg/sourcelist.h>
+#include <apt-pkg/strutl.h>
#include <apt-pkg/tagfile.h>
-#include <apt-pkg/gpgv.h>
-#include <apt-pkg/macros.h>
+#include <algorithm>
#include <map>
+#include <sstream>
#include <string>
#include <utility>
#include <vector>
-#include <algorithm>
-#include <sstream>
-#include <sys/stat.h>
#include <string.h>
+#include <sys/stat.h>
#include <apti18n.h>
diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h
index 450ca94c9..5a97cfc78 100644
--- a/apt-pkg/deb/debmetaindex.h
+++ b/apt-pkg/deb/debmetaindex.h
@@ -1,8 +1,8 @@
#ifndef PKGLIB_DEBMETAINDEX_H
#define PKGLIB_DEBMETAINDEX_H
-#include <apt-pkg/metaindex.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/metaindex.h>
#include <map>
#include <string>
diff --git a/apt-pkg/deb/debrecords.cc b/apt-pkg/deb/debrecords.cc
index a132f34a6..bc4a378eb 100644
--- a/apt-pkg/deb/debrecords.cc
+++ b/apt-pkg/deb/debrecords.cc
@@ -10,22 +10,21 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/debrecords.h>
-#include <apt-pkg/debindexfile.h>
-#include <apt-pkg/strutl.h>
#include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/debindexfile.h>
+#include <apt-pkg/debrecords.h>
+#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/strutl.h>
#include <apt-pkg/tagfile.h>
-#include <apt-pkg/error.h>
-#include <string.h>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <langinfo.h>
+#include <string.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/deb/debrecords.h b/apt-pkg/deb/debrecords.h
index ae75a2b78..828c2b93b 100644
--- a/apt-pkg/deb/debrecords.h
+++ b/apt-pkg/deb/debrecords.h
@@ -14,10 +14,10 @@
#ifndef PKGLIB_DEBRECORDS_H
#define PKGLIB_DEBRECORDS_H
-#include <apt-pkg/pkgrecords.h>
-#include <apt-pkg/tagfile.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/pkgrecords.h>
+#include <apt-pkg/tagfile.h>
#include <string>
diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc
index d664b609e..0368817c2 100644
--- a/apt-pkg/deb/debsrcrecords.cc
+++ b/apt-pkg/deb/debsrcrecords.cc
@@ -11,22 +11,22 @@
// Include Files /*{{{*/
#include <config.h>
+#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/deblistparser.h>
#include <apt-pkg/debsrcrecords.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/gpgv.h>
+#include <apt-pkg/hashes.h>
#include <apt-pkg/srcrecords.h>
+#include <apt-pkg/strutl.h>
#include <apt-pkg/tagfile.h>
-#include <apt-pkg/hashes.h>
-#include <apt-pkg/gpgv.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
#include <algorithm>
#include <string>
#include <vector>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
/*}}}*/
using std::max;
diff --git a/apt-pkg/deb/debsrcrecords.h b/apt-pkg/deb/debsrcrecords.h
index 850040cf5..349e66ba2 100644
--- a/apt-pkg/deb/debsrcrecords.h
+++ b/apt-pkg/deb/debsrcrecords.h
@@ -11,13 +11,13 @@
#ifndef PKGLIB_DEBSRCRECORDS_H
#define PKGLIB_DEBSRCRECORDS_H
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/srcrecords.h>
#include <apt-pkg/tagfile.h>
-#include <apt-pkg/fileutl.h>
-#include <stddef.h>
#include <string>
#include <vector>
+#include <stddef.h>
class pkgIndexFile;
diff --git a/apt-pkg/deb/debsystem.cc b/apt-pkg/deb/debsystem.cc
index 899f7328b..3ad25ba05 100644
--- a/apt-pkg/deb/debsystem.cc
+++ b/apt-pkg/deb/debsystem.cc
@@ -12,30 +12,29 @@
// Include Files /*{{{*/
#include <config.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/debindexfile.h>
#include <apt-pkg/debsystem.h>
#include <apt-pkg/debversion.h>
-#include <apt-pkg/debindexfile.h>
#include <apt-pkg/dpkgpm.h>
-#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <algorithm>
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
#include <string>
#include <vector>
-#include <unistd.h>
+#include <ctype.h>
#include <dirent.h>
#include <errno.h>
-#include <sys/types.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <sys/wait.h>
-#include <fcntl.h>
+#include <unistd.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/deb/debsystem.h b/apt-pkg/deb/debsystem.h
index 5185c92d8..9fdecb42f 100644
--- a/apt-pkg/deb/debsystem.h
+++ b/apt-pkg/deb/debsystem.h
@@ -10,9 +10,8 @@
#ifndef PKGLIB_DEBSYSTEM_H
#define PKGLIB_DEBSYSTEM_H
-#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/pkgsystem.h>
#include <vector>
class Configuration;
diff --git a/apt-pkg/deb/debversion.cc b/apt-pkg/deb/debversion.cc
index 48462c6a2..9fe2fd6b3 100644
--- a/apt-pkg/deb/debversion.cc
+++ b/apt-pkg/deb/debversion.cc
@@ -15,9 +15,9 @@
#include <apt-pkg/debversion.h>
#include <apt-pkg/pkgcache.h>
-#include <string.h>
-#include <stdlib.h>
#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
/*}}}*/
debVersioningSystem debVS;
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 80bee03dd..58599193e 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -11,20 +11,20 @@
#include <apt-pkg/cachefile.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/debsystem.h>
#include <apt-pkg/depcache.h>
#include <apt-pkg/dpkgpm.h>
-#include <apt-pkg/debsystem.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/install-progress.h>
-#include <apt-pkg/packagemanager.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/statechanges.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/packagemanager.h>
#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/statechanges.h>
+#include <apt-pkg/strutl.h>
#include <apt-pkg/version.h>
+#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <grp.h>
@@ -37,9 +37,8 @@
#include <sys/select.h>
#include <sys/stat.h>
#include <sys/time.h>
-#include <sys/wait.h>
#include <sys/types.h>
-#include <dirent.h>
+#include <sys/wait.h>
#include <termios.h>
#include <time.h>
#include <unistd.h>
@@ -49,14 +48,14 @@
#include <cstring>
#include <iostream>
#include <map>
+#include <numeric>
#include <set>
+#include <sstream>
#include <string>
#include <type_traits>
-#include <utility>
#include <unordered_set>
+#include <utility>
#include <vector>
-#include <sstream>
-#include <numeric>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/deb/dpkgpm.h b/apt-pkg/deb/dpkgpm.h
index d1c2bcf41..324551387 100644
--- a/apt-pkg/deb/dpkgpm.h
+++ b/apt-pkg/deb/dpkgpm.h
@@ -10,14 +10,14 @@
#ifndef PKGLIB_DPKGPM_H
#define PKGLIB_DPKGPM_H
+#include <apt-pkg/macros.h>
#include <apt-pkg/packagemanager.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/macros.h>
-#include <vector>
#include <map>
-#include <stdio.h>
#include <string>
+#include <vector>
+#include <stdio.h>
#ifndef APT_10_CLEANER_HEADERS
#include <apt-pkg/init.h>
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 05b788e45..efe26dee3 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -8,34 +8,33 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
+#include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/cachefile.h>
+#include <apt-pkg/cacheset.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/depcache.h>
-#include <apt-pkg/versionmatch.h>
-#include <apt-pkg/version.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/aptconfiguration.h>
-#include <apt-pkg/tagfile.h>
-#include <apt-pkg/progress.h>
-#include <apt-pkg/cacheset.h>
+#include <apt-pkg/macros.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/prettyprinters.h>
-#include <apt-pkg/cachefile.h>
-#include <apt-pkg/macros.h>
+#include <apt-pkg/progress.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/tagfile.h>
+#include <apt-pkg/version.h>
+#include <apt-pkg/versionmatch.h>
-#include <stdio.h>
-#include <string.h>
+#include <algorithm>
+#include <iostream>
#include <list>
+#include <set>
#include <string>
#include <utility>
#include <vector>
-#include <algorithm>
-#include <iostream>
-#include <set>
+#include <stdio.h>
+#include <string.h>
#include <sys/stat.h>
diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h
index 1ab86644d..87b42b7ca 100644
--- a/apt-pkg/depcache.h
+++ b/apt-pkg/depcache.h
@@ -38,20 +38,19 @@
#define PKGLIB_DEPCACHE_H
#include <apt-pkg/configuration.h>
-#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
#include <stddef.h>
-#include <memory>
#include <list>
+#include <memory>
#include <string>
#include <utility>
#ifndef APT_8_CLEANER_HEADERS
-#include <apt-pkg/progress.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/progress.h>
#endif
#ifndef APT_10_CLEANER_HEADERS
#include <set>
diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc
index fb23c1c55..2e39be377 100644
--- a/apt-pkg/edsp.cc
+++ b/apt-pkg/edsp.cc
@@ -8,27 +8,26 @@
#include <config.h>
#include <apt-pkg/algorithms.h>
-#include <apt-pkg/error.h>
#include <apt-pkg/cacheset.h>
#include <apt-pkg/depcache.h>
+#include <apt-pkg/edsp.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/packagemanager.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/prettyprinters.h>
-#include <apt-pkg/packagemanager.h>
#include <apt-pkg/progress.h>
-#include <apt-pkg/fileutl.h>
-#include <apt-pkg/edsp.h>
-#include <apt-pkg/tagfile.h>
-#include <apt-pkg/strutl.h>
#include <apt-pkg/string_view.h>
-#include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/tagfile.h>
-#include <sys/stat.h>
#include <ctype.h>
#include <stddef.h>
+#include <stdio.h>
#include <string.h>
+#include <sys/stat.h>
#include <unistd.h>
-#include <stdio.h>
#include <array>
#include <limits>
diff --git a/apt-pkg/edsp.h b/apt-pkg/edsp.h
index 2c9082ed3..2f18d76eb 100644
--- a/apt-pkg/edsp.h
+++ b/apt-pkg/edsp.h
@@ -10,9 +10,8 @@
#define PKGLIB_EDSP_H
#include <apt-pkg/cacheset.h>
-#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
#include <stdio.h>
diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc
index 2d030daaf..1a8af89f0 100644
--- a/apt-pkg/edsp/edspindexfile.cc
+++ b/apt-pkg/edsp/edspindexfile.cc
@@ -16,10 +16,10 @@
#include <apt-pkg/pkgcache.h>
#include <apt-pkg/pkgrecords.h>
-#include <stddef.h>
-#include <unistd.h>
#include <memory>
#include <string>
+#include <stddef.h>
+#include <unistd.h>
/*}}}*/
// EDSP-like Index /*{{{*/
diff --git a/apt-pkg/edsp/edsplistparser.cc b/apt-pkg/edsp/edsplistparser.cc
index 4119639a6..b118e127d 100644
--- a/apt-pkg/edsp/edsplistparser.cc
+++ b/apt-pkg/edsp/edsplistparser.cc
@@ -12,15 +12,14 @@
#include <config.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/deblistparser.h>
#include <apt-pkg/edsplistparser.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/md5.h>
-#include <apt-pkg/deblistparser.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
-#include <apt-pkg/tagfile.h>
-#include <apt-pkg/fileutl.h>
#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/string_view.h>
+#include <apt-pkg/tagfile.h>
#include <array>
diff --git a/apt-pkg/edsp/edsplistparser.h b/apt-pkg/edsp/edsplistparser.h
index 4904b6567..0fcc3f5fd 100644
--- a/apt-pkg/edsp/edsplistparser.h
+++ b/apt-pkg/edsp/edsplistparser.h
@@ -12,15 +12,15 @@
#define PKGLIB_EDSPLISTPARSER_H
#include <apt-pkg/deblistparser.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/md5.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/fileutl.h>
#include <string>
#ifndef APT_8_CLEANER_HEADERS
-#include <apt-pkg/pkgcachegen.h>
#include <apt-pkg/indexfile.h>
+#include <apt-pkg/pkgcachegen.h>
#include <apt-pkg/tagfile.h>
#endif
diff --git a/apt-pkg/edsp/edspsystem.cc b/apt-pkg/edsp/edspsystem.cc
index 1ceb21a17..47f5e06d5 100644
--- a/apt-pkg/edsp/edspsystem.cc
+++ b/apt-pkg/edsp/edspsystem.cc
@@ -15,9 +15,8 @@
#include <apt-pkg/debversion.h>
#include <apt-pkg/edspindexfile.h>
#include <apt-pkg/edspsystem.h>
-#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/pkgcache.h>
#include <stddef.h>
#include <stdlib.h>
diff --git a/apt-pkg/edsp/edspsystem.h b/apt-pkg/edsp/edspsystem.h
index c0c9526b5..af8bcf128 100644
--- a/apt-pkg/edsp/edspsystem.h
+++ b/apt-pkg/edsp/edspsystem.h
@@ -10,9 +10,8 @@
#ifndef PKGLIB_EDSPSYSTEM_H
#define PKGLIB_EDSPSYSTEM_H
-#include <apt-pkg/pkgsystem.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/pkgsystem.h>
#include <memory>
#include <vector>
diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc
index ca5c42cb7..11d2e934e 100644
--- a/apt-pkg/indexcopy.cc
+++ b/apt-pkg/indexcopy.cc
@@ -10,28 +10,28 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/progress.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/fileutl.h>
#include <apt-pkg/aptconfiguration.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/tagfile.h>
-#include <apt-pkg/metaindex.h>
#include <apt-pkg/cdrom.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/debmetaindex.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/gpgv.h>
#include <apt-pkg/hashes.h>
-#include <apt-pkg/debmetaindex.h>
+#include <apt-pkg/metaindex.h>
+#include <apt-pkg/progress.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/tagfile.h>
#include <iostream>
-#include <unistd.h>
-#include <sys/stat.h>
+#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sstream>
+#include <sys/stat.h>
+#include <unistd.h>
#include "indexcopy.h"
#include <apti18n.h>
diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc
index b860e2335..492f29c5a 100644
--- a/apt-pkg/indexfile.cc
+++ b/apt-pkg/indexfile.cc
@@ -8,31 +8,30 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
+#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/configuration.h>
-#include <apt-pkg/indexfile.h>
+#include <apt-pkg/deblistparser.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/indexfile.h>
+#include <apt-pkg/macros.h>
#include <apt-pkg/pkgcache.h>
#include <apt-pkg/pkgcachegen.h>
-#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/progress.h>
#include <apt-pkg/srcrecords.h>
#include <apt-pkg/strutl.h>
-#include <apt-pkg/progress.h>
-#include <apt-pkg/deblistparser.h>
-#include <apt-pkg/macros.h>
#include <apt-pkg/debindexfile.h>
#include <sys/stat.h>
-#include <string>
-#include <vector>
#include <clocale>
#include <cstring>
#include <memory>
+#include <string>
+#include <vector>
/*}}}*/
// Global list of Item supported
diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h
index 046216ab2..10b15fde4 100644
--- a/apt-pkg/indexfile.h
+++ b/apt-pkg/indexfile.h
@@ -21,11 +21,10 @@
#ifndef PKGLIB_INDEXFILE_H
#define PKGLIB_INDEXFILE_H
-#include <apt-pkg/srcrecords.h>
-#include <apt-pkg/pkgrecords.h>
-#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/pkgrecords.h>
+#include <apt-pkg/srcrecords.h>
#include <map>
#include <string>
diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc
index 00d991027..af4e6faa0 100644
--- a/apt-pkg/init.cc
+++ b/apt-pkg/init.cc
@@ -8,23 +8,23 @@
##################################################################### */
/*}}}*/
// Include files /*{{{*/
-#include<config.h>
+#include <config.h>
-#include <apt-pkg/init.h>
-#include <apt-pkg/fileutl.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/init.h>
+#include <apt-pkg/macros.h>
#include <apt-pkg/pkgsystem.h>
-#include <apt-pkg/configuration.h>
#include <apt-pkg/strutl.h>
-#include <apt-pkg/macros.h>
-#include <string.h>
#include <cstdlib>
#include <fstream>
#include <sstream>
#include <string>
#include <unordered_map>
#include <vector>
+#include <string.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/install-progress.cc b/apt-pkg/install-progress.cc
index 6c3e51b2c..913068a66 100644
--- a/apt-pkg/install-progress.cc
+++ b/apt-pkg/install-progress.cc
@@ -2,19 +2,19 @@
#include <apt-pkg/configuration.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/strutl.h>
#include <apt-pkg/install-progress.h>
+#include <apt-pkg/strutl.h>
-#include <signal.h>
-#include <unistd.h>
+#include <algorithm>
+#include <cmath>
#include <iostream>
+#include <sstream>
#include <vector>
-#include <sys/ioctl.h>
#include <fcntl.h>
-#include <algorithm>
+#include <signal.h>
#include <stdio.h>
-#include <sstream>
-#include <cmath>
+#include <sys/ioctl.h>
+#include <unistd.h>
#include <apti18n.h>
diff --git a/apt-pkg/install-progress.h b/apt-pkg/install-progress.h
index b5c133676..bcc0b615a 100644
--- a/apt-pkg/install-progress.h
+++ b/apt-pkg/install-progress.h
@@ -4,9 +4,9 @@
#include <apt-pkg/macros.h>
#include <string>
-#include <unistd.h>
-#include <signal.h>
#include <vector>
+#include <signal.h>
+#include <unistd.h>
namespace APT {
namespace Progress {
diff --git a/apt-pkg/metaindex.cc b/apt-pkg/metaindex.cc
index 695cf8804..bdae6dcc9 100644
--- a/apt-pkg/metaindex.cc
+++ b/apt-pkg/metaindex.cc
@@ -1,13 +1,13 @@
// Include Files /*{{{*/
-#include <apt-pkg/pkgcachegen.h>
#include <apt-pkg/indexfile.h>
#include <apt-pkg/metaindex.h>
+#include <apt-pkg/pkgcachegen.h>
#include <apt-pkg/debmetaindex.h>
#include <string>
#include <vector>
- /*}}}*/
+ /*}}}*/
class metaIndexPrivate /*{{{*/
{
diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h
index 1951f118f..91cfce59b 100644
--- a/apt-pkg/metaindex.h
+++ b/apt-pkg/metaindex.h
@@ -15,8 +15,8 @@ class pkgCacheGenerator;
class OpProgress;
#endif
#ifndef APT_8_CLEANER_HEADERS
-#include <apt-pkg/srcrecords.h>
#include <apt-pkg/pkgrecords.h>
+#include <apt-pkg/srcrecords.h>
using std::string;
#endif
diff --git a/apt-pkg/orderlist.cc b/apt-pkg/orderlist.cc
index 98793e6a9..c968845ce 100644
--- a/apt-pkg/orderlist.cc
+++ b/apt-pkg/orderlist.cc
@@ -63,19 +63,18 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
-#include <apt-pkg/orderlist.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/depcache.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/orderlist.h>
#include <apt-pkg/pkgcache.h>
-#include <stdlib.h>
-#include <string.h>
#include <algorithm>
#include <iostream>
+#include <stdlib.h>
+#include <string.h>
/*}}}*/
using namespace std;
diff --git a/apt-pkg/orderlist.h b/apt-pkg/orderlist.h
index 9171c45d6..3fa02342b 100644
--- a/apt-pkg/orderlist.h
+++ b/apt-pkg/orderlist.h
@@ -15,9 +15,8 @@
#ifndef PKGLIB_ORDERLIST_H
#define PKGLIB_ORDERLIST_H
-#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
#include <string>
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index 85ac5f9da..d5a8275c3 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -15,26 +15,25 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/packagemanager.h>
-#include <apt-pkg/orderlist.h>
-#include <apt-pkg/depcache.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/edsp.h>
-#include <apt-pkg/version.h>
#include <apt-pkg/acquire-item.h>
#include <apt-pkg/algorithms.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/depcache.h>
+#include <apt-pkg/edsp.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/install-progress.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/orderlist.h>
+#include <apt-pkg/packagemanager.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/install-progress.h>
#include <apt-pkg/prettyprinters.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/version.h>
-#include <stddef.h>
+#include <iostream>
#include <list>
#include <string>
-#include <iostream>
+#include <stddef.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/packagemanager.h b/apt-pkg/packagemanager.h
index e4c7a0a0a..d9443443d 100644
--- a/apt-pkg/packagemanager.h
+++ b/apt-pkg/packagemanager.h
@@ -22,13 +22,13 @@
#ifndef PKGLIB_PACKAGEMANAGER_H
#define PKGLIB_PACKAGEMANAGER_H
-#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/init.h>
#include <apt-pkg/edsp.h>
+#include <apt-pkg/init.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
-#include <string>
#include <set>
+#include <string>
#ifndef APT_10_CLEANER_HEADERS
#include <apt-pkg/install-progress.h>
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc
index 929c7cb33..ea34db469 100644
--- a/apt-pkg/pkgcache.cc
+++ b/apt-pkg/pkgcache.cc
@@ -20,26 +20,26 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
+#include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/macros.h>
+#include <apt-pkg/mmap.h>
#include <apt-pkg/pkgcache.h>
#include <apt-pkg/policy.h>
-#include <apt-pkg/version.h>
-#include <apt-pkg/error.h>
#include <apt-pkg/strutl.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/aptconfiguration.h>
-#include <apt-pkg/mmap.h>
-#include <apt-pkg/macros.h>
+#include <apt-pkg/version.h>
-#include <stddef.h>
-#include <string.h>
-#include <sstream>
+#include <zlib.h>
#include <algorithm>
-#include <vector>
+#include <sstream>
#include <string>
+#include <vector>
+#include <stddef.h>
+#include <string.h>
#include <sys/stat.h>
-#include <zlib.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h
index 91228f713..e1597c1b1 100644
--- a/apt-pkg/pkgcache.h
+++ b/apt-pkg/pkgcache.h
@@ -73,13 +73,13 @@
/*}}}*/
#ifndef PKGLIB_PKGCACHE_H
#define PKGLIB_PKGCACHE_H
-
-#include <apt-pkg/mmap.h>
+#define __PKGLIB_IN_PKGCACHE_H
#include <apt-pkg/macros.h>
+#include <apt-pkg/mmap.h>
#include <string>
-#include <time.h>
#include <stdint.h>
+#include <time.h>
#ifdef APT_PKG_EXPOSE_STRING_VIEW
#include <apt-pkg/string_view.h>
@@ -783,10 +783,13 @@ inline char const * pkgCache::NativeArch()
#include <apt-pkg/cacheiterators.h>
-inline pkgCache::GrpIterator pkgCache::GrpBegin()
- {return GrpIterator(*this);}
-inline pkgCache::GrpIterator pkgCache::GrpEnd()
- {return GrpIterator(*this,GrpP);}
+ inline pkgCache::GrpIterator pkgCache::GrpBegin()
+ {
+ return GrpIterator(*this);
+ }
+ inline pkgCache::GrpIterator pkgCache::GrpEnd()
+ {
+ return GrpIterator(*this, GrpP);}
inline pkgCache::PkgIterator pkgCache::PkgBegin()
{return PkgIterator(*this);}
inline pkgCache::PkgIterator pkgCache::PkgEnd()
@@ -822,4 +825,5 @@ class pkgCache::Namespace /*{{{*/
typedef pkgCache::Flag Flag;
};
/*}}}*/
+#undef __PKGLIB_IN_PKGCACHE_H
#endif
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index e52667fbc..bde0ea122 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -12,30 +12,29 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/pkgcachegen.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/version.h>
-#include <apt-pkg/progress.h>
-#include <apt-pkg/sourcelist.h>
#include <apt-pkg/configuration.h>
-#include <apt-pkg/pkgsystem.h>
-#include <apt-pkg/macros.h>
-#include <apt-pkg/metaindex.h>
+#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/hashsum_template.h>
#include <apt-pkg/indexfile.h>
+#include <apt-pkg/macros.h>
#include <apt-pkg/md5.h>
+#include <apt-pkg/metaindex.h>
#include <apt-pkg/mmap.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/pkgcachegen.h>
+#include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/progress.h>
+#include <apt-pkg/sourcelist.h>
+#include <apt-pkg/version.h>
-#include <stddef.h>
-#include <string.h>
+#include <algorithm>
#include <iostream>
+#include <memory>
#include <string>
#include <vector>
-#include <memory>
-#include <algorithm>
+#include <stddef.h>
+#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h
index cb51c113a..e11e97e09 100644
--- a/apt-pkg/pkgcachegen.h
+++ b/apt-pkg/pkgcachegen.h
@@ -18,14 +18,13 @@
#ifndef PKGLIB_PKGCACHEGEN_H
#define PKGLIB_PKGCACHEGEN_H
+#include <apt-pkg/macros.h>
#include <apt-pkg/md5.h>
#include <apt-pkg/mmap.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
-#include <apt-pkg/macros.h>
-#include <vector>
#include <string>
+#include <vector>
#if __cplusplus >= 201103L
#include <unordered_set>
#endif
diff --git a/apt-pkg/pkgrecords.cc b/apt-pkg/pkgrecords.cc
index ef4c17cd2..8a5089d8a 100644
--- a/apt-pkg/pkgrecords.cc
+++ b/apt-pkg/pkgrecords.cc
@@ -9,16 +9,15 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
-#include <apt-pkg/pkgrecords.h>
-#include <apt-pkg/indexfile.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/indexfile.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/pkgrecords.h>
-#include <stddef.h>
#include <vector>
+#include <stddef.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/pkgrecords.h b/apt-pkg/pkgrecords.h
index 7c50c5d41..bdbd31a78 100644
--- a/apt-pkg/pkgrecords.h
+++ b/apt-pkg/pkgrecords.h
@@ -17,9 +17,9 @@
#ifndef PKGLIB_PKGRECORDS_H
#define PKGLIB_PKGRECORDS_H
-#include <apt-pkg/pkgcache.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
#include <string>
#include <vector>
diff --git a/apt-pkg/pkgsystem.cc b/apt-pkg/pkgsystem.cc
index b1c6cc1ea..aa94418c6 100644
--- a/apt-pkg/pkgsystem.cc
+++ b/apt-pkg/pkgsystem.cc
@@ -10,15 +10,15 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
#include <apt-pkg/debsystem.h>
-#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgsystem.h>
-#include <map>
#include <cassert>
#include <cstring>
+#include <map>
/*}}}*/
pkgSystem *_system = 0;
diff --git a/apt-pkg/pkgsystem.h b/apt-pkg/pkgsystem.h
index affaa5c9a..4b13072e2 100644
--- a/apt-pkg/pkgsystem.h
+++ b/apt-pkg/pkgsystem.h
@@ -37,7 +37,6 @@
#define PKGLIB_PKGSYSTEM_H
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <vector>
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc
index e87ba3ee2..008c98ecb 100644
--- a/apt-pkg/policy.cc
+++ b/apt-pkg/policy.cc
@@ -13,27 +13,26 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
-#include <apt-pkg/policy.h>
-#include <apt-pkg/configuration.h>
#include <apt-pkg/cachefilter.h>
-#include <apt-pkg/tagfile.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/fileutl.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/versionmatch.h>
+#include <apt-pkg/policy.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/tagfile.h>
#include <apt-pkg/version.h>
+#include <apt-pkg/versionmatch.h>
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <vector>
#include <ctype.h>
#include <stddef.h>
#include <string.h>
-#include <string>
-#include <vector>
-#include <iostream>
-#include <sstream>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/policy.h b/apt-pkg/policy.h
index 943332bbb..bcd1daf3e 100644
--- a/apt-pkg/policy.h
+++ b/apt-pkg/policy.h
@@ -34,11 +34,10 @@
#include <apt-pkg/depcache.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/versionmatch.h>
-#include <vector>
#include <string>
+#include <vector>
#ifndef APT_8_CLEANER_HEADERS
using std::vector;
diff --git a/apt-pkg/prettyprinters.h b/apt-pkg/prettyprinters.h
index 51d9f81a0..40f9d6628 100644
--- a/apt-pkg/prettyprinters.h
+++ b/apt-pkg/prettyprinters.h
@@ -1,7 +1,7 @@
#ifndef APT_PRETTYPRINTERS_H
#define APT_PRETTYPRINTERS_H
-#include <apt-pkg/pkgcache.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
class pkgDepCache;
diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc
index df2e0b46d..17c5c7a11 100644
--- a/apt-pkg/sourcelist.cc
+++ b/apt-pkg/sourcelist.cc
@@ -8,31 +8,30 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
-#include <apt-pkg/sourcelist.h>
#include <apt-pkg/cmndline.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/debindexfile.h>
+#include <apt-pkg/debsrcrecords.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/metaindex.h>
#include <apt-pkg/indexfile.h>
-#include <apt-pkg/tagfile.h>
+#include <apt-pkg/metaindex.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
-#include <apt-pkg/debindexfile.h>
-#include <apt-pkg/debsrcrecords.h>
+#include <apt-pkg/sourcelist.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/tagfile.h>
-#include <ctype.h>
-#include <stddef.h>
-#include <time.h>
+#include <algorithm>
#include <cstring>
+#include <fstream>
#include <map>
#include <string>
#include <vector>
-#include <fstream>
-#include <algorithm>
+#include <ctype.h>
+#include <stddef.h>
+#include <time.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/sourcelist.h b/apt-pkg/sourcelist.h
index 65f9c2b89..fedf90fa6 100644
--- a/apt-pkg/sourcelist.h
+++ b/apt-pkg/sourcelist.h
@@ -22,15 +22,14 @@
#ifndef PKGLIB_SOURCELIST_H
#define PKGLIB_SOURCELIST_H
-#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
#include <time.h>
+#include <map>
#include <string>
#include <vector>
-#include <map>
#ifndef APT_8_CLEANER_HEADERS
#include <apt-pkg/tagfile.h>
diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc
index a76604a8d..0c0c7a9fc 100644
--- a/apt-pkg/srcrecords.cc
+++ b/apt-pkg/srcrecords.cc
@@ -11,19 +11,19 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
-#include <apt-pkg/srcrecords.h>
#include <apt-pkg/debsrcrecords.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/sourcelist.h>
-#include <apt-pkg/metaindex.h>
#include <apt-pkg/indexfile.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/metaindex.h>
+#include <apt-pkg/sourcelist.h>
+#include <apt-pkg/srcrecords.h>
-#include <string.h>
#include <string>
#include <vector>
+#include <string.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-pkg/srcrecords.h b/apt-pkg/srcrecords.h
index a3c8444de..8c52f5683 100644
--- a/apt-pkg/srcrecords.h
+++ b/apt-pkg/srcrecords.h
@@ -12,8 +12,8 @@
#ifndef PKGLIB_SRCRECORDS_H
#define PKGLIB_SRCRECORDS_H
-#include <apt-pkg/macros.h>
#include <apt-pkg/hashes.h>
+#include <apt-pkg/macros.h>
#include <string>
#include <vector>
diff --git a/apt-pkg/statechanges.cc b/apt-pkg/statechanges.cc
index 35af45538..258c84885 100644
--- a/apt-pkg/statechanges.cc
+++ b/apt-pkg/statechanges.cc
@@ -1,9 +1,9 @@
-#include <apt-pkg/pkgcache.h>
#include <apt-pkg/cacheset.h>
#include <apt-pkg/debsystem.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/statechanges.h>
+#include <apt-pkg/pkgcache.h>
#include <apt-pkg/prettyprinters.h>
+#include <apt-pkg/statechanges.h>
#include <algorithm>
#include <memory>
diff --git a/apt-pkg/statechanges.h b/apt-pkg/statechanges.h
index 1eaf21a3a..2f63d516d 100644
--- a/apt-pkg/statechanges.h
+++ b/apt-pkg/statechanges.h
@@ -1,6 +1,6 @@
-#include <apt-pkg/pkgcache.h>
#include <apt-pkg/cacheset.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
#include <memory>
diff --git a/apt-pkg/tagfile-compat.cc b/apt-pkg/tagfile-compat.cc
index fe53e2974..e2cab474e 100644
--- a/apt-pkg/tagfile-compat.cc
+++ b/apt-pkg/tagfile-compat.cc
@@ -13,7 +13,7 @@
##################################################################### */
/*}}}*/
-#include<config.h>
+#include <config.h>
#define APT_COMPILING_TAGFILE_COMPAT_CC
#include <apt-pkg/tagfile.h>
diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc
index d9519175e..7de5c055b 100644
--- a/apt-pkg/tagfile.cc
+++ b/apt-pkg/tagfile.cc
@@ -11,20 +11,20 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
-#include <apt-pkg/tagfile.h>
-#include <apt-pkg/tagfile-keys.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/strutl.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/string_view.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/tagfile-keys.h>
+#include <apt-pkg/tagfile.h>
#include <list>
#include <string>
-#include <stdio.h>
#include <ctype.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h
index e02e7332e..c4dc50a10 100644
--- a/apt-pkg/tagfile.h
+++ b/apt-pkg/tagfile.h
@@ -21,12 +21,12 @@
#include <apt-pkg/macros.h>
-#include <stdio.h>
#include <stdint.h>
+#include <stdio.h>
+#include <list>
#include <string>
#include <vector>
-#include <list>
#ifdef APT_PKG_EXPOSE_STRING_VIEW
#include <apt-pkg/string_view.h>
#endif
diff --git a/apt-pkg/update.cc b/apt-pkg/update.cc
index f7075c446..4c64eeb5d 100644
--- a/apt-pkg/update.cc
+++ b/apt-pkg/update.cc
@@ -2,11 +2,11 @@
#include <config.h>
#include <apt-pkg/acquire-item.h>
+#include <apt-pkg/acquire.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/sourcelist.h>
-#include <apt-pkg/acquire.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/update.h>
diff --git a/apt-pkg/upgrade.cc b/apt-pkg/upgrade.cc
index a61789c11..c9432aa64 100644
--- a/apt-pkg/upgrade.cc
+++ b/apt-pkg/upgrade.cc
@@ -3,13 +3,12 @@
#include <apt-pkg/algorithms.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/depcache.h>
#include <apt-pkg/edsp.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/pkgcache.h>
#include <apt-pkg/progress.h>
#include <apt-pkg/upgrade.h>
-#include <apt-pkg/depcache.h>
-#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <string>
diff --git a/apt-pkg/upgrade.h b/apt-pkg/upgrade.h
index 2d9c0fa36..5612acfcb 100644
--- a/apt-pkg/upgrade.h
+++ b/apt-pkg/upgrade.h
@@ -10,8 +10,8 @@
#ifndef PKGLIB_UPGRADE_H
#define PKGLIB_UPGRADE_H
-#include <stddef.h>
#include <apt-pkg/macros.h>
+#include <stddef.h>
class pkgDepCache;
class OpProgress;
diff --git a/apt-pkg/version.cc b/apt-pkg/version.cc
index f32d39a69..8db311179 100644
--- a/apt-pkg/version.cc
+++ b/apt-pkg/version.cc
@@ -8,12 +8,12 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
#include <apt-pkg/version.h>
-#include <string.h>
#include <stdlib.h>
+#include <string.h>
/*}}}*/
static pkgVersioningSystem *VSList[10];
diff --git a/apt-pkg/versionmatch.cc b/apt-pkg/versionmatch.cc
index 2376ca8fd..8106a150e 100644
--- a/apt-pkg/versionmatch.cc
+++ b/apt-pkg/versionmatch.cc
@@ -11,22 +11,21 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
-#include <apt-pkg/versionmatch.h>
-#include <apt-pkg/strutl.h>
#include <apt-pkg/error.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/versionmatch.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
#include <string>
-#include <stdio.h>
#include <ctype.h>
#include <fnmatch.h>
#include <regex.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
/*}}}*/
using std::string;
diff --git a/apt-pkg/versionmatch.h b/apt-pkg/versionmatch.h
index 156ad61cb..ce8f95de5 100644
--- a/apt-pkg/versionmatch.h
+++ b/apt-pkg/versionmatch.h
@@ -36,7 +36,6 @@
#define PKGLIB_VERSIONMATCH_H
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <string>
diff --git a/apt-private/acqprogress.cc b/apt-private/acqprogress.cc
index 1f053cb9f..a788ec98b 100644
--- a/apt-private/acqprogress.cc
+++ b/apt-private/acqprogress.cc
@@ -7,23 +7,23 @@
##################################################################### */
/*}}}*/
// Include files /*{{{*/
-#include<config.h>
+#include <config.h>
-#include <apt-pkg/acquire.h>
#include <apt-pkg/acquire-item.h>
#include <apt-pkg/acquire-worker.h>
+#include <apt-pkg/acquire.h>
#include <apt-pkg/configuration.h>
-#include <apt-pkg/strutl.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/strutl.h>
#include <apt-private/acqprogress.h>
#include <apt-private/private-output.h>
-#include <string.h>
-#include <stdio.h>
-#include <signal.h>
#include <iostream>
#include <sstream>
+#include <signal.h>
+#include <stdio.h>
+#include <string.h>
#include <unistd.h>
#include <apti18n.h>
diff --git a/apt-private/acqprogress.h b/apt-private/acqprogress.h
index 196995ac4..c8c211689 100644
--- a/apt-private/acqprogress.h
+++ b/apt-private/acqprogress.h
@@ -12,8 +12,8 @@
#include <apt-pkg/acquire.h>
#include <apt-pkg/macros.h>
-#include <string>
#include <iostream>
+#include <string>
class APT_PUBLIC AcqTextStatus : public pkgAcquireStatus2
{
diff --git a/apt-private/private-cachefile.cc b/apt-private/private-cachefile.cc
index 77090f8eb..ab25338ff 100644
--- a/apt-private/private-cachefile.cc
+++ b/apt-private/private-cachefile.cc
@@ -1,20 +1,20 @@
// Include files /*{{{*/
-#include<config.h>
+#include <config.h>
#include <apt-pkg/algorithms.h>
-#include <apt-pkg/upgrade.h>
-#include <apt-pkg/error.h>
+#include <apt-pkg/cacheset.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/depcache.h>
+#include <apt-pkg/error.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheset.h>
+#include <apt-pkg/upgrade.h>
-#include <apt-private/private-output.h>
#include <apt-private/private-cachefile.h>
+#include <apt-private/private-output.h>
-#include <string.h>
-#include <ostream>
#include <cstdlib>
+#include <ostream>
+#include <string.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-private/private-cachefile.h b/apt-private/private-cachefile.h
index 77e8b61d9..5086ceaeb 100644
--- a/apt-private/private-cachefile.h
+++ b/apt-private/private-cachefile.h
@@ -2,12 +2,12 @@
#define APT_PRIVATE_CACHEFILE_H
#include <apt-pkg/cachefile.h>
-#include <apt-pkg/progress.h>
+#include <apt-pkg/cacheset.h>
#include <apt-pkg/configuration.h>
-#include <apt-pkg/pkgcache.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/progress.h>
#include <apt-pkg/sourcelist.h>
-#include <apt-pkg/cacheset.h>
// class CacheFile - Cover class for some dependency cache functions /*{{{*/
class APT_PUBLIC CacheFile : public pkgCacheFile
diff --git a/apt-private/private-cacheset.cc b/apt-private/private-cacheset.cc
index 52cd22d2a..3d1a2b91c 100644
--- a/apt-private/private-cacheset.cc
+++ b/apt-private/private-cacheset.cc
@@ -1,14 +1,13 @@
#include <config.h>
+#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/cachefile.h>
-#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/depcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/cachefilter.h>
-#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/configuration.h>
-#include <apt-pkg/progress.h>
+#include <apt-pkg/depcache.h>
+#include <apt-pkg/pkgcache.h>
#include <apt-pkg/policy.h>
+#include <apt-pkg/progress.h>
#include <apt-pkg/strutl.h>
#include <apt-private/private-cacheset.h>
diff --git a/apt-private/private-cacheset.h b/apt-private/private-cacheset.h
index 37c921081..7bf486b9e 100644
--- a/apt-private/private-cacheset.h
+++ b/apt-private/private-cacheset.h
@@ -6,10 +6,10 @@
#include <apt-private/private-output.h>
-#include <vector>
#include <list>
#include <set>
#include <string>
+#include <vector>
class OpProgress;
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc
index 6b84324de..2ecc47ba4 100644
--- a/apt-private/private-cmndline.cc
+++ b/apt-private/private-cmndline.cc
@@ -3,21 +3,21 @@
#include <apt-pkg/cmndline.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/init.h>
-#include <apt-pkg/error.h>
+#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/strutl.h>
#include <apt-private/private-cmndline.h>
#include <apt-private/private-main.h>
#include <stdarg.h>
-#include <string.h>
#include <stdlib.h>
+#include <string.h>
-#include <vector>
#include <iomanip>
+#include <vector>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-private/private-depends.cc b/apt-private/private-depends.cc
index 3a3a2737a..79d66b72a 100644
--- a/apt-private/private-depends.cc
+++ b/apt-private/private-depends.cc
@@ -1,12 +1,11 @@
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
#include <apt-pkg/algorithms.h>
#include <apt-pkg/cachefile.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/cacheset.h>
-#include <apt-pkg/configuration.h>
#include <apt-pkg/cmndline.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/pkgcache.h>
diff --git a/apt-private/private-download.cc b/apt-private/private-download.cc
index c8d1b5a09..25dee318e 100644
--- a/apt-private/private-download.cc
+++ b/apt-private/private-download.cc
@@ -1,30 +1,30 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/acquire.h>
#include <apt-pkg/acquire-item.h>
+#include <apt-pkg/acquire.h>
#include <apt-pkg/cacheset.h>
-#include <apt-pkg/cmndline.h>
#include <apt-pkg/clean.h>
+#include <apt-pkg/cmndline.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/strutl.h>
+#include <apt-private/acqprogress.h>
#include <apt-private/private-cachefile.h>
#include <apt-private/private-download.h>
#include <apt-private/private-output.h>
#include <apt-private/private-utils.h>
-#include <apt-private/acqprogress.h>
#include <fstream>
#include <string>
#include <vector>
-#include <unistd.h>
-#include <sys/types.h>
-#include <pwd.h>
#include <fcntl.h>
+#include <pwd.h>
+#include <sys/types.h>
+#include <unistd.h>
#ifdef HAVE_VFS_H
#include <sys/vfs.h>
#else
@@ -33,9 +33,9 @@
#endif
#include <sys/mount.h>
#endif
-#include <sys/statvfs.h>
-#include <sys/stat.h>
#include <errno.h>
+#include <sys/stat.h>
+#include <sys/statvfs.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc
index e37ff5390..aafe5542d 100644
--- a/apt-private/private-install.cc
+++ b/apt-private/private-install.cc
@@ -1,41 +1,40 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/acquire.h>
#include <apt-pkg/acquire-item.h>
+#include <apt-pkg/acquire.h>
#include <apt-pkg/algorithms.h>
#include <apt-pkg/cachefile.h>
#include <apt-pkg/cacheset.h>
#include <apt-pkg/cmndline.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/depcache.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/install-progress.h>
+#include <apt-pkg/macros.h>
+#include <apt-pkg/packagemanager.h>
+#include <apt-pkg/pkgcache.h>
#include <apt-pkg/pkgrecords.h>
#include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/prettyprinters.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 <apt-pkg/upgrade.h>
-#include <apt-pkg/install-progress.h>
-#include <apt-pkg/prettyprinters.h>
-#include <stdlib.h>
-#include <string.h>
#include <algorithm>
#include <iostream>
+#include <map>
#include <set>
#include <vector>
-#include <map>
+#include <stdlib.h>
+#include <string.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-install.h>
#include <apt-private/private-output.h>
#include <apti18n.h>
diff --git a/apt-private/private-install.h b/apt-private/private-install.h
index d2a9bed3f..c8b065331 100644
--- a/apt-private/private-install.h
+++ b/apt-private/private-install.h
@@ -2,11 +2,10 @@
#define APT_PRIVATE_INSTALL_H
#include <apt-pkg/cachefile.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/cacheset.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
#include <list>
#include <string>
diff --git a/apt-private/private-list.cc b/apt-private/private-list.cc
index 32c8eeaa2..2c9b349a3 100644
--- a/apt-private/private-list.cc
+++ b/apt-private/private-list.cc
@@ -5,21 +5,20 @@
#include <apt-pkg/cachefilter.h>
#include <apt-pkg/cacheset.h>
#include <apt-pkg/cmndline.h>
-#include <apt-pkg/pkgrecords.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-pkg/pkgrecords.h>
+#include <apt-pkg/progress.h>
+#include <apt-pkg/strutl.h>
#include <apt-private/private-cacheset.h>
#include <apt-private/private-list.h>
#include <apt-private/private-output.h>
#include <iostream>
-#include <sstream>
#include <map>
+#include <sstream>
#include <string>
#include <utility>
#include <vector>
diff --git a/apt-private/private-main.cc b/apt-private/private-main.cc
index 52f35cfdc..47b1a0921 100644
--- a/apt-private/private-main.cc
+++ b/apt-private/private-main.cc
@@ -10,13 +10,12 @@
#include <iostream>
#include <locale>
+#include <signal.h>
#include <string.h>
#include <unistd.h>
-#include <signal.h>
#include <apti18n.h>
-
void InitLocale(APT_CMD const binary) /*{{{*/
{
try {
diff --git a/apt-private/private-moo.cc b/apt-private/private-moo.cc
index b8ed6efbd..ca456ed96 100644
--- a/apt-private/private-moo.cc
+++ b/apt-private/private-moo.cc
@@ -7,22 +7,22 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
-#include <apt-pkg/configuration.h>
#include <apt-pkg/cmndline.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/strutl.h>
#include <apt-private/private-moo.h>
#include <apt-private/private-output.h>
#include <apt-private/private-utils.h>
-#include <stddef.h>
-#include <string.h>
-#include <time.h>
#include <iostream>
#include <sstream>
#include <string>
+#include <stddef.h>
+#include <string.h>
+#include <time.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-private/private-output.cc b/apt-private/private-output.cc
index 3b8832c21..6bc18516d 100644
--- a/apt-private/private-output.cc
+++ b/apt-private/private-output.cc
@@ -1,29 +1,28 @@
// Include files /*{{{*/
-#include<config.h>
+#include <config.h>
+#include <apt-pkg/cachefile.h>
#include <apt-pkg/configuration.h>
-#include <apt-pkg/strutl.h>
+#include <apt-pkg/depcache.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/cachefile.h>
+#include <apt-pkg/pkgcache.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-pkg/strutl.h>
-#include <apt-private/private-output.h>
#include <apt-private/private-cachefile.h>
+#include <apt-private/private-output.h>
-#include <regex.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <iomanip>
#include <iostream>
#include <langinfo.h>
-#include <unistd.h>
+#include <regex.h>
#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <sys/ioctl.h>
+#include <unistd.h>
#include <sstream>
diff --git a/apt-private/private-output.h b/apt-private/private-output.h
index 79da3d130..1ac861328 100644
--- a/apt-private/private-output.h
+++ b/apt-private/private-output.h
@@ -2,13 +2,13 @@
#define APT_PRIVATE_OUTPUT_H
#include <apt-pkg/configuration.h>
-#include <apt-pkg/pkgcache.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
-#include <functional>
#include <fstream>
-#include <string>
+#include <functional>
#include <iostream>
+#include <string>
// forward declaration
class pkgCacheFile;
diff --git a/apt-private/private-search.cc b/apt-private/private-search.cc
index bae04173d..b850339f9 100644
--- a/apt-private/private-search.cc
+++ b/apt-private/private-search.cc
@@ -4,26 +4,25 @@
#include <apt-pkg/cachefile.h>
#include <apt-pkg/cacheset.h>
#include <apt-pkg/cmndline.h>
-#include <apt-pkg/pkgrecords.h>
-#include <apt-pkg/policy.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 <apt-pkg/pkgrecords.h>
+#include <apt-pkg/policy.h>
+#include <apt-pkg/progress.h>
#include <apt-private/private-cacheset.h>
#include <apt-private/private-output.h>
#include <apt-private/private-search.h>
#include <apt-private/private-show.h>
-#include <string.h>
#include <iostream>
-#include <sstream>
#include <map>
+#include <sstream>
#include <string>
#include <utility>
+#include <string.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-private/private-search.h b/apt-private/private-search.h
index 8ae1f38f3..518f297ca 100644
--- a/apt-private/private-search.h
+++ b/apt-private/private-search.h
@@ -1,8 +1,8 @@
#ifndef APT_PRIVATE_SEARCH_H
#define APT_PRIVATE_SEARCH_H
-#include <apt-pkg/pkgcache.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
class CommandLine;
diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc
index 27338a08c..3cc6a5b87 100644
--- a/apt-private/private-show.cc
+++ b/apt-private/private-show.cc
@@ -4,29 +4,28 @@
#include <apt-pkg/cachefile.h>
#include <apt-pkg/cacheset.h>
#include <apt-pkg/cmndline.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/depcache.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/indexfile.h>
+#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
#include <apt-pkg/pkgrecords.h>
#include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/policy.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 <apt-pkg/policy.h>
#include <apt-private/private-cacheset.h>
#include <apt-private/private-output.h>
#include <apt-private/private-show.h>
-#include <stdio.h>
-#include <unistd.h>
#include <ostream>
#include <string>
+#include <stdio.h>
+#include <unistd.h>
#include <apti18n.h>
/*}}}*/
diff --git a/apt-private/private-show.h b/apt-private/private-show.h
index 80871b817..e48979c2c 100644
--- a/apt-private/private-show.h
+++ b/apt-private/private-show.h
@@ -1,8 +1,8 @@
#ifndef APT_PRIVATE_SHOW_H
#define APT_PRIVATE_SHOW_H
-#include <apt-pkg/pkgcache.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
#include <iostream>
diff --git a/apt-private/private-source.cc b/apt-private/private-source.cc
index e9ec7c6cf..47610cd80 100644
--- a/apt-private/private-source.cc
+++ b/apt-private/private-source.cc
@@ -6,7 +6,6 @@
#include <apt-pkg/algorithms.h>
#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/cachefile.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/cacheset.h>
#include <apt-pkg/cmndline.h>
#include <apt-pkg/configuration.h>
@@ -17,11 +16,11 @@
#include <apt-pkg/indexfile.h>
#include <apt-pkg/metaindex.h>
#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/policy.h>
#include <apt-pkg/sourcelist.h>
#include <apt-pkg/srcrecords.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/version.h>
-#include <apt-pkg/policy.h>
#include <apt-private/private-cachefile.h>
#include <apt-private/private-cacheset.h>
@@ -39,8 +38,8 @@
#include <unistd.h>
#include <iostream>
-#include <sstream>
#include <set>
+#include <sstream>
#include <string>
#include <vector>
diff --git a/apt-private/private-sources.cc b/apt-private/private-sources.cc
index 587571760..1d27d0ff1 100644
--- a/apt-private/private-sources.cc
+++ b/apt-private/private-sources.cc
@@ -1,24 +1,24 @@
#include <config.h>
-#include <apt-pkg/hashes.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/sourcelist.h>
+#include <apt-pkg/cachefile.h>
#include <apt-pkg/cmndline.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/cachefile.h>
+#include <apt-pkg/hashes.h>
+#include <apt-pkg/sourcelist.h>
+#include <apt-pkg/strutl.h>
#include <apt-private/private-output.h>
#include <apt-private/private-sources.h>
#include <apt-private/private-utils.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stddef.h>
-#include <unistd.h>
#include <iostream>
#include <string>
+#include <stddef.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
#include <apti18n.h>
diff --git a/apt-private/private-unmet.cc b/apt-private/private-unmet.cc
index 51ace3f47..f5161fcc3 100644
--- a/apt-private/private-unmet.cc
+++ b/apt-private/private-unmet.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
#include <apt-pkg/cachefile.h>
#include <apt-pkg/cmndline.h>
diff --git a/apt-private/private-update.cc b/apt-private/private-update.cc
index a886c830f..8949dab30 100644
--- a/apt-private/private-update.cc
+++ b/apt-private/private-update.cc
@@ -1,15 +1,15 @@
// Include files /*{{{*/
-#include<config.h>
+#include <config.h>
#include <apt-pkg/acquire-item.h>
+#include <apt-pkg/acquire.h>
#include <apt-pkg/cachefile.h>
#include <apt-pkg/cmndline.h>
+#include <apt-pkg/configuration.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 <apt-private/acqprogress.h>
#include <apt-private/private-cachefile.h>
diff --git a/apt-private/private-upgrade.cc b/apt-private/private-upgrade.cc
index 679140bfd..989f6b0c1 100644
--- a/apt-private/private-upgrade.cc
+++ b/apt-private/private-upgrade.cc
@@ -1,14 +1,14 @@
// Includes /*{{{*/
#include <config.h>
-#include <apt-pkg/upgrade.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/upgrade.h>
-#include <apt-private/private-install.h>
#include <apt-private/private-cachefile.h>
-#include <apt-private/private-upgrade.h>
+#include <apt-private/private-install.h>
#include <apt-private/private-output.h>
+#include <apt-private/private-upgrade.h>
#include <iostream>
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index 2fe2e7649..0f120a4b0 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -13,17 +13,22 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
#include <apt-pkg/algorithms.h>
#include <apt-pkg/cachefile.h>
#include <apt-pkg/cacheset.h>
#include <apt-pkg/cmndline.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/depcache.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/indexfile.h>
#include <apt-pkg/init.h>
+#include <apt-pkg/macros.h>
#include <apt-pkg/metaindex.h>
+#include <apt-pkg/mmap.h>
+#include <apt-pkg/pkgcache.h>
#include <apt-pkg/pkgrecords.h>
#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/policy.h>
@@ -34,26 +39,15 @@
#include <apt-pkg/strutl.h>
#include <apt-pkg/tagfile.h>
#include <apt-pkg/version.h>
-#include <apt-pkg/cacheiterators.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/depcache.h>
-#include <apt-pkg/macros.h>
-#include <apt-pkg/mmap.h>
-#include <apt-pkg/pkgcache.h>
#include <apt-private/private-cacheset.h>
#include <apt-private/private-cmndline.h>
#include <apt-private/private-depends.h>
-#include <apt-private/private-show.h>
+#include <apt-private/private-main.h>
#include <apt-private/private-search.h>
+#include <apt-private/private-show.h>
#include <apt-private/private-unmet.h>
-#include <apt-private/private-main.h>
-#include <regex.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
#include <algorithm>
#include <cstring>
#include <iomanip>
@@ -63,6 +57,11 @@
#include <set>
#include <string>
#include <vector>
+#include <regex.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
#include <apti18n.h>
/*}}}*/
diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc
index bac808a41..577d072db 100644
--- a/cmdline/apt-cdrom.cc
+++ b/cmdline/apt-cdrom.cc
@@ -11,28 +11,28 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
+#include <apt-pkg/cdrom.h>
+#include <apt-pkg/cdromutl.h>
#include <apt-pkg/cmndline.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/init.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/init.h>
+#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/progress.h>
-#include <apt-pkg/cdromutl.h>
#include <apt-pkg/strutl.h>
-#include <apt-pkg/cdrom.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/pkgsystem.h>
#include <iostream>
-#include <vector>
#include <string>
+#include <vector>
#include <sys/stat.h>
#include <unistd.h>
#include <apt-private/private-cmndline.h>
-#include <apt-private/private-output.h>
#include <apt-private/private-main.h>
+#include <apt-private/private-output.h>
#include <apti18n.h>
/*}}}*/
diff --git a/cmdline/apt-config.cc b/cmdline/apt-config.cc
index adec8dda4..ef1e95de1 100644
--- a/cmdline/apt-config.cc
+++ b/cmdline/apt-config.cc
@@ -16,20 +16,20 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
+#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/cmndline.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/init.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/strutl.h>
#include <iostream>
+#include <map>
#include <string>
#include <vector>
-#include <map>
#include <string.h>
#include <apt-private/private-cmndline.h>
diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc
index a4468b989..928fb1882 100644
--- a/cmdline/apt-extracttemplates.cc
+++ b/cmdline/apt-extracttemplates.cc
@@ -13,34 +13,33 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
-#include <apt-pkg/init.h>
#include <apt-pkg/cmndline.h>
-#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/configuration.h>
-#include <apt-pkg/sourcelist.h>
-#include <apt-pkg/pkgcachegen.h>
-#include <apt-pkg/version.h>
-#include <apt-pkg/tagfile.h>
#include <apt-pkg/debfile.h>
#include <apt-pkg/deblistparser.h>
+#include <apt-pkg/dirstream.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/strutl.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/pkgsystem.h>
-#include <apt-pkg/dirstream.h>
+#include <apt-pkg/init.h>
#include <apt-pkg/mmap.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/pkgcachegen.h>
+#include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/sourcelist.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/tagfile.h>
+#include <apt-pkg/version.h>
#include <apt-private/private-cmndline.h>
#include <apt-private/private-main.h>
#include <iostream>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <stdlib.h>
#include "apt-extracttemplates.h"
diff --git a/cmdline/apt-extracttemplates.h b/cmdline/apt-extracttemplates.h
index 91e385e70..66d98570a 100644
--- a/cmdline/apt-extracttemplates.h
+++ b/cmdline/apt-extracttemplates.h
@@ -10,8 +10,8 @@
#ifndef _APTEXTRACTTEMPLATE_H_
#define _APTEXTRACTTEMPLATE_H_
-#include <apt-pkg/fileutl.h>
#include <apt-pkg/dirstream.h>
+#include <apt-pkg/fileutl.h>
#include <string>
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 95d88e2ad..5cc0a02da 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -28,50 +28,51 @@
#include <config.h>
#include <apt-pkg/acquire-item.h>
+#include <apt-pkg/acquire.h>
#include <apt-pkg/algorithms.h>
#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/cachefile.h>
#include <apt-pkg/cacheset.h>
#include <apt-pkg/clean.h>
#include <apt-pkg/cmndline.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/debmetaindex.h>
#include <apt-pkg/depcache.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/indexfile.h>
#include <apt-pkg/init.h>
+#include <apt-pkg/macros.h>
#include <apt-pkg/md5.h>
#include <apt-pkg/metaindex.h>
+#include <apt-pkg/pkgcache.h>
#include <apt-pkg/pkgrecords.h>
#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/progress.h>
#include <apt-pkg/sourcelist.h>
+#include <apt-pkg/sptr.h>
#include <apt-pkg/srcrecords.h>
#include <apt-pkg/strutl.h>
-#include <apt-pkg/version.h>
-#include <apt-pkg/acquire.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/macros.h>
-#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/upgrade.h>
-#include <apt-pkg/sptr.h>
+#include <apt-pkg/version.h>
#include <apt-private/acqprogress.h>
-#include <apt-private/private-cacheset.h>
#include <apt-private/private-cachefile.h>
+#include <apt-private/private-cacheset.h>
#include <apt-private/private-cmndline.h>
#include <apt-private/private-download.h>
#include <apt-private/private-install.h>
#include <apt-private/private-main.h>
#include <apt-private/private-moo.h>
#include <apt-private/private-output.h>
+#include <apt-private/private-source.h>
#include <apt-private/private-update.h>
#include <apt-private/private-upgrade.h>
#include <apt-private/private-utils.h>
-#include <apt-private/private-source.h>
#include <errno.h>
+#include <grp.h>
+#include <pwd.h>
#include <signal.h>
#include <stddef.h>
#include <stdio.h>
@@ -80,14 +81,12 @@
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <unistd.h>
-#include <pwd.h>
-#include <grp.h>
#include <algorithm>
#include <fstream>
#include <iostream>
-#include <sstream>
#include <set>
+#include <sstream>
#include <string>
#include <vector>
diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc
index a6f88ad06..59b72ec25 100644
--- a/cmdline/apt-helper.cc
+++ b/cmdline/apt-helper.cc
@@ -7,30 +7,30 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/configuration.h>
+#include <apt-pkg/acquire-item.h>
+#include <apt-pkg/acquire.h>
#include <apt-pkg/cmndline.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/init.h>
-#include <apt-pkg/strutl.h>
#include <apt-pkg/pkgsystem.h>
-#include <apt-pkg/fileutl.h>
-#include <apt-pkg/acquire.h>
-#include <apt-pkg/acquire-item.h>
#include <apt-pkg/proxy.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/srvrec.h>
#include <apt-private/acqprogress.h>
-#include <apt-private/private-output.h>
-#include <apt-private/private-download.h>
#include <apt-private/private-cmndline.h>
+#include <apt-private/private-download.h>
#include <apt-private/private-main.h>
-#include <apt-pkg/srvrec.h>
+#include <apt-private/private-output.h>
#include <iostream>
#include <string>
#include <vector>
-#include <unistd.h>
#include <stdlib.h>
+#include <unistd.h>
#include <apti18n.h>
/*}}}*/
diff --git a/cmdline/apt-internal-planner.cc b/cmdline/apt-internal-planner.cc
index 1f74aa78f..be9de4ef4 100644
--- a/cmdline/apt-internal-planner.cc
+++ b/cmdline/apt-internal-planner.cc
@@ -9,34 +9,33 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/cmndline.h>
-#include <apt-pkg/init.h>
#include <apt-pkg/cachefile.h>
#include <apt-pkg/cacheset.h>
-#include <apt-pkg/strutl.h>
+#include <apt-pkg/cmndline.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/depcache.h>
#include <apt-pkg/edsp.h>
+#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/pkgsystem.h>
-#include <apt-pkg/configuration.h>
+#include <apt-pkg/init.h>
#include <apt-pkg/packagemanager.h>
-#include <apt-pkg/prettyprinters.h>
-#include <apt-pkg/depcache.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/prettyprinters.h>
+#include <apt-pkg/strutl.h>
-#include <apt-private/private-output.h>
#include <apt-private/private-cmndline.h>
#include <apt-private/private-main.h>
+#include <apt-private/private-output.h>
-#include <string.h>
+#include <cstdio>
#include <iostream>
-#include <sstream>
#include <list>
+#include <sstream>
#include <string>
-#include <unistd.h>
-#include <cstdio>
#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#include <apti18n.h>
/*}}}*/
diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc
index aecb0eaba..5c9ca5a35 100644
--- a/cmdline/apt-internal-solver.cc
+++ b/cmdline/apt-internal-solver.cc
@@ -9,34 +9,33 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/cmndline.h>
-#include <apt-pkg/init.h>
+#include <apt-pkg/algorithms.h>
#include <apt-pkg/cachefile.h>
#include <apt-pkg/cacheset.h>
-#include <apt-pkg/strutl.h>
+#include <apt-pkg/cmndline.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/depcache.h>
#include <apt-pkg/edsp.h>
-#include <apt-pkg/algorithms.h>
+#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/init.h>
+#include <apt-pkg/pkgcache.h>
#include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/strutl.h>
#include <apt-pkg/upgrade.h>
-#include <apt-pkg/configuration.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-cmndline.h>
#include <apt-private/private-main.h>
+#include <apt-private/private-output.h>
-#include <string.h>
+#include <cstdio>
#include <iostream>
-#include <sstream>
#include <list>
+#include <sstream>
#include <string>
-#include <unistd.h>
-#include <cstdio>
#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#include <apti18n.h>
/*}}}*/
diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc
index 0cba31e70..8315efa12 100644
--- a/cmdline/apt-mark.cc
+++ b/cmdline/apt-mark.cc
@@ -10,22 +10,26 @@
#include <apt-pkg/cachefile.h>
#include <apt-pkg/cacheset.h>
#include <apt-pkg/cmndline.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/depcache.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/init.h>
-#include <apt-pkg/pkgsystem.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/statechanges.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 <apt-pkg/pkgsystem.h>
+#include <apt-pkg/statechanges.h>
+#include <apt-pkg/strutl.h>
#include <apt-private/private-cmndline.h>
-#include <apt-private/private-output.h>
#include <apt-private/private-main.h>
+#include <apt-private/private-output.h>
+#include <algorithm>
+#include <fstream>
+#include <iostream>
+#include <string>
+#include <vector>
#include <errno.h>
#include <fcntl.h>
#include <stddef.h>
@@ -34,11 +38,6 @@
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>
-#include <algorithm>
-#include <fstream>
-#include <iostream>
-#include <string>
-#include <vector>
#include <apti18n.h>
/*}}}*/
diff --git a/cmdline/apt-sortpkgs.cc b/cmdline/apt-sortpkgs.cc
index cf19b84ec..40be29c77 100644
--- a/cmdline/apt-sortpkgs.cc
+++ b/cmdline/apt-sortpkgs.cc
@@ -14,25 +14,25 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/tagfile.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/configuration.h>
#include <apt-pkg/cmndline.h>
-#include <apt-pkg/init.h>
-#include <apt-pkg/strutl.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/init.h>
#include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/tagfile.h>
#include <apt-private/private-cmndline.h>
#include <apt-private/private-main.h>
-#include <vector>
#include <algorithm>
-#include <stdio.h>
-#include <unistd.h>
#include <iostream>
-#include <string>
#include <memory>
+#include <string>
+#include <vector>
+#include <stdio.h>
+#include <unistd.h>
#include <apti18n.h>
/*}}}*/
diff --git a/cmdline/apt.cc b/cmdline/apt.cc
index 4b266bcbe..6bf85467e 100644
--- a/cmdline/apt.cc
+++ b/cmdline/apt.cc
@@ -9,33 +9,33 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
#include <apt-pkg/cmndline.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/init.h>
#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/strutl.h>
-#include <apt-pkg/configuration.h>
-#include <apt-private/private-list.h>
-#include <apt-private/private-search.h>
-#include <apt-private/private-install.h>
-#include <apt-private/private-output.h>
-#include <apt-private/private-update.h>
#include <apt-private/private-cmndline.h>
+#include <apt-private/private-depends.h>
+#include <apt-private/private-download.h>
+#include <apt-private/private-install.h>
+#include <apt-private/private-list.h>
+#include <apt-private/private-main.h>
#include <apt-private/private-moo.h>
-#include <apt-private/private-upgrade.h>
+#include <apt-private/private-output.h>
+#include <apt-private/private-search.h>
#include <apt-private/private-show.h>
-#include <apt-private/private-main.h>
-#include <apt-private/private-sources.h>
#include <apt-private/private-source.h>
-#include <apt-private/private-depends.h>
-#include <apt-private/private-download.h>
+#include <apt-private/private-sources.h>
+#include <apt-private/private-update.h>
+#include <apt-private/private-upgrade.h>
-#include <unistd.h>
#include <iostream>
#include <vector>
+#include <unistd.h>
#include <apti18n.h>
/*}}}*/
diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc
index 9c02e5b87..196a0668c 100644
--- a/ftparchive/apt-ftparchive.cc
+++ b/ftparchive/apt-ftparchive.cc
@@ -12,33 +12,33 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/configuration.h>
#include <apt-pkg/cmndline.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/init.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/init.h>
+#include <apt-pkg/strutl.h>
#include <apt-private/private-cmndline.h>
-#include <apt-private/private-output.h>
#include <apt-private/private-main.h>
+#include <apt-private/private-output.h>
#include <algorithm>
#include <climits>
-#include <sys/time.h>
-#include <locale.h>
-#include <stdio.h>
-#include <sys/stat.h>
-#include <time.h>
#include <functional>
#include <iostream>
#include <string>
#include <vector>
+#include <locale.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <time.h>
-#include "cachedb.h"
-#include "override.h"
#include "apt-ftparchive.h"
+#include "cachedb.h"
#include "multicompress.h"
+#include "override.h"
#include "writer.h"
#include <apti18n.h>
diff --git a/ftparchive/apt-ftparchive.h b/ftparchive/apt-ftparchive.h
index 240cf9ba7..b1ce17545 100644
--- a/ftparchive/apt-ftparchive.h
+++ b/ftparchive/apt-ftparchive.h
@@ -13,7 +13,6 @@
#ifndef APT_FTPARCHIVE_H
#define APT_FTPARCHIVE_H
-
#include <fstream>
using std::ostream;
diff --git a/ftparchive/byhash.cc b/ftparchive/byhash.cc
index 354d089c3..b24f6158e 100644
--- a/ftparchive/byhash.cc
+++ b/ftparchive/byhash.cc
@@ -11,15 +11,15 @@
// Include Files /*{{{*/
#include <config.h>
-#include<algorithm>
-#include<string>
+#include <algorithm>
+#include <string>
-#include <unistd.h>
#include <sys/stat.h>
+#include <unistd.h>
+#include "byhash.h"
#include <apt-pkg/fileutl.h>
#include <apt-pkg/hashes.h>
-#include "byhash.h"
// Delete all files in a directory except the most recent N ones
void DeleteAllButMostRecent(std::string dir, int KeepFiles)
diff --git a/ftparchive/cachedb.cc b/ftparchive/cachedb.cc
index 868029abd..210ce6dc1 100644
--- a/ftparchive/cachedb.cc
+++ b/ftparchive/cachedb.cc
@@ -12,22 +12,22 @@
// Include Files /*{{{*/
#include <config.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/debfile.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/sha1.h>
#include <apt-pkg/sha2.h>
#include <apt-pkg/strutl.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/fileutl.h>
-#include <apt-pkg/debfile.h>
-#include <apt-pkg/gpgv.h>
-#include <apt-pkg/hashes.h>
-#include <netinet/in.h> // htonl, etc
#include <ctype.h>
+#include <netinet/in.h> // htonl, etc
#include <stddef.h>
-#include <sys/stat.h>
#include <strings.h>
+#include <sys/stat.h>
#include "cachedb.h"
diff --git a/ftparchive/cachedb.h b/ftparchive/cachedb.h
index 417c25a9f..117ba5a1b 100644
--- a/ftparchive/cachedb.h
+++ b/ftparchive/cachedb.h
@@ -12,15 +12,15 @@
#ifndef CACHEDB_H
#define CACHEDB_H
-#include <apt-pkg/hashes.h>
#include <apt-pkg/debfile.h>
+#include <apt-pkg/hashes.h>
#include <db.h>
-#include <errno.h>
#include <string>
-#include <string.h>
+#include <errno.h>
#include <stdint.h>
#include <stdio.h>
+#include <string.h>
#include "contents.h"
#include "sources.h"
diff --git a/ftparchive/contents.h b/ftparchive/contents.h
index bc691d473..8691b0e87 100644
--- a/ftparchive/contents.h
+++ b/ftparchive/contents.h
@@ -12,9 +12,9 @@
#include <apt-pkg/dirstream.h>
+#include <string>
#include <stddef.h>
#include <stdio.h>
-#include <string>
class debDebFile;
class FileFd;
diff --git a/ftparchive/multicompress.cc b/ftparchive/multicompress.cc
index 0a8d4d109..abb8c5906 100644
--- a/ftparchive/multicompress.cc
+++ b/ftparchive/multicompress.cc
@@ -16,17 +16,17 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/fileutl.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/md5.h>
#include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/hashsum_template.h>
+#include <apt-pkg/md5.h>
+#include <apt-pkg/strutl.h>
#include <ctype.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
+#include <sys/types.h>
#include <unistd.h>
#include <algorithm>
diff --git a/ftparchive/multicompress.h b/ftparchive/multicompress.h
index 161716b86..50453acab 100644
--- a/ftparchive/multicompress.h
+++ b/ftparchive/multicompress.h
@@ -16,8 +16,8 @@
#ifndef MULTICOMPRESS_H
#define MULTICOMPRESS_H
-#include <apt-pkg/fileutl.h>
#include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/fileutl.h>
#include <string>
#include <stdio.h>
diff --git a/ftparchive/override.cc b/ftparchive/override.cc
index 8a0c5bab1..26d629bfa 100644
--- a/ftparchive/override.cc
+++ b/ftparchive/override.cc
@@ -12,13 +12,13 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/strutl.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/strutl.h>
-#include <stdio.h>
+#include <utility>
#include <ctype.h>
+#include <stdio.h>
#include <string.h>
-#include <utility>
#include "override.h"
diff --git a/ftparchive/override.h b/ftparchive/override.h
index c5cacc2b4..74637404c 100644
--- a/ftparchive/override.h
+++ b/ftparchive/override.h
@@ -12,8 +12,6 @@
#ifndef OVERRIDE_H
#define OVERRIDE_H
-
-
#include <map>
#include <string>
diff --git a/ftparchive/sources.cc b/ftparchive/sources.cc
index ab976b490..60a86171f 100644
--- a/ftparchive/sources.cc
+++ b/ftparchive/sources.cc
@@ -1,5 +1,5 @@
-#include <string>
#include <sstream>
+#include <string>
// for memcpy
#include <cstring>
diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc
index 7cda37459..d5c9735e7 100644
--- a/ftparchive/writer.cc
+++ b/ftparchive/writer.cc
@@ -14,19 +14,26 @@
#include <config.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/debfile.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/strutl.h>
#include <apt-pkg/tagfile.h>
+#include <algorithm>
+#include <ctime>
+#include <iomanip>
+#include <iostream>
+#include <memory>
+#include <sstream>
+#include <utility>
#include <ctype.h>
#include <fnmatch.h>
#include <ftw.h>
@@ -35,19 +42,12 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
-#include <ctime>
-#include <iostream>
-#include <iomanip>
-#include <sstream>
-#include <memory>
-#include <utility>
-#include <algorithm>
#include "apt-ftparchive.h"
-#include "writer.h"
+#include "byhash.h"
#include "cachedb.h"
#include "multicompress.h"
-#include "byhash.h"
+#include "writer.h"
#include <apti18n.h>
/*}}}*/
diff --git a/ftparchive/writer.h b/ftparchive/writer.h
index ea4c66da4..b2cef4f00 100644
--- a/ftparchive/writer.h
+++ b/ftparchive/writer.h
@@ -15,19 +15,19 @@
#include <apt-pkg/hashes.h>
-#include <string>
-#include <stdio.h>
#include <iostream>
-#include <vector>
#include <map>
#include <set>
+#include <string>
+#include <vector>
+#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
-#include "contents.h"
+#include "apt-ftparchive.h"
#include "cachedb.h"
+#include "contents.h"
#include "override.h"
-#include "apt-ftparchive.h"
using std::string;
using std::cout;
diff --git a/methods/aptmethod.h b/methods/aptmethod.h
index 04c4fa99b..04858e29d 100644
--- a/methods/aptmethod.h
+++ b/methods/aptmethod.h
@@ -4,15 +4,16 @@
#include <apt-pkg/acquire-method.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
#include <algorithm>
#include <locale>
#include <string>
#include <vector>
+#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <unistd.h>
#include <apti18n.h>
diff --git a/methods/basehttp.cc b/methods/basehttp.cc
index a2f1a6e55..c3d570c83 100644
--- a/methods/basehttp.cc
+++ b/methods/basehttp.cc
@@ -15,6 +15,11 @@
#include <apt-pkg/fileutl.h>
#include <apt-pkg/strutl.h>
+#include <iostream>
+#include <limits>
+#include <map>
+#include <string>
+#include <vector>
#include <ctype.h>
#include <signal.h>
#include <stdio.h>
@@ -23,11 +28,6 @@
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
-#include <iostream>
-#include <limits>
-#include <map>
-#include <string>
-#include <vector>
#include "basehttp.h"
diff --git a/methods/basehttp.h b/methods/basehttp.h
index 41a9a4306..7000e7b89 100644
--- a/methods/basehttp.h
+++ b/methods/basehttp.h
@@ -11,14 +11,14 @@
#ifndef APT_SERVER_H
#define APT_SERVER_H
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/fileutl.h>
#include "aptmethod.h"
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/strutl.h>
-#include <time.h>
#include <iostream>
-#include <string>
#include <memory>
+#include <string>
+#include <time.h>
using std::cout;
using std::endl;
diff --git a/methods/cdrom.cc b/methods/cdrom.cc
index 87a58e948..8b7587fe5 100644
--- a/methods/cdrom.cc
+++ b/methods/cdrom.cc
@@ -12,11 +12,11 @@
#include <apt-pkg/cdrom.h>
#include <apt-pkg/cdromutl.h>
-#include <apt-pkg/error.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/strutl.h>
#include <apt-pkg/hashes.h>
+#include <apt-pkg/strutl.h>
#include "aptmethod.h"
diff --git a/methods/connect.cc b/methods/connect.cc
index 182af48ae..949cd3f99 100644
--- a/methods/connect.cc
+++ b/methods/connect.cc
@@ -13,29 +13,29 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/fileutl.h>
-#include <apt-pkg/strutl.h>
#include <apt-pkg/acquire-method.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/srvrec.h>
+#include <apt-pkg/strutl.h>
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
-#include <stdio.h>
-#include <errno.h>
-#include <unistd.h>
+#include <set>
#include <sstream>
+#include <string>
+#include <errno.h>
+#include <stdio.h>
#include <string.h>
-#include<set>
-#include<string>
+#include <unistd.h>
// Internet stuff
+#include <netdb.h>
+#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>
-#include <arpa/inet.h>
-#include <netdb.h>
#include "aptmethod.h"
#include "connect.h"
diff --git a/methods/connect.h b/methods/connect.h
index 4456d660d..817ebf765 100644
--- a/methods/connect.h
+++ b/methods/connect.h
@@ -11,8 +11,8 @@
#define CONNECT_H
#include <memory>
-#include <stddef.h>
#include <string>
+#include <stddef.h>
class aptMethod;
diff --git a/methods/copy.cc b/methods/copy.cc
index 810fc2f38..fd4786ede 100644
--- a/methods/copy.cc
+++ b/methods/copy.cc
@@ -11,12 +11,12 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/fileutl.h>
-#include <apt-pkg/strutl.h>
+#include "aptmethod.h"
+#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/hashes.h>
-#include <apt-pkg/configuration.h>
-#include "aptmethod.h"
+#include <apt-pkg/strutl.h>
#include <string>
#include <sys/stat.h>
diff --git a/methods/curl.cc b/methods/curl.cc
index ac3f77ab6..dfdd3b06b 100644
--- a/methods/curl.cc
+++ b/methods/curl.cc
@@ -12,27 +12,26 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/fileutl.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/hashes.h>
-#include <apt-pkg/netrc.h>
-#include <apt-pkg/configuration.h>
#include <apt-pkg/macros.h>
-#include <apt-pkg/strutl.h>
+#include <apt-pkg/netrc.h>
#include <apt-pkg/proxy.h>
+#include <apt-pkg/strutl.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <unistd.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <stdlib.h>
#include <array>
#include <iostream>
#include <sstream>
-
#include "curl.h"
#include <apti18n.h>
diff --git a/methods/curl.h b/methods/curl.h
index fbbf34501..d352dc52a 100644
--- a/methods/curl.h
+++ b/methods/curl.h
@@ -11,11 +11,11 @@
#ifndef APT_HTTPS_H
#define APT_HTTPS_H
-#include <curl/curl.h>
#include <iostream>
-#include <stddef.h>
-#include <string>
#include <memory>
+#include <string>
+#include <curl/curl.h>
+#include <stddef.h>
#include "basehttp.h"
diff --git a/methods/file.cc b/methods/file.cc
index 5cbf1924e..6111329d5 100644
--- a/methods/file.cc
+++ b/methods/file.cc
@@ -15,12 +15,12 @@
// Include Files /*{{{*/
#include <config.h>
+#include "aptmethod.h"
#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/hashes.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/hashes.h>
#include <apt-pkg/strutl.h>
-#include "aptmethod.h"
#include <string>
#include <sys/stat.h>
diff --git a/methods/ftp.cc b/methods/ftp.cc
index f4986f648..9bfe72bc6 100644
--- a/methods/ftp.cc
+++ b/methods/ftp.cc
@@ -17,33 +17,33 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/fileutl.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/netrc.h>
-#include <apt-pkg/configuration.h>
#include <apt-pkg/strutl.h>
+#include <iostream>
#include <ctype.h>
+#include <errno.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <unistd.h>
-#include <signal.h>
-#include <stdio.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <iostream>
// Internet stuff
-#include <netinet/in.h>
-#include <arpa/inet.h>
#include <netdb.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
-#include "rfc2553emu.h"
#include "connect.h"
#include "ftp.h"
+#include "rfc2553emu.h"
#include <apti18n.h>
/*}}}*/
diff --git a/methods/ftp.h b/methods/ftp.h
index 5b23dba41..67d00d9f1 100644
--- a/methods/ftp.h
+++ b/methods/ftp.h
@@ -14,10 +14,10 @@
#include "connect.h"
#include <apt-pkg/strutl.h>
+#include <string>
#include <sys/socket.h>
#include <sys/types.h>
#include <time.h>
-#include <string>
class FTPConn
{
diff --git a/methods/gpgv.cc b/methods/gpgv.cc
index 51c268d02..8de15c48a 100644
--- a/methods/gpgv.cc
+++ b/methods/gpgv.cc
@@ -1,11 +1,11 @@
#include <config.h>
+#include "aptmethod.h"
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/gpgv.h>
#include <apt-pkg/strutl.h>
-#include <apt-pkg/fileutl.h>
-#include "aptmethod.h"
#include <ctype.h>
#include <errno.h>
@@ -16,11 +16,11 @@
#include <sys/wait.h>
#include <unistd.h>
-#include <array>
#include <algorithm>
-#include <sstream>
-#include <iterator>
+#include <array>
#include <iostream>
+#include <iterator>
+#include <sstream>
#include <string>
#include <vector>
diff --git a/methods/http.cc b/methods/http.cc
index 0f347e700..9f01d15b3 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -19,26 +19,26 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/fileutl.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/netrc.h>
-#include <apt-pkg/strutl.h>
#include <apt-pkg/proxy.h>
+#include <apt-pkg/strutl.h>
+#include <cstring>
+#include <iostream>
+#include <sstream>
+#include <arpa/inet.h>
+#include <errno.h>
#include <stddef.h>
+#include <stdio.h>
#include <stdlib.h>
#include <sys/select.h>
-#include <cstring>
#include <sys/stat.h>
#include <sys/time.h>
#include <unistd.h>
-#include <stdio.h>
-#include <errno.h>
-#include <arpa/inet.h>
-#include <iostream>
-#include <sstream>
#include "config.h"
#include "connect.h"
diff --git a/methods/http_main.cc b/methods/http_main.cc
index 90a0450e2..792b5e22f 100644
--- a/methods/http_main.cc
+++ b/methods/http_main.cc
@@ -1,6 +1,6 @@
#include <config.h>
-#include <apt-pkg/fileutl.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
#include <signal.h>
#include "http.h"
diff --git a/methods/mirror.cc b/methods/mirror.cc
index 5047463d1..b0da5c530 100644
--- a/methods/mirror.cc
+++ b/methods/mirror.cc
@@ -10,35 +10,35 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/aptconfiguration.h>
-#include <apt-pkg/fileutl.h>
#include <apt-pkg/acquire-item.h>
#include <apt-pkg/acquire.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/sourcelist.h>
+#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/metaindex.h>
+#include <apt-pkg/sourcelist.h>
#include <apt-pkg/strutl.h>
#include <algorithm>
-#include <iostream>
#include <fstream>
+#include <iostream>
+#include <dirent.h>
+#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/utsname.h>
-#include <dirent.h>
-#include <fcntl.h>
+#include <unistd.h>
using namespace std;
-#include<sstream>
+#include <sstream>
-#include "mirror.h"
#include "http.h"
+#include "mirror.h"
#include <apti18n.h>
/*}}}*/
diff --git a/methods/rfc2553emu.cc b/methods/rfc2553emu.cc
index 372882769..13f79391a 100644
--- a/methods/rfc2553emu.cc
+++ b/methods/rfc2553emu.cc
@@ -16,12 +16,12 @@
/*}}}*/
#include <config.h>
-#include <stdlib.h>
+#include "rfc2553emu.h"
#include <arpa/inet.h>
#include <netinet/in.h>
-#include <string.h>
#include <stdio.h>
-#include "rfc2553emu.h"
+#include <stdlib.h>
+#include <string.h>
#ifndef HAVE_GETADDRINFO
// getaddrinfo - Resolve a hostname /*{{{*/
diff --git a/methods/rfc2553emu.h b/methods/rfc2553emu.h
index ad7ddf48a..462bfe26f 100644
--- a/methods/rfc2553emu.h
+++ b/methods/rfc2553emu.h
@@ -23,8 +23,8 @@
#define RFC2553EMU_H
#include <netdb.h>
-#include <sys/types.h>
#include <sys/socket.h>
+#include <sys/types.h>
// Autosense getaddrinfo
#if defined(AI_PASSIVE) && defined(EAI_NONAME)
diff --git a/methods/rred.cc b/methods/rred.cc
index 2e5008d46..3a3b20286 100644
--- a/methods/rred.cc
+++ b/methods/rred.cc
@@ -7,19 +7,19 @@
#include <config.h>
-#include <apt-pkg/init.h>
-#include <apt-pkg/fileutl.h>
+#include "aptmethod.h"
+#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/strutl.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/hashes.h>
-#include <apt-pkg/configuration.h>
-#include "aptmethod.h"
+#include <apt-pkg/init.h>
+#include <apt-pkg/strutl.h>
-#include <stddef.h>
#include <iostream>
-#include <string>
#include <list>
+#include <string>
#include <vector>
+#include <stddef.h>
#include <assert.h>
#include <errno.h>
diff --git a/methods/rsh.cc b/methods/rsh.cc
index 7b8af6f9b..69a51a13d 100644
--- a/methods/rsh.cc
+++ b/methods/rsh.cc
@@ -13,22 +13,22 @@
// Include Files /*{{{*/
#include <config.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/hashes.h>
-#include <apt-pkg/configuration.h>
#include <apt-pkg/strutl.h>
+#include "rsh.h"
+#include <errno.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <unistd.h>
-#include <signal.h>
-#include <stdio.h>
-#include <errno.h>
-#include <stdarg.h>
-#include "rsh.h"
#include <apti18n.h>
/*}}}*/
diff --git a/methods/store.cc b/methods/store.cc
index 1faaa4fb4..d54a14397 100644
--- a/methods/store.cc
+++ b/methods/store.cc
@@ -13,19 +13,19 @@
// Include Files /*{{{*/
#include <config.h>
+#include "aptmethod.h"
+#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/strutl.h>
-#include <apt-pkg/aptconfiguration.h>
-#include "aptmethod.h"
+#include <string>
+#include <vector>
#include <string.h>
#include <sys/stat.h>
#include <sys/time.h>
-#include <string>
-#include <vector>
#include <apti18n.h>
/*}}}*/
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc
index cbefe48d9..b4b3ef870 100644
--- a/test/interactive-helper/aptwebserver.cc
+++ b/test/interactive-helper/aptwebserver.cc
@@ -23,10 +23,10 @@
#include <unistd.h>
#include <algorithm>
-#include <iostream>
#include <fstream>
-#include <sstream>
+#include <iostream>
#include <list>
+#include <sstream>
#include <string>
#include <thread>
#include <vector>
diff --git a/test/interactive-helper/extract-control.cc b/test/interactive-helper/extract-control.cc
index 852ec4ee9..a19e0380c 100644
--- a/test/interactive-helper/extract-control.cc
+++ b/test/interactive-helper/extract-control.cc
@@ -4,8 +4,8 @@
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
-#include <string>
#include <iostream>
+#include <string>
#include <unistd.h>
using namespace std;
diff --git a/test/interactive-helper/rpmver.cc b/test/interactive-helper/rpmver.cc
index 017c92fba..b23ba2876 100644
--- a/test/interactive-helper/rpmver.cc
+++ b/test/interactive-helper/rpmver.cc
@@ -1,11 +1,11 @@
#include <config.h>
#include <apt-pkg/debversion.h>
-#include <rpm/rpmio.h>
+#include <ctype.h>
#include <rpm/misc.h>
-#include <stdlib.h>
+#include <rpm/rpmio.h>
#include <stdio.h>
-#include <ctype.h>
+#include <stdlib.h>
#define xisdigit(x) isdigit(x)
#define xisalpha(x) isalpha(x)
diff --git a/test/interactive-helper/teestream.h b/test/interactive-helper/teestream.h
index 728a1bae2..058717ac3 100644
--- a/test/interactive-helper/teestream.h
+++ b/test/interactive-helper/teestream.h
@@ -8,8 +8,8 @@
a logfile easily, so don't expect that to be a bulletproof
implementation. */
-#include <iostream>
#include <apt-pkg/macros.h>
+#include <iostream>
template <typename CharT, typename Traits = std::char_traits<CharT>
> class basic_teebuf: public std::basic_streambuf<CharT, Traits>
diff --git a/test/interactive-helper/test_fileutl.cc b/test/interactive-helper/test_fileutl.cc
index 7c4b95759..6c29b748f 100644
--- a/test/interactive-helper/test_fileutl.cc
+++ b/test/interactive-helper/test_fileutl.cc
@@ -1,13 +1,13 @@
+#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/strutl.h>
-#include <apt-pkg/error.h>
-#include <sys/types.h>
+#include <fcntl.h>
+#include <stdlib.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
-#include <stdlib.h>
-#include <fcntl.h>
#include <iostream>
#include <string>
diff --git a/test/interactive-helper/test_udevcdrom.cc b/test/interactive-helper/test_udevcdrom.cc
index b87dcd935..2355186d6 100644
--- a/test/interactive-helper/test_udevcdrom.cc
+++ b/test/interactive-helper/test_udevcdrom.cc
@@ -2,11 +2,11 @@
#include <apt-pkg/cdrom.h>
-#include <stddef.h>
+#include <iostream>
#include <string>
-#include <assert.h>
#include <vector>
-#include <iostream>
+#include <assert.h>
+#include <stddef.h>
int main()
{
diff --git a/test/interactive-helper/testdeb.cc b/test/interactive-helper/testdeb.cc
index 69e1ffe0b..0bb24a52a 100644
--- a/test/interactive-helper/testdeb.cc
+++ b/test/interactive-helper/testdeb.cc
@@ -1,10 +1,10 @@
#include <config.h>
-#include <apt-pkg/dirstream.h>
+#include <apt-pkg/arfile.h>
#include <apt-pkg/debfile.h>
+#include <apt-pkg/dirstream.h>
#include <apt-pkg/error.h>
#include <apt-pkg/extracttar.h>
-#include <apt-pkg/arfile.h>
#include <apt-pkg/fileutl.h>
#include <iostream>
diff --git a/test/libapt/acqprogress_test.cc b/test/libapt/acqprogress_test.cc
index 0e82a285d..d4596c85d 100644
--- a/test/libapt/acqprogress_test.cc
+++ b/test/libapt/acqprogress_test.cc
@@ -1,12 +1,12 @@
#include <config.h>
-#include <apt-pkg/hashes.h>
-#include <apt-pkg/acquire.h>
#include <apt-pkg/acquire-item.h>
+#include <apt-pkg/acquire.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/hashes.h>
#include <apt-private/acqprogress.h>
-#include <string>
-#include <sstream>
#include <gtest/gtest.h>
+#include <sstream>
+#include <string>
class TestItem: public pkgAcquire::Item
{
diff --git a/test/libapt/cdrom_test.cc b/test/libapt/cdrom_test.cc
index b4c51cdb0..c9021e64e 100644
--- a/test/libapt/cdrom_test.cc
+++ b/test/libapt/cdrom_test.cc
@@ -1,13 +1,13 @@
#include <config.h>
-#include <apt-pkg/configuration.h>
#include <apt-pkg/cdrom.h>
#include <apt-pkg/cdromutl.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/fileutl.h>
#include <string>
-#include <string.h>
#include <vector>
+#include <string.h>
#include <gtest/gtest.h>
diff --git a/test/libapt/cdromfindpackages_test.cc b/test/libapt/cdromfindpackages_test.cc
index 0d8eb1f90..f6acf18fd 100644
--- a/test/libapt/cdromfindpackages_test.cc
+++ b/test/libapt/cdromfindpackages_test.cc
@@ -5,10 +5,10 @@
#include <apt-pkg/fileutl.h>
#include <algorithm>
+#include <iostream>
#include <string>
#include <vector>
#include <stddef.h>
-#include <iostream>
#include <gtest/gtest.h>
diff --git a/test/libapt/compareversion_test.cc b/test/libapt/compareversion_test.cc
index 3b2c0c209..1782c61cc 100644
--- a/test/libapt/compareversion_test.cc
+++ b/test/libapt/compareversion_test.cc
@@ -18,15 +18,15 @@
/*}}}*/
#include <config.h>
-#include <apt-pkg/error.h>
#include <apt-pkg/debversion.h>
+#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <fstream>
#include <string>
#include <stdlib.h>
-#include <unistd.h>
#include <sys/wait.h>
+#include <unistd.h>
#include <gtest/gtest.h>
diff --git a/test/libapt/extracttar_test.cc b/test/libapt/extracttar_test.cc
index 0255bd767..30934144a 100644
--- a/test/libapt/extracttar_test.cc
+++ b/test/libapt/extracttar_test.cc
@@ -3,8 +3,8 @@
#include <iostream>
#include <stdlib.h>
-#include <gtest/gtest.h>
#include "assert.h"
+#include <gtest/gtest.h>
class Stream : public pkgDirStream
{
diff --git a/test/libapt/file-helpers.cc b/test/libapt/file-helpers.cc
index 48d8a9fbb..aa16a2e30 100644
--- a/test/libapt/file-helpers.cc
+++ b/test/libapt/file-helpers.cc
@@ -2,10 +2,10 @@
#include <string>
-#include <unistd.h>
+#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <fcntl.h>
+#include <unistd.h>
#include <gtest/gtest.h>
diff --git a/test/libapt/fileutl_test.cc b/test/libapt/fileutl_test.cc
index d11622019..6cc850033 100644
--- a/test/libapt/fileutl_test.cc
+++ b/test/libapt/fileutl_test.cc
@@ -1,10 +1,10 @@
#include <config.h>
+#include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/strutl.h>
-#include <apt-pkg/aptconfiguration.h>
-#include <apt-pkg/configuration.h>
#include <algorithm>
#include <string>
diff --git a/test/libapt/getlanguages_test.cc b/test/libapt/getlanguages_test.cc
index 29ff0c9ae..26ff66f72 100644
--- a/test/libapt/getlanguages_test.cc
+++ b/test/libapt/getlanguages_test.cc
@@ -10,9 +10,9 @@
#include <string>
#include <vector>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include <gtest/gtest.h>
diff --git a/test/libapt/getlistoffilesindir_test.cc b/test/libapt/getlistoffilesindir_test.cc
index 8c5e56b1d..606e2733e 100644
--- a/test/libapt/getlistoffilesindir_test.cc
+++ b/test/libapt/getlistoffilesindir_test.cc
@@ -1,11 +1,11 @@
#include <config.h>
-#include <apt-pkg/fileutl.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
+#include <iostream>
#include <string>
#include <vector>
-#include <iostream>
#include <gtest/gtest.h>
diff --git a/test/libapt/globalerror_test.cc b/test/libapt/globalerror_test.cc
index bb36905a4..67682c275 100644
--- a/test/libapt/globalerror_test.cc
+++ b/test/libapt/globalerror_test.cc
@@ -2,9 +2,9 @@
#include <apt-pkg/error.h>
-#include <stddef.h>
#include <string>
#include <errno.h>
+#include <stddef.h>
#include <string.h>
#include <gtest/gtest.h>
diff --git a/test/libapt/gtest_runner.cc b/test/libapt/gtest_runner.cc
index 73854d976..5620aa0bd 100644
--- a/test/libapt/gtest_runner.cc
+++ b/test/libapt/gtest_runner.cc
@@ -1,9 +1,9 @@
#include <gtest/gtest.h>
#include <apt-pkg/configuration.h>
-#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/error.h>
#include <apt-pkg/init.h>
+#include <apt-pkg/pkgsystem.h>
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
diff --git a/test/libapt/hashsums_test.cc b/test/libapt/hashsums_test.cc
index fb9a25643..8b4533265 100644
--- a/test/libapt/hashsums_test.cc
+++ b/test/libapt/hashsums_test.cc
@@ -1,16 +1,16 @@
#include <config.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/hashes.h>
#include <apt-pkg/md5.h>
#include <apt-pkg/sha1.h>
#include <apt-pkg/sha2.h>
#include <apt-pkg/strutl.h>
-#include <apt-pkg/hashes.h>
-#include <apt-pkg/fileutl.h>
#include <iostream>
-#include <stdlib.h>
#include <string>
+#include <stdlib.h>
#include <gtest/gtest.h>
diff --git a/test/libapt/indexcopytosourcelist_test.cc b/test/libapt/indexcopytosourcelist_test.cc
index eb6d49edf..b0bfeb4b2 100644
--- a/test/libapt/indexcopytosourcelist_test.cc
+++ b/test/libapt/indexcopytosourcelist_test.cc
@@ -1,7 +1,7 @@
#include <config.h>
-#include <apt-pkg/configuration.h>
#include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/indexcopy.h>
#include <string>
diff --git a/test/libapt/parsedepends_test.cc b/test/libapt/parsedepends_test.cc
index c2781b5d6..ed849f768 100644
--- a/test/libapt/parsedepends_test.cc
+++ b/test/libapt/parsedepends_test.cc
@@ -1,11 +1,11 @@
#include <config.h>
-#include <apt-pkg/deblistparser.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/deblistparser.h>
#include <apt-pkg/pkgcache.h>
-#include <string.h>
#include <string>
+#include <string.h>
#include <gtest/gtest.h>
diff --git a/test/libapt/priority_test.cc b/test/libapt/priority_test.cc
index ef1941ce5..af7932ae8 100644
--- a/test/libapt/priority_test.cc
+++ b/test/libapt/priority_test.cc
@@ -1,7 +1,7 @@
#include <config.h>
#include <apt-pkg/pkgcache.h>
-#include <string>
#include <gtest/gtest.h>
+#include <string>
using std::string;
diff --git a/test/libapt/sourcelist_test.cc b/test/libapt/sourcelist_test.cc
index 83c441092..6182639a4 100644
--- a/test/libapt/sourcelist_test.cc
+++ b/test/libapt/sourcelist_test.cc
@@ -1,7 +1,7 @@
#include <config.h>
-#include <apt-pkg/sourcelist.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/sourcelist.h>
#include <string>
#include <stdlib.h>
diff --git a/test/libapt/strutil_test.cc b/test/libapt/strutil_test.cc
index d7700bd54..9c192a58b 100644
--- a/test/libapt/strutil_test.cc
+++ b/test/libapt/strutil_test.cc
@@ -1,6 +1,6 @@
#include <config.h>
-#include <apt-pkg/strutl.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/strutl.h>
#include <string>
#include <vector>
diff --git a/test/libapt/tagfile_test.cc b/test/libapt/tagfile_test.cc
index 24fbd389e..fb85ebcad 100644
--- a/test/libapt/tagfile_test.cc
+++ b/test/libapt/tagfile_test.cc
@@ -3,11 +3,11 @@
#include <apt-pkg/fileutl.h>
#include <apt-pkg/tagfile.h>
+#include <sstream>
#include <string>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <sstream>
#include <gtest/gtest.h>
diff --git a/test/libapt/tagsection_test.cc b/test/libapt/tagsection_test.cc
index 779932595..d79b1b63d 100644
--- a/test/libapt/tagsection_test.cc
+++ b/test/libapt/tagsection_test.cc
@@ -3,8 +3,8 @@
#include <apt-pkg/fileutl.h>
#include <apt-pkg/tagfile.h>
-#include <string>
#include <sstream>
+#include <string>
#include <gtest/gtest.h>
diff --git a/test/libapt/teestream_test.cc b/test/libapt/teestream_test.cc
index 18610b24d..a897e08ec 100644
--- a/test/libapt/teestream_test.cc
+++ b/test/libapt/teestream_test.cc
@@ -1,9 +1,9 @@
#include <config.h>
-#include <string>
-#include <sstream>
-#include <fstream>
#include "../interactive-helper/teestream.h"
+#include <fstream>
+#include <sstream>
+#include <string>
#include <gtest/gtest.h>
diff --git a/test/libapt/uri_test.cc b/test/libapt/uri_test.cc
index 09d018049..54f4f84f8 100644
--- a/test/libapt/uri_test.cc
+++ b/test/libapt/uri_test.cc
@@ -2,8 +2,8 @@
#include <apt-pkg/configuration.h>
#include <apt-pkg/proxy.h>
#include <apt-pkg/strutl.h>
-#include <string>
#include <gtest/gtest.h>
+#include <string>
TEST(URITest, BasicHTTP)
{