summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-01-30 13:53:51 +0200
committerPanu Matilainen <pmatilai@redhat.com>2008-01-30 13:53:51 +0200
commit99faa2735b4b52104a724c6a2f8a7a806bc9c7e5 (patch)
treefb04ea90f8cd28f91a42ef62b20208789acfc0eb
parent7751f84bf03076eb6ad90ad0d10144846726bdfb (diff)
downloadlibrpm-tizen-99faa2735b4b52104a724c6a2f8a7a806bc9c7e5.tar.gz
librpm-tizen-99faa2735b4b52104a724c6a2f8a7a806bc9c7e5.tar.bz2
librpm-tizen-99faa2735b4b52104a724c6a2f8a7a806bc9c7e5.zip
rpmlib.h mass eviction
- explicitly include what's really needed instead - document remaining uses
-rw-r--r--build.c2
-rw-r--r--build/pack.c1
-rw-r--r--build/parseChangelog.c1
-rw-r--r--build/parseDescription.c1
-rw-r--r--build/parsePreamble.c1
-rw-r--r--build/parsePrep.c1
-rw-r--r--build/parseReqs.c1
-rw-r--r--build/parseScript.c1
-rw-r--r--build/parseSpec.c2
-rw-r--r--build/reqprov.c1
-rw-r--r--build/rpmfc.c1
-rw-r--r--build/spec.c1
-rw-r--r--lib/depends.c2
-rw-r--r--lib/formats.c3
-rw-r--r--lib/fs.c2
-rw-r--r--lib/fsm.c1
-rw-r--r--lib/idtx.c3
-rw-r--r--lib/legacy.c2
-rw-r--r--lib/manifest.c1
-rw-r--r--lib/misc.c1
-rw-r--r--lib/misc.h1
-rw-r--r--lib/package.c2
-rw-r--r--lib/poptALL.c1
-rw-r--r--lib/psm.c2
-rw-r--r--lib/query.c1
-rw-r--r--lib/rpmal.c1
-rw-r--r--lib/rpmchecksig.c1
-rw-r--r--lib/rpmcli.h3
-rw-r--r--lib/rpmds.c3
-rw-r--r--lib/rpmfi.c1
-rw-r--r--lib/rpmfi_internal.h1
-rw-r--r--lib/rpmgi.c3
-rw-r--r--lib/rpminstall.c2
-rw-r--r--lib/rpmlead.c3
-rw-r--r--lib/rpmlead.h1
-rw-r--r--lib/rpmlibprov.c4
-rw-r--r--lib/rpmlock.c1
-rw-r--r--lib/rpmrc.c2
-rw-r--r--lib/rpmte.c3
-rw-r--r--lib/rpmts.c3
-rw-r--r--lib/rpmvercmp.c2
-rw-r--r--lib/signature.c5
-rw-r--r--lib/tcpu.c5
-rw-r--r--lib/tds.c3
-rw-r--r--lib/tgi.c1
-rw-r--r--lib/tplatform.c1
-rw-r--r--lib/transaction.c2
-rw-r--r--lib/trb.c1
-rw-r--r--lib/tthread.c2
-rw-r--r--lib/verify.c1
-rw-r--r--python/header-py.c3
-rw-r--r--python/header-py.h2
-rw-r--r--python/rpmal-py.c1
-rw-r--r--python/rpmdb-py.c3
-rw-r--r--python/rpmds-py.c3
-rw-r--r--python/rpmfi-py.c3
-rw-r--r--python/rpmmi-py.c1
-rw-r--r--python/rpmmodule.c2
-rw-r--r--python/rpmps-py.c1
-rw-r--r--python/rpmte-py.c1
-rw-r--r--python/rpmts-py.c3
-rw-r--r--rpm2cpio.c4
-rw-r--r--rpmdb/db3.c2
-rw-r--r--rpmdb/dbconfig.c4
-rw-r--r--rpmdb/hdrNVR.c5
-rw-r--r--rpmdb/rpmdb.c1
-rw-r--r--rpmdb/rpmdb.h2
-rw-r--r--rpmdb/rpmhash.c1
-rw-r--r--rpmdb/sqlite.c2
-rw-r--r--rpmdb/tagname.c2
-rw-r--r--rpmqv.c1
-rw-r--r--tools/convertdb1.c2
-rw-r--r--tools/dump.c1
-rw-r--r--tools/dumpdb.c3
-rw-r--r--tools/rpmcache.c2
-rw-r--r--tools/rpmgraph.c2
-rw-r--r--tools/rpminject.c2
-rw-r--r--tools/rpmsort.c9
78 files changed, 100 insertions, 59 deletions
diff --git a/build.c b/build.c
index 940667f7c..679fa4594 100644
--- a/build.c
+++ b/build.c
@@ -5,6 +5,8 @@
#include "system.h"
#include <rpm/rpmcli.h>
+#include <rpm/rpmtag.h>
+#include <rpm/rpmlib.h> /* rpmrc, MACHTABLE .. */
#include <rpm/rpmbuild.h>
#include <rpm/rpmps.h>
diff --git a/build/pack.c b/build/pack.c
index d5b7c159d..a582a9ff8 100644
--- a/build/pack.c
+++ b/build/pack.c
@@ -5,6 +5,7 @@
#include "system.h"
+#include <rpm/rpmlib.h> /* RPMSIGTAG*, rpmReadPackageFile */
#include "rpmio/rpmio_internal.h" /* fdInitDigest, fdFiniDigest */
#include <rpm/rpmbuild.h>
diff --git a/build/parseChangelog.c b/build/parseChangelog.c
index 0c532150f..fa744af17 100644
--- a/build/parseChangelog.c
+++ b/build/parseChangelog.c
@@ -5,6 +5,7 @@
#include "system.h"
+#include <rpm/rpmtag.h>
#include <rpm/rpmbuild.h>
#include <rpm/rpmlog.h>
#include "debug.h"
diff --git a/build/parseDescription.c b/build/parseDescription.c
index 25423aade..167604455 100644
--- a/build/parseDescription.c
+++ b/build/parseDescription.c
@@ -5,6 +5,7 @@
#include "system.h"
+#include <rpm/rpmtag.h>
#include <rpm/rpmbuild.h>
#include <rpm/rpmlog.h>
#include "debug.h"
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
index ebc1b4959..a8f832d2b 100644
--- a/build/parsePreamble.c
+++ b/build/parsePreamble.c
@@ -5,6 +5,7 @@
#include "system.h"
+#include <rpm/rpmtag.h>
#include <rpm/rpmbuild.h>
#include <rpm/rpmlog.h>
#include <rpm/rpmfileutil.h>
diff --git a/build/parsePrep.c b/build/parsePrep.c
index 04c63f149..570b02693 100644
--- a/build/parsePrep.c
+++ b/build/parsePrep.c
@@ -5,6 +5,7 @@
#include "system.h"
+#include <rpm/rpmtag.h>
#include <rpm/rpmbuild.h>
#include <rpm/rpmlog.h>
#include <rpm/rpmfileutil.h>
diff --git a/build/parseReqs.c b/build/parseReqs.c
index 0aa735a49..442e37790 100644
--- a/build/parseReqs.c
+++ b/build/parseReqs.c
@@ -5,6 +5,7 @@
#include "system.h"
+#include <rpm/rpmtag.h>
#include <rpm/rpmbuild.h>
#include <rpm/rpmlog.h>
#include "debug.h"
diff --git a/build/parseScript.c b/build/parseScript.c
index 9ab789c8b..3d560f3ff 100644
--- a/build/parseScript.c
+++ b/build/parseScript.c
@@ -5,6 +5,7 @@
#include "system.h"
+#include <rpm/rpmtag.h>
#include <rpm/rpmbuild.h>
#include <rpm/rpmlog.h>
#include "debug.h"
diff --git a/build/parseSpec.c b/build/parseSpec.c
index 7b3e492ca..68ec84828 100644
--- a/build/parseSpec.c
+++ b/build/parseSpec.c
@@ -5,6 +5,8 @@
#include "system.h"
+#include <rpm/rpmtag.h>
+#include <rpm/rpmlib.h> /* RPM_MACHTABLE & related */
#include <rpm/rpmbuild.h>
#include <rpm/rpmds.h>
#include <rpm/rpmts.h>
diff --git a/build/reqprov.c b/build/reqprov.c
index e205e5de5..2fdedf431 100644
--- a/build/reqprov.c
+++ b/build/reqprov.c
@@ -5,6 +5,7 @@
#include "system.h"
+#include <rpm/rpmtag.h>
#include <rpm/rpmbuild.h>
#include "debug.h"
diff --git a/build/rpmfc.c b/build/rpmfc.c
index d69d70449..106fe1a14 100644
--- a/build/rpmfc.c
+++ b/build/rpmfc.c
@@ -2,6 +2,7 @@
#include <signal.h>
+#include <rpm/rpmtag.h>
#include <rpm/rpmbuild.h>
#include <rpm/argv.h>
#include <rpm/rpmfc.h>
diff --git a/build/spec.c b/build/spec.c
index 1393354d0..b168942ba 100644
--- a/build/spec.c
+++ b/build/spec.c
@@ -6,6 +6,7 @@
#include "system.h"
#include "build/buildio.h"
+#include <rpm/rpmtag.h>
#include <rpm/rpmds.h>
#include <rpm/rpmfi.h>
#include <rpm/rpmts.h>
diff --git a/lib/depends.c b/lib/depends.c
index 87f381efd..eccb3a9eb 100644
--- a/lib/depends.c
+++ b/lib/depends.c
@@ -6,6 +6,8 @@
#include <rpm/rpmcli.h> /* XXX rpmcliPackagesTotal */
+#include <rpm/rpmlib.h> /* rpmVersionCompare, rpmlib provides */
+#include <rpm/rpmtag.h>
#include <rpm/rpmmacro.h> /* XXX rpmExpand("%{_dependency_whiteout}" */
#include <rpm/rpmlog.h>
diff --git a/lib/formats.c b/lib/formats.c
index 90ea4d357..98eee4553 100644
--- a/lib/formats.c
+++ b/lib/formats.c
@@ -4,7 +4,8 @@
#include "system.h"
#include "rpmio/digest.h"
-#include <rpm/rpmlib.h>
+#include <rpm/rpmtag.h>
+#include <rpm/rpmlib.h> /* rpmGetFilesystem*() */
#include <rpm/rpmds.h>
#include <rpm/rpmmacro.h> /* XXX for %_i18ndomains */
diff --git a/lib/fs.c b/lib/fs.c
index 9c8055117..1663ee252 100644
--- a/lib/fs.c
+++ b/lib/fs.c
@@ -3,7 +3,7 @@
*/
#include "system.h"
-#include <rpm/rpmlib.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 e5b739a49..7f51659c4 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -6,7 +6,6 @@
#include "system.h"
#include "rpmio/rpmio_internal.h" /* fdGet/SetCpioPos, fdInit/FiniDigest */
-#include <rpm/rpmlib.h>
#include "lib/cpio.h"
diff --git a/lib/idtx.c b/lib/idtx.c
index dfa898edc..7e9c68164 100644
--- a/lib/idtx.c
+++ b/lib/idtx.c
@@ -1,7 +1,8 @@
#include "system.h"
#include <rpm/idtx.h>
-#include <rpm/rpmlib.h>
+#include <rpm/rpmlib.h> /* rpmReadPackageFile */
+#include <rpm/rpmtag.h>
#include <rpm/rpmdb.h>
#include <rpm/rpmts.h>
#include <rpm/rpmfileutil.h>
diff --git a/lib/legacy.c b/lib/legacy.c
index 704af5aaa..86a205ba2 100644
--- a/lib/legacy.c
+++ b/lib/legacy.c
@@ -4,7 +4,7 @@
#include "system.h"
-#include <rpm/rpmlib.h>
+#include <rpm/rpmtag.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmstring.h>
#include <rpm/rpmfi.h>
diff --git a/lib/manifest.c b/lib/manifest.c
index 7c89db811..7e5d1964b 100644
--- a/lib/manifest.c
+++ b/lib/manifest.c
@@ -4,7 +4,6 @@
#include "system.h"
-#include <rpm/rpmlib.h>
#include <rpm/rpmlog.h>
#include <rpm/rpmfileutil.h>
diff --git a/lib/misc.c b/lib/misc.c
index 9a01bd5fc..2a8abfd35 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -9,7 +9,6 @@ const char * RPMVERSION = VERSION;
#include <rpm/rpmurl.h>
#include <rpm/rpmmacro.h> /* XXX for rpmGetPath */
-#include <rpm/rpmlib.h>
#include <rpm/rpmlog.h>
#include "lib/misc.h"
#include "debug.h"
diff --git a/lib/misc.h b/lib/misc.h
index c860ab892..68815749e 100644
--- a/lib/misc.h
+++ b/lib/misc.h
@@ -7,6 +7,7 @@
*/
#include <string.h>
+#include <rpm/rpmtypes.h>
#ifdef __cplusplus
extern "C" {
diff --git a/lib/package.c b/lib/package.c
index 8fd94f62a..1e316531e 100644
--- a/lib/package.c
+++ b/lib/package.c
@@ -8,8 +8,8 @@
#include "rpmio/digest.h"
#include "rpmio/rpmio_internal.h" /* fd*Digest(), fd stats */
-#include <rpm/rpmlib.h>
+#include <rpm/rpmlib.h> /* XXX RPMSIGTAG, other sig stuff */
#include <rpm/rpmts.h>
#include "lib/legacy.h" /* XXX legacyRetrofit() */
diff --git a/lib/poptALL.c b/lib/poptALL.c
index 77b439d56..feb94c052 100644
--- a/lib/poptALL.c
+++ b/lib/poptALL.c
@@ -7,6 +7,7 @@
const char *__progname;
#include <rpm/rpmcli.h>
+#include <rpm/rpmlib.h> /* rpmEVR, rpmReadConfigFiles etc */
#include <rpm/rpmgi.h>
#include <rpm/rpmlog.h>
#include <rpm/rpmstring.h>
diff --git a/lib/psm.c b/lib/psm.c
index d271fead3..1b2ee970e 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -5,7 +5,7 @@
#include "system.h"
-#include <rpm/rpmlib.h>
+#include <rpm/rpmlib.h> /* rpmvercmp and others */
#include <rpm/rpmmacro.h>
#include <rpm/rpmurl.h>
#include "rpmio/rpmlua.h"
diff --git a/lib/query.c b/lib/query.c
index 0fb6bccd0..020b307cb 100644
--- a/lib/query.c
+++ b/lib/query.c
@@ -11,6 +11,7 @@
#include <rpm/rpmcli.h>
+#include <rpm/rpmtag.h>
#include <rpm/rpmdb.h>
#include <rpm/rpmfi.h>
diff --git a/lib/rpmal.c b/lib/rpmal.c
index c2643af03..a0956cd7b 100644
--- a/lib/rpmal.c
+++ b/lib/rpmal.c
@@ -4,7 +4,6 @@
#include "system.h"
-#include <rpm/rpmlib.h>
#include <rpm/rpmal.h>
#include <rpm/rpmds.h>
diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c
index d909faad7..3f47ab4ed 100644
--- a/lib/rpmchecksig.c
+++ b/lib/rpmchecksig.c
@@ -5,6 +5,7 @@
#include "system.h"
+#include <rpm/rpmlib.h> /* RPMSIGTAG & related */
#include <rpm/rpmpgp.h>
#include "rpmio/rpmio_internal.h" /* for fd*Digest() */
#include <rpm/rpmcli.h>
diff --git a/lib/rpmcli.h b/lib/rpmcli.h
index 49cd3b0af..64700e759 100644
--- a/lib/rpmcli.h
+++ b/lib/rpmcli.h
@@ -5,7 +5,8 @@
* \file lib/rpmcli.h
*/
-#include <rpm/rpmlib.h>
+#include <popt.h>
+
#include <rpm/rpmurl.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmcallback.h>
diff --git a/lib/rpmds.c b/lib/rpmds.c
index 79720e618..84a859cc6 100644
--- a/lib/rpmds.c
+++ b/lib/rpmds.c
@@ -3,7 +3,8 @@
*/
#include "system.h"
-#include <rpm/rpmlib.h>
+#include <rpm/rpmtag.h>
+#include <rpm/rpmlib.h> /* rpmvercmp */
#include <rpm/rpmstring.h>
#include <rpm/rpmlog.h>
diff --git a/lib/rpmfi.c b/lib/rpmfi.c
index 657d334ba..6c5d78699 100644
--- a/lib/rpmfi.c
+++ b/lib/rpmfi.c
@@ -5,7 +5,6 @@
#include "system.h"
-#include <rpm/rpmlib.h>
#include <rpm/rpmlog.h>
#include "lib/cpio.h" /* XXX CPIO_FOO */
diff --git a/lib/rpmfi_internal.h b/lib/rpmfi_internal.h
index 93658b2ce..095d2f555 100644
--- a/lib/rpmfi_internal.h
+++ b/lib/rpmfi_internal.h
@@ -1,6 +1,7 @@
#ifndef _RPMFI_INTERNAL_H
#define _RPMFI_INTERNAL_H
+#include <rpm/rpmtag.h>
#include <rpm/rpmfi.h>
#include "lib/fsm.h" /* for FSM_t */
diff --git a/lib/rpmgi.c b/lib/rpmgi.c
index 34057981c..49e8bc544 100644
--- a/lib/rpmgi.c
+++ b/lib/rpmgi.c
@@ -3,7 +3,8 @@
*/
#include "system.h"
-#include <rpm/rpmlib.h>
+#include <rpm/rpmtag.h>
+#include <rpm/rpmlib.h> /* rpmReadPackageFile */
#include <rpm/rpmte.h> /* XXX rpmElementType */
#include <rpm/rpmts.h>
diff --git a/lib/rpminstall.c b/lib/rpminstall.c
index 9c079cfed..02c6a5061 100644
--- a/lib/rpminstall.c
+++ b/lib/rpminstall.c
@@ -6,6 +6,8 @@
#include <rpm/rpmcli.h>
+#include <rpm/rpmtag.h>
+#include <rpm/rpmlib.h> /* rpmReadPackageFile, vercmp etc */
#include <rpm/rpmdb.h>
#include <rpm/rpmds.h>
#include <rpm/rpmts.h>
diff --git a/lib/rpmlead.c b/lib/rpmlead.c
index 33c421a32..374e2a6be 100644
--- a/lib/rpmlead.c
+++ b/lib/rpmlead.c
@@ -6,8 +6,7 @@
#include <netinet/in.h>
-#include <rpm/rpmlib.h>
-
+#include <rpm/rpmlib.h> /* rpmGetOs/ArchInfo() */
#include "lib/signature.h"
#include "lib/rpmlead.h"
#include "lib/legacy.h"
diff --git a/lib/rpmlead.h b/lib/rpmlead.h
index be91a5291..63dbe1829 100644
--- a/lib/rpmlead.h
+++ b/lib/rpmlead.h
@@ -21,7 +21,6 @@ extern "C" {
typedef struct rpmlead_s * rpmlead;
-#include <rpm/rpmlib.h>
/** \ingroup lead
* Initialize a lead structure
diff --git a/lib/rpmlibprov.c b/lib/rpmlibprov.c
index 67424c931..5bbdcf10a 100644
--- a/lib/rpmlibprov.c
+++ b/lib/rpmlibprov.c
@@ -4,8 +4,8 @@
#include "system.h"
-#include <rpm/rpmlib.h>
-
+#include <rpm/rpmtag.h>
+#include <rpm/rpmlib.h> /* rpmGetRpmlibProvides() & co protos */
#include <rpm/rpmds.h>
#include "debug.h"
diff --git a/lib/rpmlock.c b/lib/rpmlock.c
index 808f496f1..deeaae0b6 100644
--- a/lib/rpmlock.c
+++ b/lib/rpmlock.c
@@ -1,7 +1,6 @@
#include "system.h"
-#include <rpm/rpmlib.h>
#include <rpm/rpmlog.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmfileutil.h>
diff --git a/lib/rpmrc.c b/lib/rpmrc.c
index db5887965..2e5b5a937 100644
--- a/lib/rpmrc.c
+++ b/lib/rpmrc.c
@@ -13,8 +13,8 @@
#define __power_pc() 0
#endif
+#include <rpm/rpmlib.h> /* RPM_MACTABLE*, Rc-prototypes */
#include "rpmio/rpmio_internal.h" /* XXX for rpmioSlurp */
-#include <rpm/rpmlib.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmfileutil.h>
#include <rpm/rpmstring.h>
diff --git a/lib/rpmte.c b/lib/rpmte.c
index e0d94bd11..552cce955 100644
--- a/lib/rpmte.c
+++ b/lib/rpmte.c
@@ -3,8 +3,9 @@
* Routine(s) to handle an "rpmte" transaction element.
*/
#include "system.h"
-#include <rpm/rpmlib.h>
+#include <rpm/rpmtag.h>
+#include <rpm/rpmlib.h> /* RPM_MACHTABLE_* */
#include <rpm/rpmds.h>
#include <rpm/rpmfi.h>
diff --git a/lib/rpmts.c b/lib/rpmts.c
index 80f96c20c..ded3acc56 100644
--- a/lib/rpmts.c
+++ b/lib/rpmts.c
@@ -4,9 +4,10 @@
*/
#include "system.h"
+#include <rpm/rpmtag.h>
+#include <rpm/rpmlib.h> /* rpmReadPackage etc */
#include <rpm/rpmurl.h>
#include "rpmio/digest.h"
-#include <rpm/rpmlib.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmfileutil.h> /* rpmtsOpenDB() needs rpmGetPath */
#include <rpm/rpmstring.h>
diff --git a/lib/rpmvercmp.c b/lib/rpmvercmp.c
index 86c9e69f3..ba5c4720d 100644
--- a/lib/rpmvercmp.c
+++ b/lib/rpmvercmp.c
@@ -4,7 +4,7 @@
#include "system.h"
-#include <rpm/rpmlib.h>
+#include <rpm/rpmlib.h> /* rpmvercmp proto */
#include <rpm/rpmstring.h>
#include "debug.h"
diff --git a/lib/signature.c b/lib/signature.c
index 853d997c3..ab633760a 100644
--- a/lib/signature.c
+++ b/lib/signature.c
@@ -4,8 +4,11 @@
#include "system.h"
+#include <popt.h>
+
#include "rpmio/digest.h"
-#include <rpm/rpmlib.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>
diff --git a/lib/tcpu.c b/lib/tcpu.c
index 41dae7415..cc503d942 100644
--- a/lib/tcpu.c
+++ b/lib/tcpu.c
@@ -1,5 +1,8 @@
#include "system.h"
-#include <rpm/rpmlib.h>
+
+#include <popt.h>
+
+#include <rpm/rpmio.h>
#include <rpm/rpmmacro.h>
#include "debug.h"
diff --git a/lib/tds.c b/lib/tds.c
index 149b33e1c..0389b5b6c 100644
--- a/lib/tds.c
+++ b/lib/tds.c
@@ -1,7 +1,6 @@
#include "system.h"
-#include <rpm/rpmlib.h>
-
+#include <rpm/rpmtag.h>
#include <rpm/rpmds.h>
#include "debug.h"
diff --git a/lib/tgi.c b/lib/tgi.c
index 100452ebc..17c8c5e46 100644
--- a/lib/tgi.c
+++ b/lib/tgi.c
@@ -1,5 +1,6 @@
#include "system.h"
+#include <rpm/rpmtag.h>
#include <rpm/rpmgi.h>
#include <rpm/rpmcli.h>
diff --git a/lib/tplatform.c b/lib/tplatform.c
index 925a5d5e6..f7383cc23 100644
--- a/lib/tplatform.c
+++ b/lib/tplatform.c
@@ -1,7 +1,6 @@
#include "system.h"
#include "rpmio/rpmio_internal.h" /* XXX rpmioSlurp */
-#include <rpm/rpmlib.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmio.h>
diff --git a/lib/transaction.c b/lib/transaction.c
index cdc2bce80..ba3b23b67 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -3,8 +3,8 @@
*/
#include "system.h"
-#include <rpm/rpmlib.h>
+#include <rpm/rpmlib.h> /* rpmMachineScore, rpmReadPackageFile */
#include <rpm/rpmmacro.h> /* XXX for rpmExpand */
#include <rpm/rpmlog.h>
diff --git a/lib/trb.c b/lib/trb.c
index e40e79b9f..9ab6d02dd 100644
--- a/lib/trb.c
+++ b/lib/trb.c
@@ -1,5 +1,6 @@
#include "system.h"
#include <rpm/rpmcli.h>
+#include <rpm/rpmlib.h> /* rpmReadConfigFiles */
#include <rpm/rpmts.h>
#include <rpm/rpmlog.h>
diff --git a/lib/tthread.c b/lib/tthread.c
index b4cbb829c..b6a620bc4 100644
--- a/lib/tthread.c
+++ b/lib/tthread.c
@@ -2,7 +2,7 @@
#include <pthread.h>
#include <assert.h>
-#include <rpm/rpmlib.h>
+#include <rpm/rpmlib.h> /* rpmReadConfigFiles, rpmReadPackageFile */
#include <rpm/rpmts.h>
#include <rpm/rpmsq.h> /* XXX for _rpmsq_debug */
#include <rpm/rpmio.h>
diff --git a/lib/verify.c b/lib/verify.c
index c0287fcbc..dff482c09 100644
--- a/lib/verify.c
+++ b/lib/verify.c
@@ -6,6 +6,7 @@
#include "system.h"
#include <rpm/rpmcli.h>
+#include <rpm/rpmtag.h>
#include <rpm/rpmlog.h>
#include "lib/psm.h"
diff --git a/python/header-py.c b/python/header-py.c
index 4905383e5..4e747bacf 100644
--- a/python/header-py.c
+++ b/python/header-py.c
@@ -4,7 +4,8 @@
#include "system.h"
-#include <rpm/rpmlib.h>
+#include <rpm/rpmlib.h> /* rpmvercmp */
+#include <rpm/rpmtag.h>
#include <rpm/rpmstring.h>
#include "lib/legacy.h" /* XXX expand/compressFilelist(), providePackageNVR() */
diff --git a/python/header-py.h b/python/header-py.h
index ecfb54a34..8937520c8 100644
--- a/python/header-py.h
+++ b/python/header-py.h
@@ -1,7 +1,7 @@
#ifndef RPMPYTHON_HEADER
#define RPMPYTHON_HEADER
-#include <rpm/rpmlib.h>
+#include <rpm/rpmtypes.h>
/** \ingroup py_c
* \file python/header-py.h
diff --git a/python/rpmal-py.c b/python/rpmal-py.c
index 84df79b97..38ecfcd54 100644
--- a/python/rpmal-py.c
+++ b/python/rpmal-py.c
@@ -4,7 +4,6 @@
#include "system.h"
-#include <rpm/rpmlib.h>
#include "rpmal-py.h"
#include "rpmds-py.h"
diff --git a/python/rpmdb-py.c b/python/rpmdb-py.c
index 2ce60889f..945e41865 100644
--- a/python/rpmdb-py.c
+++ b/python/rpmdb-py.c
@@ -4,8 +4,7 @@
#include "system.h"
-#include <rpm/rpmlib.h>
-
+#include <rpm/rpmtag.h>
#include "rpmdb-py.h"
#include "rpmmi-py.h"
#include "header-py.h"
diff --git a/python/rpmds-py.c b/python/rpmds-py.c
index 00363ccab..8b694653d 100644
--- a/python/rpmds-py.c
+++ b/python/rpmds-py.c
@@ -4,8 +4,9 @@
#include "system.h"
-#include <rpm/rpmlib.h>
+#include <rpm/rpmtag.h>
#include <rpm/rpmstring.h>
+#include <rpm/rpmlib.h> /* rpmvercmp */
#include "header-py.h"
#include "rpmds-py.h"
diff --git a/python/rpmfi-py.c b/python/rpmfi-py.c
index 580b2b574..fc8271917 100644
--- a/python/rpmfi-py.c
+++ b/python/rpmfi-py.c
@@ -4,8 +4,7 @@
#include "system.h"
-#include <rpm/rpmlib.h>
-
+#include <rpm/rpmtag.h>
#include "header-py.h"
#include "rpmfi-py.h"
diff --git a/python/rpmmi-py.c b/python/rpmmi-py.c
index 0017ce81e..4ff9832b7 100644
--- a/python/rpmmi-py.c
+++ b/python/rpmmi-py.c
@@ -4,7 +4,6 @@
#include "system.h"
-#include <rpm/rpmlib.h>
#include <rpm/rpmdb.h>
#include "rpmmi-py.h"
diff --git a/python/rpmmodule.c b/python/rpmmodule.c
index 4bfa1e013..47fef4445 100644
--- a/python/rpmmodule.c
+++ b/python/rpmmodule.c
@@ -4,6 +4,8 @@
#include "system.h"
+#include <rpm/rpmlib.h> /* rpmMachineScore, rpmReadConfigFiles */
+#include <rpm/rpmtag.h>
#include <rpm/rpmdb.h>
#include <rpm/rpmsq.h>
#include <rpm/rpmlog.h>
diff --git a/python/rpmps-py.c b/python/rpmps-py.c
index 4a592369c..4d880d3f4 100644
--- a/python/rpmps-py.c
+++ b/python/rpmps-py.c
@@ -4,7 +4,6 @@
#include "system.h"
-#include <rpm/rpmlib.h>
#include "rpmps-py.h"
diff --git a/python/rpmte-py.c b/python/rpmte-py.c
index b9eae475b..3e591a654 100644
--- a/python/rpmte-py.c
+++ b/python/rpmte-py.c
@@ -4,7 +4,6 @@
#include "system.h"
-#include <rpm/rpmlib.h>
#include "header-py.h" /* XXX tagNumFromPyObject */
#include "rpmds-py.h"
diff --git a/python/rpmts-py.c b/python/rpmts-py.c
index d48db7efe..98ebfee04 100644
--- a/python/rpmts-py.c
+++ b/python/rpmts-py.c
@@ -4,7 +4,8 @@
#include "system.h"
-#include <rpm/rpmlib.h>
+#include <rpm/rpmlib.h> /* rpmReadPackageFile, headerCheck */
+#include <rpm/rpmtag.h>
#include <rpm/rpmpgp.h>
#include <rpm/rpmdb.h>
#include <rpm/rpmbuild.h>
diff --git a/rpm2cpio.c b/rpm2cpio.c
index ecf02804a..b18133d27 100644
--- a/rpm2cpio.c
+++ b/rpm2cpio.c
@@ -3,7 +3,9 @@
#include "system.h"
const char *__progname;
-#include <rpm/rpmlib.h>
+#include <rpm/rpmlib.h> /* rpmReadPackageFile .. */
+#include <rpm/rpmtag.h>
+#include <rpm/rpmio.h>
#include <rpm/rpmpgp.h>
#include <rpm/rpmts.h>
diff --git a/rpmdb/db3.c b/rpmdb/db3.c
index 085bd283a..7cf70361a 100644
--- a/rpmdb/db3.c
+++ b/rpmdb/db3.c
@@ -10,7 +10,7 @@ static int _debug = 1; /* XXX if < 0 debugging, > 0 unusual error returns */
#include <sys/ipc.h>
#endif
-#include <rpm/rpmlib.h>
+#include <rpm/rpmtag.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmurl.h> /* XXX urlPath proto */
#include <rpm/rpmfileutil.h> /* rpmioMkPath */
diff --git a/rpmdb/dbconfig.c b/rpmdb/dbconfig.c
index 6760fc902..117fd60f4 100644
--- a/rpmdb/dbconfig.c
+++ b/rpmdb/dbconfig.c
@@ -4,7 +4,9 @@
#include "system.h"
-#include <rpm/rpmlib.h>
+#include <popt.h>
+
+#include <rpm/rpmtag.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmstring.h>
#include <rpm/rpmlog.h>
diff --git a/rpmdb/hdrNVR.c b/rpmdb/hdrNVR.c
index 15aca5160..17790cb81 100644
--- a/rpmdb/hdrNVR.c
+++ b/rpmdb/hdrNVR.c
@@ -3,7 +3,10 @@
*/
#include "system.h"
-#include <rpm/rpmlib.h>
+
+#include <rpm/rpmtypes.h>
+#include <rpm/rpmtag.h>
+
#include "debug.h"
int headerNVR(Header h, const char **np, const char **vp, const char **rp)
diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c
index 1fcd18e51..92de1e94d 100644
--- a/rpmdb/rpmdb.c
+++ b/rpmdb/rpmdb.c
@@ -14,6 +14,7 @@
#include <regex.h>
+#include <rpm/rpmtag.h>
#include <rpm/rpmurl.h>
#include <rpm/rpmpgp.h>
#include <rpm/rpmpgp.h>
diff --git a/rpmdb/rpmdb.h b/rpmdb/rpmdb.h
index 8d988ac04..bc429d117 100644
--- a/rpmdb/rpmdb.h
+++ b/rpmdb/rpmdb.h
@@ -6,7 +6,7 @@
* Access RPM indices using Berkeley DB interface(s).
*/
-#include <rpm/rpmlib.h>
+#include <rpm/rpmtypes.h>
#include <rpm/rpmsw.h>
#ifdef __cplusplus
diff --git a/rpmdb/rpmhash.c b/rpmdb/rpmhash.c
index 9357f9451..c7f7fc506 100644
--- a/rpmdb/rpmhash.c
+++ b/rpmdb/rpmhash.c
@@ -4,7 +4,6 @@
*/
#include "system.h"
-#include <rpm/rpmlib.h>
#include "rpmdb/rpmhash.h"
#include "debug.h"
diff --git a/rpmdb/sqlite.c b/rpmdb/sqlite.c
index ac2989ed4..4574badf5 100644
--- a/rpmdb/sqlite.c
+++ b/rpmdb/sqlite.c
@@ -26,7 +26,7 @@
#include "system.h"
-#include <rpm/rpmlib.h>
+#include <rpm/rpmtag.h>
#include <rpm/rpmlog.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmurl.h> /* XXX urlPath proto */
diff --git a/rpmdb/tagname.c b/rpmdb/tagname.c
index 2e6e20b7b..bf7b6bf06 100644
--- a/rpmdb/tagname.c
+++ b/rpmdb/tagname.c
@@ -4,7 +4,7 @@
#include "system.h"
-#include <rpm/rpmlib.h>
+#include <rpm/rpmtag.h>
#include <rpm/rpmstring.h>
#include "debug.h"
diff --git a/rpmqv.c b/rpmqv.c
index 9bcc5ccd5..100b89b73 100644
--- a/rpmqv.c
+++ b/rpmqv.c
@@ -12,6 +12,7 @@ const char *__progname;
#endif
#include <rpm/rpmcli.h>
+#include <rpm/rpmlib.h> /* RPMSIGTAG, rpmReadPackageFile .. */
#include <rpm/rpmbuild.h>
#include <rpm/rpmlog.h>
diff --git a/tools/convertdb1.c b/tools/convertdb1.c
index 7e2572228..007bab653 100644
--- a/tools/convertdb1.c
+++ b/tools/convertdb1.c
@@ -7,7 +7,7 @@ const char *__progname;
#include <string.h>
#endif
-#include <rpm/rpmlib.h>
+#include <rpm/rpmtag.h>
#include <rpm/rpmdb.h>
#include <rpm/rpmio.h>
#include <rpm/rpmmacro.h>
diff --git a/tools/dump.c b/tools/dump.c
index 9878ff369..b3243da6f 100644
--- a/tools/dump.c
+++ b/tools/dump.c
@@ -1,7 +1,6 @@
#include "system.h"
const char *__progname;
-#include <rpm/rpmlib.h>
#include "rpmdb/header_internal.h"
#include "debug.h"
diff --git a/tools/dumpdb.c b/tools/dumpdb.c
index 224410916..8815d4e99 100644
--- a/tools/dumpdb.c
+++ b/tools/dumpdb.c
@@ -1,9 +1,10 @@
#include "system.h"
const char *__progname;
-#include <rpm/rpmlib.h>
#include "rpmdb/header_internal.h"
+#include <rpm/rpmtag.h>
+#include <rpm/rpmlib.h> /* rpmReadConfigFiles */
#include <rpm/rpmdb.h>
#include "debug.h"
diff --git a/tools/rpmcache.c b/tools/rpmcache.c
index 9b515660d..bb9958b54 100644
--- a/tools/rpmcache.c
+++ b/tools/rpmcache.c
@@ -8,6 +8,8 @@ const char *__progname;
#include <fnmatch.h>
#include "rpmio/fts.h"
+#include <rpm/rpmtag.h>
+#include <rpm/rpmlib.h> /* RPM_MACHTABLE, rpmReadPackageFile */
#include <rpm/rpmcli.h>
#include <rpm/rpmlog.h>
diff --git a/tools/rpmgraph.c b/tools/rpmgraph.c
index d0ba3da6b..36f4ede8f 100644
--- a/tools/rpmgraph.c
+++ b/tools/rpmgraph.c
@@ -2,7 +2,7 @@
const char *__progname;
#include <rpm/rpmcli.h>
-
+#include <rpm/rpmlib.h> /* rpmReadPackageFile */
#include <rpm/rpmdb.h>
#include <rpm/rpmps.h>
#include <rpm/rpmte.h>
diff --git a/tools/rpminject.c b/tools/rpminject.c
index 1a744586d..cc565cb90 100644
--- a/tools/rpminject.c
+++ b/tools/rpminject.c
@@ -4,7 +4,7 @@ const char *__progname;
#include <rpm/rpmbuild.h>
#include "build/buildio.h"
-#include <rpm/header.h>
+#include <rpm/rpmtag.h>
#include "lib/rpmlead.h"
#include <err.h> /* XXX !HAVE_ERR_H: get from misc */
diff --git a/tools/rpmsort.c b/tools/rpmsort.c
index 71182e6d1..74b279bd5 100644
--- a/tools/rpmsort.c
+++ b/tools/rpmsort.c
@@ -1,10 +1,13 @@
#include "system.h"
const char *__progname;
-#include <rpm/rpmlib.h>
-#include <rpm/rpmmacro.h>
-#include <rpm/rpmurl.h>
+#include <popt.h>
+#include <rpm/rpmlib.h> /* rpmReadConfigFiles */
+#include <rpm/rpmfileutil.h>
+#include <rpm/rpmurl.h>
+#include <rpm/rpmio.h>
+#include <rpm/rpmtag.h>
#include <rpm/rpmdb.h>
#include <rpm/rpmps.h>
#include <rpm/rpmte.h>