summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2017-07-12 15:25:00 +0200
committerJulian Andres Klode <jak@debian.org>2017-07-12 15:25:00 +0200
commit11f92b12dbd029fa93618bc5f23cba18e794a132 (patch)
tree9167ac5ce93c1cd98be1f0dd59a3f6db3fc0f86b /apt-pkg
parent46e1aa6afd4239e263ce52525c09eb004b67405f (diff)
parent51da6127d0073c9fc81f4b220f2360bd612ded5c (diff)
Merge branch 'misc/include-cleanup'
This should make it easier to read includes.
Diffstat (limited to 'apt-pkg')
-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
112 files changed, 518 insertions, 560 deletions
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>