summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-01-30 17:05:29 +0200
committerPanu Matilainen <pmatilai@redhat.com>2008-01-30 17:05:29 +0200
commiteb5dc35c196c2b18e934a046627ee59d54e175d6 (patch)
tree8c1eac42d934698687b7e38e74b6e2dca3548bca
parentd2efb5d77c0a3a2f5919d40efe5e163254422b6f (diff)
downloadrpm-eb5dc35c196c2b18e934a046627ee59d54e175d6.tar.gz
rpm-eb5dc35c196c2b18e934a046627ee59d54e175d6.tar.bz2
rpm-eb5dc35c196c2b18e934a046627ee59d54e175d6.zip
Include spring-cleaning
- put some consistency into include ordering - everything (apart from bits missed ;) is now ordered like this 1. "system.h" 2. other system includes 3. rpm public headers 4. rpm private headers 5. "debug.h"
-rw-r--r--build.c2
-rw-r--r--build/files.c18
-rw-r--r--build/pack.c14
-rw-r--r--build/parseScript.c4
-rw-r--r--build/poptBT.c2
-rw-r--r--build/rpmfc.c17
-rw-r--r--build/spec.c3
-rw-r--r--lib/cpio.c2
-rw-r--r--lib/depends.c4
-rw-r--r--lib/formats.c4
-rw-r--r--lib/fs.c2
-rw-r--r--lib/fsm.c14
-rw-r--r--lib/idtx.c2
-rw-r--r--lib/legacy.c2
-rw-r--r--lib/manifest.c3
-rw-r--r--lib/misc.c2
-rw-r--r--lib/package.c11
-rw-r--r--lib/psm.c18
-rw-r--r--lib/query.c7
-rw-r--r--lib/rpmchecksig.c9
-rw-r--r--lib/rpmds.c1
-rw-r--r--lib/rpmfi.c16
-rw-r--r--lib/rpmgi.c8
-rw-r--r--lib/rpminstall.c1
-rw-r--r--lib/rpmlead.c4
-rw-r--r--lib/rpmlib.h3
-rw-r--r--lib/rpmlock.c2
-rw-r--r--lib/rpmrc.c5
-rw-r--r--lib/rpmte.c2
-rw-r--r--lib/rpmts.c4
-rw-r--r--lib/rpmts_internal.h3
-rw-r--r--lib/signature.c8
-rw-r--r--lib/tgi.c5
-rw-r--r--lib/tplatform.c5
-rw-r--r--lib/transaction.c19
-rw-r--r--lib/tsystem.c2
-rw-r--r--lib/tthread.c1
-rw-r--r--lib/verify.c6
-rw-r--r--python/header-py.c3
-rw-r--r--python/rpmal-py.c1
-rw-r--r--python/rpmdb-py.c1
-rw-r--r--python/rpmfi-py.c1
-rw-r--r--python/rpmmacro-py.c5
-rw-r--r--python/rpmps-py.c1
-rw-r--r--python/rpmte-py.c1
-rw-r--r--rpmdb/db3.c2
-rw-r--r--rpmdb/fprint.c2
-rw-r--r--rpmdb/fprint.h2
-rw-r--r--rpmdb/header_internal.h4
-rw-r--r--rpmdb/rpmdb.c4
-rw-r--r--rpmdb/rpmdb_internal.h2
-rw-r--r--rpmdb/sqlite.c6
-rw-r--r--rpmio/base64.c2
-rw-r--r--rpmio/digest.c2
-rw-r--r--rpmio/digest.h7
-rw-r--r--rpmio/macro.c3
-rw-r--r--rpmio/rpmfileutil.c5
-rw-r--r--rpmio/rpmhook.c2
-rw-r--r--rpmio/rpmio.c6
-rw-r--r--rpmio/rpmlua.c12
-rw-r--r--rpmio/rpmpgp.c5
-rw-r--r--rpmio/tax.c3
-rw-r--r--rpmio/tdir.c5
-rw-r--r--rpmio/tfts.c7
-rw-r--r--rpmio/tget.c4
-rw-r--r--rpmio/tglob.c4
-rw-r--r--rpmio/thkp.c4
-rw-r--r--rpmio/tput.c4
-rw-r--r--rpmio/tring.c2
-rw-r--r--rpmio/tufdio.c5
-rw-r--r--rpmqv.c3
-rw-r--r--tools/convertdb1.c3
-rw-r--r--tools/rpmcache.c2
-rw-r--r--tools/rpminject.c7
-rw-r--r--tools/rpmsort.c3
75 files changed, 186 insertions, 184 deletions
diff --git a/build.c b/build.c
index 679fa4594..1cf6aecaa 100644
--- a/build.c
+++ b/build.c
@@ -13,9 +13,9 @@
#include <rpm/rpmte.h>
#include <rpm/rpmts.h>
#include <rpm/rpmfileutil.h>
+#include <rpm/rpmlog.h>
#include "build.h"
-#include <rpm/rpmlog.h>
#include "debug.h"
/**
diff --git a/build/files.c b/build/files.c
index cb558791f..23f9e8c2b 100644
--- a/build/files.c
+++ b/build/files.c
@@ -10,25 +10,21 @@
#include <regex.h>
-#include <rpm/rpmpgp.h>
-#include "rpmio/rpmio_internal.h" /* XXX rpmioSlurp */
-#include "rpmio/fts.h"
-
#include <rpm/rpmbuild.h>
-
-#include "lib/cpio.h"
-
+#include <rpm/rpmpgp.h>
#include <rpm/argv.h>
#include <rpm/rpmfc.h>
+#include <rpm/rpmfileutil.h> /* rpmDoDigest() */
+#include <rpm/rpmlog.h>
+#include "rpmio/rpmio_internal.h" /* XXX rpmioSlurp */
+#include "rpmio/fts.h"
+#include "lib/cpio.h"
#include "lib/rpmfi_internal.h" /* XXX pretty much all rpmfi internals... */
#include "lib/rpmte_internal.h" /* XXX rpmte init */
-
+#include "lib/legacy.h" /* XXX expandFileList, compressFileList */
#include "build/buildio.h"
-#include <rpm/rpmfileutil.h> /* rpmDoDigest() */
-#include "lib/legacy.h" /* XXX expandFileList, compressFileList */
-#include <rpm/rpmlog.h>
#include "debug.h"
#define SKIPSPACE(s) { while (*(s) && xisspace(*(s))) (s)++; }
diff --git a/build/pack.c b/build/pack.c
index a582a9ff8..ae09c27fe 100644
--- a/build/pack.c
+++ b/build/pack.c
@@ -6,22 +6,20 @@
#include "system.h"
#include <rpm/rpmlib.h> /* RPMSIGTAG*, rpmReadPackageFile */
-#include "rpmio/rpmio_internal.h" /* fdInitDigest, fdFiniDigest */
+#include <rpm/rpmts.h>
#include <rpm/rpmbuild.h>
+#include <rpm/rpmfileutil.h>
+#include <rpm/rpmlog.h>
+#include "rpmio/rpmio_internal.h" /* fdInitDigest, fdFiniDigest */
#include "lib/cpio.h"
#include "lib/fsm.h"
-
#include "lib/rpmfi_internal.h" /* XXX fi->fsm */
-#include <rpm/rpmts.h>
-
-#include "build/buildio.h"
-
#include "lib/legacy.h" /* XXX providePackageNVR */
#include "lib/signature.h"
#include "lib/rpmlead.h"
-#include <rpm/rpmfileutil.h>
-#include <rpm/rpmlog.h>
+#include "build/buildio.h"
+
#include "debug.h"
/**
diff --git a/build/parseScript.c b/build/parseScript.c
index 90faf1e8a..d70c213db 100644
--- a/build/parseScript.c
+++ b/build/parseScript.c
@@ -8,10 +8,12 @@
#include <rpm/rpmtag.h>
#include <rpm/rpmbuild.h>
#include <rpm/rpmlog.h>
-#include "debug.h"
#include "rpmio/rpmlua.h"
+#include "debug.h"
+
+
/**
*/
static int addTriggerIndex(Package pkg, const char *file,
diff --git a/build/poptBT.c b/build/poptBT.c
index f3cf27616..e0d2453b1 100644
--- a/build/poptBT.c
+++ b/build/poptBT.c
@@ -6,8 +6,8 @@
#include "system.h"
#include <rpm/rpmbuild.h>
-
#include <rpm/rpmlog.h>
+
#include "debug.h"
struct rpmBuildArguments_s rpmBTArgs;
diff --git a/build/rpmfc.c b/build/rpmfc.c
index 7b1c28e26..5b28b4446 100644
--- a/build/rpmfc.c
+++ b/build/rpmfc.c
@@ -1,6 +1,14 @@
#include "system.h"
#include <signal.h>
+#if HAVE_GELF_H
+#include <gelf.h>
+
+#if !defined(DT_GNU_HASH)
+#define DT_GNU_HASH 0x6ffffef5
+#endif
+
+#endif
#include <rpm/rpmtag.h>
#include <rpm/rpmbuild.h>
@@ -12,15 +20,6 @@
#include <rpm/rpmds.h>
#include <rpm/rpmfi.h>
-#if HAVE_GELF_H
-#include <gelf.h>
-
-#if !defined(DT_GNU_HASH)
-#define DT_GNU_HASH 0x6ffffef5
-#endif
-
-#endif
-
#include "debug.h"
/**
diff --git a/build/spec.c b/build/spec.c
index b168942ba..ebd46c91d 100644
--- a/build/spec.c
+++ b/build/spec.c
@@ -5,7 +5,6 @@
#include "system.h"
-#include "build/buildio.h"
#include <rpm/rpmtag.h>
#include <rpm/rpmds.h>
#include <rpm/rpmfi.h>
@@ -13,6 +12,8 @@
#include <rpm/rpmlog.h>
#include <rpm/rpmfileutil.h>
+#include "build/buildio.h"
+
#include "debug.h"
extern int specedit;
diff --git a/lib/cpio.c b/lib/cpio.c
index ab39a22c4..79d297ef0 100644
--- a/lib/cpio.c
+++ b/lib/cpio.c
@@ -10,11 +10,11 @@
#include "system.h"
#include <rpm/rpmio.h>
+#include <rpm/rpmlog.h>
#include "lib/cpio.h"
#include "lib/fsm.h"
-#include <rpm/rpmlog.h>
#include "debug.h"
diff --git a/lib/depends.c b/lib/depends.c
index 5c345bff4..89cb3cfcd 100644
--- a/lib/depends.c
+++ b/lib/depends.c
@@ -10,13 +10,11 @@
#include <rpm/rpmtag.h>
#include <rpm/rpmmacro.h> /* XXX rpmExpand("%{_dependency_whiteout}" */
#include <rpm/rpmlog.h>
-
#include <rpm/rpmdb.h>
-#include "rpmdb/rpmdb_internal.h" /* XXX response cache needs dbiOpen et al. */
-
#include <rpm/rpmds.h>
#include <rpm/rpmfi.h>
+#include "rpmdb/rpmdb_internal.h" /* XXX response cache needs dbiOpen et al. */
#include "lib/rpmte_internal.h" /* XXX tsortInfo_s */
#include "lib/rpmts_internal.h"
diff --git a/lib/formats.c b/lib/formats.c
index 98eee4553..545562a7a 100644
--- a/lib/formats.c
+++ b/lib/formats.c
@@ -3,14 +3,14 @@
*/
#include "system.h"
-#include "rpmio/digest.h"
+
#include <rpm/rpmtag.h>
#include <rpm/rpmlib.h> /* rpmGetFilesystem*() */
#include <rpm/rpmds.h>
#include <rpm/rpmmacro.h> /* XXX for %_i18ndomains */
-
#include <rpm/rpmfi.h>
+#include "rpmio/digest.h"
#include "lib/manifest.h"
#include "debug.h"
diff --git a/lib/fs.c b/lib/fs.c
index 1663ee252..05a16dd88 100644
--- a/lib/fs.c
+++ b/lib/fs.c
@@ -3,9 +3,11 @@
*/
#include "system.h"
+
#include <rpm/rpmlib.h> /* rpmGetFilesystem*() prototypes */
#include <rpm/rpmfileutil.h> /* for rpmGetPath */
#include <rpm/rpmlog.h>
+
#include "debug.h"
diff --git a/lib/fsm.c b/lib/fsm.c
index 7f51659c4..192d344aa 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -5,20 +5,16 @@
#include "system.h"
-#include "rpmio/rpmio_internal.h" /* fdGet/SetCpioPos, fdInit/FiniDigest */
+#include <rpm/rpmte.h>
+#include <rpm/rpmts.h>
+#include <rpm/rpmsq.h>
+#include <rpm/rpmlog.h>
+#include "rpmio/rpmio_internal.h" /* fdGet/SetCpioPos, fdInit/FiniDigest */
#include "lib/cpio.h"
-
#include "lib/fsm.h"
#define fsmUNSAFE fsmStage
-
-#include <rpm/rpmlog.h>
-
#include "lib/rpmfi_internal.h" /* XXX fi->apath, fi->action... */
-#include <rpm/rpmte.h>
-#include <rpm/rpmts.h>
-#include <rpm/rpmsq.h>
-
#include "rpmio/ugid.h" /* XXX unameToUid() and gnameToGid() */
#include "debug.h"
diff --git a/lib/idtx.c b/lib/idtx.c
index 7e9c68164..8a9f5c1ce 100644
--- a/lib/idtx.c
+++ b/lib/idtx.c
@@ -8,6 +8,8 @@
#include <rpm/rpmfileutil.h>
#include <rpm/rpmlog.h>
+#include "debug.h"
+
static int reverse = -1;
/**
diff --git a/lib/legacy.c b/lib/legacy.c
index dda035b34..18af33d03 100644
--- a/lib/legacy.c
+++ b/lib/legacy.c
@@ -9,7 +9,9 @@
#include <rpm/rpmstring.h>
#include <rpm/rpmfi.h>
#include <rpm/rpmds.h>
+
#include "lib/legacy.h"
+
#include "debug.h"
#define alloca_strdup(_s) strcpy(alloca(strlen(_s)+1), (_s))
diff --git a/lib/manifest.c b/lib/manifest.c
index 7e5d1964b..69f39db60 100644
--- a/lib/manifest.c
+++ b/lib/manifest.c
@@ -6,9 +6,10 @@
#include <rpm/rpmlog.h>
#include <rpm/rpmfileutil.h>
-
#include <rpm/rpmstring.h>
+
#include "lib/manifest.h"
+
#include "debug.h"
diff --git a/lib/misc.c b/lib/misc.c
index 2a8abfd35..786e5b276 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -10,7 +10,9 @@ const char * RPMVERSION = VERSION;
#include <rpm/rpmurl.h>
#include <rpm/rpmmacro.h> /* XXX for rpmGetPath */
#include <rpm/rpmlog.h>
+
#include "lib/misc.h"
+
#include "debug.h"
rpmRC rpmMkdirPath (const char * dpath, const char * dname)
diff --git a/lib/package.c b/lib/package.c
index 1e316531e..8ae7d339f 100644
--- a/lib/package.c
+++ b/lib/package.c
@@ -6,18 +6,17 @@
#include <netinet/in.h>
-#include "rpmio/digest.h"
-#include "rpmio/rpmio_internal.h" /* fd*Digest(), fd stats */
-
#include <rpm/rpmlib.h> /* XXX RPMSIGTAG, other sig stuff */
#include <rpm/rpmts.h>
+#include <rpm/rpmlog.h>
#include "lib/legacy.h" /* XXX legacyRetrofit() */
#include "lib/rpmlead.h"
-
-#include <rpm/rpmlog.h>
-#include "rpmdb/header_internal.h" /* XXX headerCheck */
#include "lib/signature.h"
+#include "rpmio/digest.h"
+#include "rpmio/rpmio_internal.h" /* fd*Digest(), fd stats */
+#include "rpmdb/header_internal.h" /* XXX headerCheck */
+
#include "debug.h"
#define alloca_strdup(_s) strcpy(alloca(strlen(_s)+1), (_s))
diff --git a/lib/psm.c b/lib/psm.c
index c4c825b3b..e88106cbd 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -8,27 +8,23 @@
#include <rpm/rpmlib.h> /* rpmvercmp and others */
#include <rpm/rpmmacro.h>
#include <rpm/rpmurl.h>
-#include "rpmio/rpmlua.h"
+#include <rpm/rpmds.h>
+#include <rpm/rpmts.h>
+#include <rpm/rpmfileutil.h> /* rpmMkTempFile() */
+#include <rpm/rpmdb.h> /* XXX for db_chrootDone */
+#include <rpm/rpmlog.h>
+#include "rpmio/rpmlua.h"
#include "lib/cpio.h"
#include "lib/fsm.h" /* XXX CPIO_FOO/FSM_FOO constants */
#include "lib/psm.h"
-
-#include <rpm/rpmds.h>
-
#include "lib/rpmfi_internal.h" /* XXX replaced/states, fi->hge, fi->te... */
-
#include "lib/rpmte_internal.h" /* XXX te->fd */
-
#include "lib/rpmtsscore.h"
-#include <rpm/rpmts.h>
-
#include "lib/rpmlead.h" /* writeLead proto */
#include "lib/signature.h" /* signature constants */
-#include <rpm/rpmfileutil.h> /* rpmMkTempFile() */
#include "lib/misc.h" /* XXX rpmMkdirPath, doputenv */
-#include <rpm/rpmdb.h> /* XXX for db_chrootDone */
-#include <rpm/rpmlog.h>
+
#include "debug.h"
#define _PSM_DEBUG 0
diff --git a/lib/query.c b/lib/query.c
index 020b307cb..c36207ca2 100644
--- a/lib/query.c
+++ b/lib/query.c
@@ -14,17 +14,16 @@
#include <rpm/rpmtag.h>
#include <rpm/rpmdb.h>
#include <rpm/rpmfi.h>
-
#include <rpm/rpmgi.h>
#include <rpm/rpmts.h>
-
-#include "lib/manifest.h"
#include <rpm/rpmlog.h>
#include <rpm/rpmfileutil.h> /* rpmCleanPath */
-#include "debug.h"
+#include "lib/manifest.h"
#include "lib/misc.h" /* XXX for currentDirectory */
+#include "debug.h"
+
/**
*/
diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c
index 3f47ab4ed..61cfaa6c5 100644
--- a/lib/rpmchecksig.c
+++ b/lib/rpmchecksig.c
@@ -7,17 +7,16 @@
#include <rpm/rpmlib.h> /* RPMSIGTAG & related */
#include <rpm/rpmpgp.h>
-#include "rpmio/rpmio_internal.h" /* for fd*Digest() */
#include <rpm/rpmcli.h>
-
+#include <rpm/rpmfileutil.h> /* rpmMkTempFile() */
#include <rpm/rpmdb.h>
-
#include <rpm/rpmts.h>
-
#include <rpm/rpmlog.h>
+
+#include "rpmio/rpmio_internal.h" /* for fd*Digest() */
#include "lib/rpmlead.h"
#include "lib/signature.h"
-#include <rpm/rpmfileutil.h> /* rpmMkTempFile() */
+
#include "debug.h"
int _print_pkts = 0;
diff --git a/lib/rpmds.c b/lib/rpmds.c
index 69781c233..0d79e981f 100644
--- a/lib/rpmds.c
+++ b/lib/rpmds.c
@@ -7,7 +7,6 @@
#include <rpm/rpmlib.h> /* rpmvercmp */
#include <rpm/rpmstring.h>
#include <rpm/rpmlog.h>
-
#include <rpm/rpmds.h>
#include "debug.h"
diff --git a/lib/rpmfi.c b/lib/rpmfi.c
index 6c5d78699..5ad0053bf 100644
--- a/lib/rpmfi.c
+++ b/lib/rpmfi.c
@@ -6,20 +6,16 @@
#include "system.h"
#include <rpm/rpmlog.h>
-
-#include "lib/cpio.h" /* XXX CPIO_FOO */
-#include "lib/fsm.h" /* XXX newFSM() */
-
-#include <rpm/rpmds.h>
-
-#include "lib/rpmfi_internal.h"
-
-#include "lib/rpmte_internal.h" /* relocations */
#include <rpm/rpmts.h>
-
#include <rpm/rpmfileutil.h>/* XXX domd5 */
#include <rpm/rpmstring.h>
#include <rpm/rpmmacro.h> /* XXX rpmCleanPath */
+#include <rpm/rpmds.h>
+
+#include "lib/rpmfi_internal.h"
+#include "lib/rpmte_internal.h" /* relocations */
+#include "lib/cpio.h" /* XXX CPIO_FOO */
+#include "lib/fsm.h" /* XXX newFSM() */
#include "debug.h"
diff --git a/lib/rpmgi.c b/lib/rpmgi.c
index 49e8bc544..7aa5a9ba7 100644
--- a/lib/rpmgi.c
+++ b/lib/rpmgi.c
@@ -7,18 +7,16 @@
#include <rpm/rpmlib.h> /* rpmReadPackageFile */
#include <rpm/rpmte.h> /* XXX rpmElementType */
#include <rpm/rpmts.h>
-
#include <rpm/rpmgi.h>
-#include "rpmio/fts.h"
-
#include <rpm/rpmdb.h>
#include <rpm/rpmmacro.h> /* XXX rpmExpand */
#include <rpm/rpmfileutil.h>
-#include "lib/manifest.h"
#include <rpm/rpmlog.h>
-#include "debug.h"
+#include "rpmio/fts.h"
+#include "lib/manifest.h"
+#include "debug.h"
int _rpmgi_debug = 0;
diff --git a/lib/rpminstall.c b/lib/rpminstall.c
index 02c6a5061..e0176344c 100644
--- a/lib/rpminstall.c
+++ b/lib/rpminstall.c
@@ -5,7 +5,6 @@
#include "system.h"
#include <rpm/rpmcli.h>
-
#include <rpm/rpmtag.h>
#include <rpm/rpmlib.h> /* rpmReadPackageFile, vercmp etc */
#include <rpm/rpmdb.h>
diff --git a/lib/rpmlead.c b/lib/rpmlead.c
index 04503cd86..26ae350df 100644
--- a/lib/rpmlead.c
+++ b/lib/rpmlead.c
@@ -7,10 +7,12 @@
#include <netinet/in.h>
#include <rpm/rpmlib.h> /* rpmGetOs/ArchInfo() */
+#include <rpm/rpmlog.h>
+
#include "lib/signature.h"
#include "lib/rpmlead.h"
#include "lib/legacy.h"
-#include <rpm/rpmlog.h>
+
#include "debug.h"
static unsigned char lead_magic[] = {
diff --git a/lib/rpmlib.h b/lib/rpmlib.h
index c948a3f1e..45aee0c33 100644
--- a/lib/rpmlib.h
+++ b/lib/rpmlib.h
@@ -8,11 +8,12 @@
*
*/
+#include <popt.h>
+
#include <rpm/rpmio.h>
#include <rpm/header.h>
#include <rpm/rpmtag.h>
#include <rpm/rpmds.h> /* XXX move rpmlib provides to rpmds instead */
-#include <popt.h>
#ifdef __cplusplus
extern "C" {
diff --git a/lib/rpmlock.c b/lib/rpmlock.c
index deeaae0b6..d898af641 100644
--- a/lib/rpmlock.c
+++ b/lib/rpmlock.c
@@ -4,8 +4,8 @@
#include <rpm/rpmlog.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmfileutil.h>
-
#include <rpm/rpmts.h>
+
#include "lib/rpmlock.h"
#include "debug.h"
diff --git a/lib/rpmrc.c b/lib/rpmrc.c
index 2e5b5a937..76aa4137c 100644
--- a/lib/rpmrc.c
+++ b/lib/rpmrc.c
@@ -14,13 +14,14 @@
#endif
#include <rpm/rpmlib.h> /* RPM_MACTABLE*, Rc-prototypes */
-#include "rpmio/rpmio_internal.h" /* XXX for rpmioSlurp */
#include <rpm/rpmmacro.h>
#include <rpm/rpmfileutil.h>
#include <rpm/rpmstring.h>
+#include <rpm/rpmlog.h>
+
#include "rpmio/rpmlua.h"
+#include "rpmio/rpmio_internal.h" /* XXX for rpmioSlurp */
-#include <rpm/rpmlog.h>
#include "debug.h"
static const char *defrcfiles =
diff --git a/lib/rpmte.c b/lib/rpmte.c
index 552cce955..05ea8b943 100644
--- a/lib/rpmte.c
+++ b/lib/rpmte.c
@@ -8,9 +8,9 @@
#include <rpm/rpmlib.h> /* RPM_MACHTABLE_* */
#include <rpm/rpmds.h>
#include <rpm/rpmfi.h>
+#include <rpm/rpmts.h>
#include "lib/rpmte_internal.h"
-#include <rpm/rpmts.h>
#include "debug.h"
diff --git a/lib/rpmts.c b/lib/rpmts.c
index 786ece15c..a4ba78dbb 100644
--- a/lib/rpmts.c
+++ b/lib/rpmts.c
@@ -13,15 +13,13 @@
#include <rpm/rpmstring.h>
#include <rpm/rpmdb.h>
-
#include <rpm/rpmal.h>
#include <rpm/rpmds.h>
#include <rpm/rpmfi.h>
-#include "lib/rpmlock.h"
#include <rpm/rpmlog.h>
-
#include <rpm/rpmte.h>
+#include "lib/rpmlock.h"
#include "lib/rpmts_internal.h"
/* XXX FIXME: merge with existing (broken?) tests in system.h */
diff --git a/lib/rpmts_internal.h b/lib/rpmts_internal.h
index 0e0ad6d79..0af9f0f3f 100644
--- a/lib/rpmts_internal.h
+++ b/lib/rpmts_internal.h
@@ -2,8 +2,9 @@
#define _RPMTS_INTERNAL_H
#include <rpm/rpmts.h>
-#include "rpmdb/rpmhash.h" /* XXX hashTable */
#include <rpm/rpmal.h> /* XXX availablePackage/relocateFileList ,*/
+
+#include "rpmdb/rpmhash.h" /* XXX hashTable */
#include "lib/rpmtsscore.h" /* for rpmtsScore */
extern int _cacheDependsRC;
diff --git a/lib/signature.c b/lib/signature.c
index ab633760a..5fa24a71a 100644
--- a/lib/signature.c
+++ b/lib/signature.c
@@ -6,21 +6,21 @@
#include <popt.h>
-#include "rpmio/digest.h"
#include <rpm/rpmtag.h>
#include <rpm/rpmlib.h> /* XXX RPMSIGTAG* & related */
#include <rpm/rpmmacro.h> /* XXX for rpmGetPath() */
#include <rpm/rpmdb.h>
#include <rpm/rpmstring.h>
-
+#include <rpm/rpmfileutil.h>
+#include <rpm/rpmlog.h>
#include <rpm/rpmts.h>
-#include <rpm/rpmlog.h>
+#include "rpmio/digest.h"
#include "lib/misc.h" /* XXX for dosetenv() */
-#include <rpm/rpmfileutil.h>
#include "lib/rpmlead.h"
#include "lib/signature.h"
#include "rpmdb/header_internal.h"
+
#include "debug.h"
#if !defined(__GLIBC__) && !defined(__APPLE__)
diff --git a/lib/tgi.c b/lib/tgi.c
index 17c8c5e46..fb52dd9b3 100644
--- a/lib/tgi.c
+++ b/lib/tgi.c
@@ -1,13 +1,12 @@
#include "system.h"
+#include <popt.h>
+
#include <rpm/rpmtag.h>
#include <rpm/rpmgi.h>
#include <rpm/rpmcli.h>
-
#include <rpm/rpmte.h>
-
#include <rpm/rpmmacro.h>
-#include <popt.h>
#include "debug.h"
diff --git a/lib/tplatform.c b/lib/tplatform.c
index f7383cc23..905f0a66f 100644
--- a/lib/tplatform.c
+++ b/lib/tplatform.c
@@ -1,9 +1,12 @@
#include "system.h"
-#include "rpmio/rpmio_internal.h" /* XXX rpmioSlurp */
#include <rpm/rpmmacro.h>
#include <rpm/rpmio.h>
+#include "rpmio/rpmio_internal.h" /* XXX rpmioSlurp */
+
+#include "debug.h"
+
#define _ETC_RPM_PLATFORM "/etc/rpm/platform"
static const char * platform = _ETC_RPM_PLATFORM;
diff --git a/lib/transaction.c b/lib/transaction.c
index 4d0987596..420457c00 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -7,31 +7,24 @@
#include <rpm/rpmlib.h> /* rpmMachineScore, rpmReadPackageFile */
#include <rpm/rpmmacro.h> /* XXX for rpmExpand */
#include <rpm/rpmlog.h>
-
-#include "lib/psm.h"
-
#include <rpm/rpmdb.h>
-#include "rpmdb/rpmdb_internal.h" /* XXX for dbiIndexSetCount */
-
#include <rpm/rpmds.h>
+#include <rpm/idtx.h>
+#include <rpm/rpmfileutil.h>
+#include <rpm/rpmstring.h>
+#include "rpmdb/rpmdb_internal.h" /* XXX for dbiIndexSetCount */
+#include "rpmdb/fprint.h"
+#include "lib/psm.h"
#include "lib/rpmlock.h"
-
#include "lib/rpmfi_internal.h" /* fi->replaced, fi->actions... */
-
#include "lib/rpmte_internal.h" /* XXX te->h, te->fd, te->h */
-
#include "lib/rpmts_internal.h"
-
#include "lib/cpio.h"
-#include "rpmdb/fprint.h"
-#include <rpm/rpmfileutil.h>
-#include <rpm/rpmstring.h>
#include "lib/misc.h" /* currentDirectory */
#include "debug.h"
-#include <rpm/idtx.h>
/**
*/
diff --git a/lib/tsystem.c b/lib/tsystem.c
index f96f80a1d..5c7057d07 100644
--- a/lib/tsystem.c
+++ b/lib/tsystem.c
@@ -1,9 +1,9 @@
#include "system.h"
#include <pthread.h>
+#include <popt.h>
#include <rpm/rpmsq.h>
-#include <popt.h>
#include "debug.h"
diff --git a/lib/tthread.c b/lib/tthread.c
index b6a620bc4..bae934e2b 100644
--- a/lib/tthread.c
+++ b/lib/tthread.c
@@ -2,6 +2,7 @@
#include <pthread.h>
#include <assert.h>
+
#include <rpm/rpmlib.h> /* rpmReadConfigFiles, rpmReadPackageFile */
#include <rpm/rpmts.h>
#include <rpm/rpmsq.h> /* XXX for _rpmsq_debug */
diff --git a/lib/verify.c b/lib/verify.c
index dff482c09..5616f9d2a 100644
--- a/lib/verify.c
+++ b/lib/verify.c
@@ -8,13 +8,13 @@
#include <rpm/rpmcli.h>
#include <rpm/rpmtag.h>
#include <rpm/rpmlog.h>
-
-#include "lib/psm.h"
#include <rpm/rpmfi.h>
#include <rpm/rpmts.h>
-
#include <rpm/rpmfileutil.h>
+
+#include "lib/psm.h"
#include "rpmio/ugid.h" /* uidToUname(), gnameToGid */
+
#include "debug.h"
#define S_ISDEV(m) (S_ISBLK((m)) || S_ISCHR((m)))
diff --git a/python/header-py.c b/python/header-py.c
index 4e747bacf..c39d43269 100644
--- a/python/header-py.c
+++ b/python/header-py.c
@@ -7,11 +7,10 @@
#include <rpm/rpmlib.h> /* rpmvercmp */
#include <rpm/rpmtag.h>
#include <rpm/rpmstring.h>
+#include <rpm/rpmts.h> /* XXX rpmtsCreate/rpmtsFree */
#include "lib/legacy.h" /* XXX expand/compressFilelist(), providePackageNVR() */
-#include <rpm/rpmts.h> /* XXX rpmtsCreate/rpmtsFree */
-
#include "header-py.h"
#include "rpmds-py.h"
#include "rpmfi-py.h"
diff --git a/python/rpmal-py.c b/python/rpmal-py.c
index 38ecfcd54..6a125d3f0 100644
--- a/python/rpmal-py.c
+++ b/python/rpmal-py.c
@@ -4,7 +4,6 @@
#include "system.h"
-
#include "rpmal-py.h"
#include "rpmds-py.h"
#include "rpmfi-py.h"
diff --git a/python/rpmdb-py.c b/python/rpmdb-py.c
index 945e41865..c6d6ccbaf 100644
--- a/python/rpmdb-py.c
+++ b/python/rpmdb-py.c
@@ -5,6 +5,7 @@
#include "system.h"
#include <rpm/rpmtag.h>
+
#include "rpmdb-py.h"
#include "rpmmi-py.h"
#include "header-py.h"
diff --git a/python/rpmfi-py.c b/python/rpmfi-py.c
index fc8271917..731deb5ff 100644
--- a/python/rpmfi-py.c
+++ b/python/rpmfi-py.c
@@ -5,6 +5,7 @@
#include "system.h"
#include <rpm/rpmtag.h>
+
#include "header-py.h"
#include "rpmfi-py.h"
diff --git a/python/rpmmacro-py.c b/python/rpmmacro-py.c
index 9e58ef277..cc4965aa0 100644
--- a/python/rpmmacro-py.c
+++ b/python/rpmmacro-py.c
@@ -4,11 +4,12 @@
#include "system.h"
-#include "structmember.h"
+#include <structmember.h>
-#include "rpmmacro-py.h"
#include <rpm/rpmmacro.h>
+#include "rpmmacro-py.h"
+
#include "debug.h"
/**
diff --git a/python/rpmps-py.c b/python/rpmps-py.c
index 4d880d3f4..1914c6c6b 100644
--- a/python/rpmps-py.c
+++ b/python/rpmps-py.c
@@ -4,7 +4,6 @@
#include "system.h"
-
#include "rpmps-py.h"
#include "debug.h"
diff --git a/python/rpmte-py.c b/python/rpmte-py.c
index 3e591a654..0ded63e7c 100644
--- a/python/rpmte-py.c
+++ b/python/rpmte-py.c
@@ -4,7 +4,6 @@
#include "system.h"
-
#include "header-py.h" /* XXX tagNumFromPyObject */
#include "rpmds-py.h"
#include "rpmfi-py.h"
diff --git a/rpmdb/db3.c b/rpmdb/db3.c
index 7cf70361a..8a6107ea8 100644
--- a/rpmdb/db3.c
+++ b/rpmdb/db3.c
@@ -14,9 +14,9 @@ static int _debug = 1; /* XXX if < 0 debugging, > 0 unusual error returns */
#include <rpm/rpmmacro.h>
#include <rpm/rpmurl.h> /* XXX urlPath proto */
#include <rpm/rpmfileutil.h> /* rpmioMkPath */
+#include <rpm/rpmlog.h>
#include "rpmdb/rpmdb_internal.h"
-#include <rpm/rpmlog.h>
#include "debug.h"
diff --git a/rpmdb/fprint.c b/rpmdb/fprint.c
index fc9861d4d..0efdf4e39 100644
--- a/rpmdb/fprint.c
+++ b/rpmdb/fprint.c
@@ -4,9 +4,9 @@
#include "system.h"
-#include "rpmdb/rpmdb_internal.h"
#include <rpm/rpmfileutil.h> /* for rpmCleanPath */
+#include "rpmdb/rpmdb_internal.h"
#include "rpmdb/fprint.h"
#include "debug.h"
diff --git a/rpmdb/fprint.h b/rpmdb/fprint.h
index 078d010dc..3e478fbbe 100644
--- a/rpmdb/fprint.h
+++ b/rpmdb/fprint.h
@@ -6,8 +6,8 @@
* Identify a file name path by a unique "finger print".
*/
-#include "rpmdb/rpmhash.h"
#include <rpm/header.h>
+#include "rpmdb/rpmhash.h"
/**
*/
diff --git a/rpmdb/header_internal.h b/rpmdb/header_internal.h
index ece9853fe..9d86c0b1b 100644
--- a/rpmdb/header_internal.h
+++ b/rpmdb/header_internal.h
@@ -5,11 +5,11 @@
* \file rpmdb/header_internal.h
*/
+#include <netinet/in.h>
+
#include <rpm/header.h>
#include "rpmdb/header_method.h"
-#include <netinet/in.h>
-
#define INDEX_MALLOC_SIZE 8
/*
diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c
index 92de1e94d..e564b4edf 100644
--- a/rpmdb/rpmdb.c
+++ b/rpmdb/rpmdb.c
@@ -23,10 +23,10 @@
#include <rpm/rpmstring.h>
#include <rpm/rpmfileutil.h>
#include <rpm/rpmds.h> /* XXX isInstallPreReq macro only */
-
#include <rpm/rpmlog.h>
-#include "rpmdb/rpmdb_internal.h"
#include <rpm/rpmdb.h>
+
+#include "rpmdb/rpmdb_internal.h"
#include "rpmdb/fprint.h"
#include "rpmdb/header_internal.h" /* XXX for HEADERFLAG_ALLOCATED */
#include "debug.h"
diff --git a/rpmdb/rpmdb_internal.h b/rpmdb/rpmdb_internal.h
index cf694dc97..3be263a9b 100644
--- a/rpmdb/rpmdb_internal.h
+++ b/rpmdb/rpmdb_internal.h
@@ -2,10 +2,10 @@
#define H_RPMDB_INTERNAL
#include <assert.h>
+#include <db.h>
#include <rpm/rpmsw.h>
#include <rpm/rpmtypes.h>
-#include <db.h>
/**
*/
diff --git a/rpmdb/sqlite.c b/rpmdb/sqlite.c
index 4574badf5..7f378190d 100644
--- a/rpmdb/sqlite.c
+++ b/rpmdb/sqlite.c
@@ -26,16 +26,16 @@
#include "system.h"
+#include <sqlite3.h>
+
#include <rpm/rpmtag.h>
#include <rpm/rpmlog.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmurl.h> /* XXX urlPath proto */
#include <rpm/rpmfileutil.h> /* rpmioMkpath */
-
-#include "rpmdb/rpmdb_internal.h"
#include <rpm/rpmdb.h>
-#include <sqlite3.h>
+#include "rpmdb/rpmdb_internal.h"
#include "debug.h"
diff --git a/rpmio/base64.c b/rpmio/base64.c
index 8daa16c12..6b006e166 100644
--- a/rpmio/base64.c
+++ b/rpmio/base64.c
@@ -3,8 +3,10 @@
#include <arpa/inet.h>
#include <stdlib.h>
+
#include "rpmio/base64.h"
+
static char base64_encode_value(char value_in)
{
static const char encoding[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
diff --git a/rpmio/digest.c b/rpmio/digest.c
index f804fffba..c8739a759 100644
--- a/rpmio/digest.c
+++ b/rpmio/digest.c
@@ -3,7 +3,9 @@
*/
#include "system.h"
+
#include "rpmio/digest.h"
+
#include "debug.h"
#ifdef SHA_DEBUG
diff --git a/rpmio/digest.h b/rpmio/digest.h
index c4dabb855..12fa4e322 100644
--- a/rpmio/digest.h
+++ b/rpmio/digest.h
@@ -1,14 +1,15 @@
#ifndef _RPMDIGEST_H
#define _RPMDIGEST_H
-#include "rpmio/base64.h"
-#include <rpm/rpmpgp.h>
-
#include <nss.h>
#include <sechash.h>
#include <keyhi.h>
#include <cryptohi.h>
+#include <rpm/rpmpgp.h>
+#include "rpmio/base64.h"
+
+
/** \ingroup rpmio
* Values parsed from OpenPGP signature/pubkey packet(s).
*/
diff --git a/rpmio/macro.c b/rpmio/macro.c
index ebf55c4a6..040b5a184 100644
--- a/rpmio/macro.c
+++ b/rpmio/macro.c
@@ -17,13 +17,12 @@
#include <rpm/rpmfileutil.h>
#include <rpm/rpmurl.h>
#include <rpm/rpmlog.h>
+#include <rpm/rpmmacro.h>
#ifdef WITH_LUA
#include "rpmio/rpmlua.h"
#endif
-#include <rpm/rpmmacro.h>
-
#include "debug.h"
/*! The structure used to store a macro. */
diff --git a/rpmio/rpmfileutil.c b/rpmio/rpmfileutil.c
index 9e141a524..d4cc5b629 100644
--- a/rpmio/rpmfileutil.c
+++ b/rpmio/rpmfileutil.c
@@ -13,13 +13,16 @@
#endif
-#include "rpmio/rpmio_internal.h"
#include <rpm/rpmfileutil.h>
#include <rpm/rpmurl.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmlog.h>
#include <rpm/argv.h>
+#include "rpmio/rpmio_internal.h"
+
+#include "debug.h"
+
static int open_dso(const char * path, pid_t * pidp, size_t *fsizep)
{
static const char * cmd = NULL;
diff --git a/rpmio/rpmhook.c b/rpmio/rpmhook.c
index 3d07d09e8..8e5f695a3 100644
--- a/rpmio/rpmhook.c
+++ b/rpmio/rpmhook.c
@@ -7,6 +7,8 @@
#include "rpmio/rpmhook.h"
+#include "debug.h"
+
#define RPMHOOK_TABLE_INITSIZE 256
#define RPMHOOK_BUCKET_INITSIZE 5
diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c
index 66aa6a8dc..6e30f89b6 100644
--- a/rpmio/rpmio.c
+++ b/rpmio/rpmio.c
@@ -21,14 +21,14 @@ extern int h_errno;
#define IPPORT_HTTP 80
#endif
-#include "rpmio/rpmio_internal.h"
-
-#include "rpmio/ugid.h"
#include <rpm/argv.h>
#include <rpm/rpmlog.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmfileutil.h>
+#include "rpmio/rpmio_internal.h"
+#include "rpmio/ugid.h"
+
#include "debug.h"
#define FDNREFS(fd) (fd ? ((FD_t)fd)->nrefs : -9)
diff --git a/rpmio/rpmlua.c b/rpmio/rpmlua.c
index a13e698d3..3dc3ea38c 100644
--- a/rpmio/rpmlua.c
+++ b/rpmio/rpmlua.c
@@ -1,12 +1,6 @@
#include "system.h"
#ifdef WITH_LUA
-#include <rpm/rpmio.h>
-#include <rpm/rpmmacro.h>
-#include <rpm/rpmlog.h>
-#include <rpm/rpmurl.h>
-#include "rpmio/rpmhook.h"
-
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
@@ -16,6 +10,12 @@
#include <unistd.h>
#include <assert.h>
+#include <rpm/rpmio.h>
+#include <rpm/rpmmacro.h>
+#include <rpm/rpmlog.h>
+#include <rpm/rpmurl.h>
+#include "rpmio/rpmhook.h"
+
#define _RPMLUA_INTERNAL
#include "rpmio/rpmlua.h"
diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c
index 1a4abe4aa..d93ec6e71 100644
--- a/rpmio/rpmpgp.c
+++ b/rpmio/rpmpgp.c
@@ -4,11 +4,12 @@
*/
#include "system.h"
-#include "rpmio/digest.h"
-#include "rpmio/rpmio_internal.h" /* XXX rpmioSlurp */
#include <rpm/rpmstring.h>
+#include "rpmio/digest.h"
+#include "rpmio/rpmio_internal.h" /* XXX rpmioSlurp */
+
#include "debug.h"
diff --git a/rpmio/tax.c b/rpmio/tax.c
index 5c2621492..aeac1756c 100644
--- a/rpmio/tax.c
+++ b/rpmio/tax.c
@@ -1,8 +1,9 @@
#include "system.h"
+#include <popt.h>
+
#include <rpm/rpmpgp.h>
#include "rpmio/base64.h"
-#include <popt.h>
#include "debug.h"
diff --git a/rpmio/tdir.c b/rpmio/tdir.c
index 3e673b159..742225b1b 100644
--- a/rpmio/tdir.c
+++ b/rpmio/tdir.c
@@ -1,10 +1,11 @@
#include "system.h"
-#include "rpmio/rpmio_internal.h"
+#include <popt.h>
+
#include <rpm/rpmmacro.h>
#include <rpm/rpmlog.h>
-#include <popt.h>
+#include "rpmio/rpmio_internal.h"
#include "debug.h"
static int _debug = 0;
diff --git a/rpmio/tfts.c b/rpmio/tfts.c
index dbf141774..80c746cf4 100644
--- a/rpmio/tfts.c
+++ b/rpmio/tfts.c
@@ -1,11 +1,12 @@
#include "system.h"
-#include "rpmio/fts.h"
-#include "rpmio/rpmio_internal.h"
+#include <popt.h>
+
#include <rpm/rpmmacro.h>
#include <rpm/rpmlog.h>
-#include <popt.h>
+#include "rpmio/fts.h"
+#include "rpmio/rpmio_internal.h"
#include "debug.h"
static int _fts_debug = 0;
diff --git a/rpmio/tget.c b/rpmio/tget.c
index 18e5d14ba..3462bab67 100644
--- a/rpmio/tget.c
+++ b/rpmio/tget.c
@@ -1,9 +1,9 @@
#include "system.h"
-#include "rpmio/rpmio_internal.h"
+#include <popt.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmlog.h>
-#include <popt.h>
+#include "rpmio/rpmio_internal.h"
#include "debug.h"
diff --git a/rpmio/tglob.c b/rpmio/tglob.c
index 213c4039d..94350d5f9 100644
--- a/rpmio/tglob.c
+++ b/rpmio/tglob.c
@@ -1,9 +1,9 @@
#include "system.h"
-#include "rpmio/rpmio_internal.h"
+#include <popt.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmlog.h>
-#include <popt.h>
+#include "rpmio/rpmio_internal.h"
#include "debug.h"
diff --git a/rpmio/thkp.c b/rpmio/thkp.c
index 133d8413b..a459450dd 100644
--- a/rpmio/thkp.c
+++ b/rpmio/thkp.c
@@ -1,9 +1,9 @@
#include "system.h"
-#include "rpmio/rpmio_internal.h"
+#include <popt.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmlog.h>
-#include <popt.h>
+#include "rpmio/rpmio_internal.h"
#include "debug.h"
diff --git a/rpmio/tput.c b/rpmio/tput.c
index 4814d0ddd..61ca42c67 100644
--- a/rpmio/tput.c
+++ b/rpmio/tput.c
@@ -1,9 +1,9 @@
#include "system.h"
-#include "rpmio/rpmio_internal.h"
+#include <popt.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmlog.h>
-#include <popt.h>
+#include "rpmio/rpmio_internal.h"
#include "debug.h"
diff --git a/rpmio/tring.c b/rpmio/tring.c
index f9d6b0c3e..46f19e1ed 100644
--- a/rpmio/tring.c
+++ b/rpmio/tring.c
@@ -1,7 +1,7 @@
#include "system.h"
+#include <popt.h>
#include "rpmio/digest.h"
#include "rpmio/rpmio_internal.h" /* XX _*debug */
-#include <popt.h>
#include "debug.h"
static int printing = 1;
diff --git a/rpmio/tufdio.c b/rpmio/tufdio.c
index 3345bccbd..b88a7469d 100644
--- a/rpmio/tufdio.c
+++ b/rpmio/tufdio.c
@@ -4,11 +4,12 @@
#include "system.h"
+#include <stdarg.h>
+#include <err.h>
+
#include <rpm/rpmurl.h>
#include "rpmio/rpmio_internal.h"
-#include <stdarg.h>
-#include <err.h>
#include "debug.h"
extern int _url_debug;
diff --git a/rpmqv.c b/rpmqv.c
index 100b89b73..3baa58bf4 100644
--- a/rpmqv.c
+++ b/rpmqv.c
@@ -17,10 +17,11 @@ const char *__progname;
#include <rpm/rpmlog.h>
#include <rpm/rpmdb.h>
-#include "rpmdb/rpmdb_internal.h" /* XXX for freeing dbiTags */
#include <rpm/rpmps.h>
#include <rpm/rpmts.h>
+#include "rpmdb/rpmdb_internal.h" /* XXX for freeing dbiTags */
+
#ifdef IAM_RPMBT
#include "build.h"
#define GETOPT_REBUILD 1003
diff --git a/tools/convertdb1.c b/tools/convertdb1.c
index 007bab653..22e421269 100644
--- a/tools/convertdb1.c
+++ b/tools/convertdb1.c
@@ -11,8 +11,11 @@ const char *__progname;
#include <rpm/rpmdb.h>
#include <rpm/rpmio.h>
#include <rpm/rpmmacro.h>
+
#include "lib/legacy.h"
+#include "debug.h>
+
#define FA_MAGIC 0x02050920
struct faFileHeader{
diff --git a/tools/rpmcache.c b/tools/rpmcache.c
index bb9958b54..ccafe491c 100644
--- a/tools/rpmcache.c
+++ b/tools/rpmcache.c
@@ -6,7 +6,6 @@
const char *__progname;
#include <fnmatch.h>
-#include "rpmio/fts.h"
#include <rpm/rpmtag.h>
#include <rpm/rpmlib.h> /* RPM_MACHTABLE, rpmReadPackageFile */
@@ -18,6 +17,7 @@ const char *__progname;
#include <rpm/rpmds.h>
#include <rpm/rpmts.h>
+#include "rpmio/fts.h"
#include "lib/misc.h" /* for rpmMkdirPath */
#include "debug.h"
diff --git a/tools/rpminject.c b/tools/rpminject.c
index cc565cb90..ee15c4f45 100644
--- a/tools/rpminject.c
+++ b/tools/rpminject.c
@@ -1,13 +1,14 @@
#include "system.h"
const char *__progname;
-#include <rpm/rpmbuild.h>
-#include "build/buildio.h"
+#include <err.h> /* XXX !HAVE_ERR_H: get from misc */
+#include <rpm/rpmbuild.h>
#include <rpm/rpmtag.h>
+
#include "lib/rpmlead.h"
+#include "build/buildio.h"
-#include <err.h> /* XXX !HAVE_ERR_H: get from misc */
#include "debug.h"
typedef enum injmode_e { INJ_UNKNOWN, INJ_ADD, INJ_DELETE, INJ_MODIFY } injmode_t;
diff --git a/tools/rpmsort.c b/tools/rpmsort.c
index 9630ecb15..f82690fdf 100644
--- a/tools/rpmsort.c
+++ b/tools/rpmsort.c
@@ -13,9 +13,10 @@ const char *__progname;
#include <rpm/rpmte.h>
#include <rpm/rpmts.h>
#include <rpm/rpmds.h>
+#include <rpm/rpmlog.h>
#include "lib/manifest.h"
-#include <rpm/rpmlog.h>
+
#include "debug.h"
static int _depends_debug;