From 2deb156beb45efbc40b156d65226ed733bdfe7b5 Mon Sep 17 00:00:00 2001 From: Duncan Overbruck Date: Thu, 22 Dec 2022 16:46:55 +0100 Subject: [PATCH] lib: only include fetch.h where required This results in a lot of places where limits.h was missing, so this diff is larger than necessary. --- include/xbps_api_impl.h | 1 - lib/conf.c | 13 +++++++------ lib/package_config_files.c | 3 ++- lib/package_remove.c | 11 ++++++----- lib/pkgdb.c | 12 +++++++----- lib/plist_fetch.c | 1 + lib/rpool.c | 1 + lib/transaction_fetch.c | 4 +++- lib/transaction_files.c | 1 + lib/util.c | 16 +++++++++------- lib/util_path.c | 5 +++-- 11 files changed, 40 insertions(+), 28 deletions(-) diff --git a/include/xbps_api_impl.h b/include/xbps_api_impl.h index 2df0e5b8..66ffc3c1 100644 --- a/include/xbps_api_impl.h +++ b/include/xbps_api_impl.h @@ -42,7 +42,6 @@ #endif #include "queue.h" -#include "fetch.h" #include "compat.h" #define EXTRACT_FLAGS ARCHIVE_EXTRACT_SECURE_NODOTDOT | \ diff --git a/lib/conf.c b/lib/conf.c index fa591f16..9751e3e4 100644 --- a/lib/conf.c +++ b/lib/conf.c @@ -29,16 +29,17 @@ #ifdef __FreeBSD__ #define _WITH_GETLINE /* getline() */ #endif +#include +#include +#include +#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include #include "xbps_api_impl.h" diff --git a/lib/package_config_files.c b/lib/package_config_files.c index f42ff9d3..31db6ff0 100644 --- a/lib/package_config_files.c +++ b/lib/package_config_files.c @@ -23,10 +23,11 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +#include #include #include #include -#include #include "xbps_api_impl.h" diff --git a/lib/package_remove.c b/lib/package_remove.c index 8349f5c5..276b2efe 100644 --- a/lib/package_remove.c +++ b/lib/package_remove.c @@ -23,14 +23,15 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include +#include +#include +#include +#include #include +#include #include #include -#include -#include -#include -#include #include #include "xbps_api_impl.h" diff --git a/lib/pkgdb.c b/lib/pkgdb.c index 1721a024..145675c8 100644 --- a/lib/pkgdb.c +++ b/lib/pkgdb.c @@ -23,14 +23,16 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include -#include -#include #include #include + +#include #include +#include +#include +#include +#include +#include #include "xbps_api_impl.h" diff --git a/lib/plist_fetch.c b/lib/plist_fetch.c index ba0c67ae..efeb0de7 100644 --- a/lib/plist_fetch.c +++ b/lib/plist_fetch.c @@ -32,6 +32,7 @@ #include #include "xbps_api_impl.h" +#include "fetch.h" /** * @file lib/plist_fetch.c diff --git a/lib/rpool.c b/lib/rpool.c index 70e57126..65df5ad8 100644 --- a/lib/rpool.c +++ b/lib/rpool.c @@ -32,6 +32,7 @@ #include #include "xbps_api_impl.h" +#include "fetch.h" struct rpool_fpkg { xbps_array_t revdeps; diff --git a/lib/transaction_fetch.c b/lib/transaction_fetch.c index c3cc7ed0..72ce0747 100644 --- a/lib/transaction_fetch.c +++ b/lib/transaction_fetch.c @@ -24,12 +24,14 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +#include #include #include -#include #include #include "xbps_api_impl.h" +#include "fetch.h" static int verify_binpkg(struct xbps_handle *xhp, xbps_dictionary_t pkgd) diff --git a/lib/transaction_files.c b/lib/transaction_files.c index a5f8f6a6..1ef4fe1e 100644 --- a/lib/transaction_files.c +++ b/lib/transaction_files.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include diff --git a/lib/util.c b/lib/util.c index 444fef41..c2209cbc 100644 --- a/lib/util.c +++ b/lib/util.c @@ -33,16 +33,18 @@ #include "compat.h" -#include -#include -#include -#include -#include +#include + +#include #include #include -#include #include -#include +#include +#include +#include +#include +#include +#include #include "xbps_api_impl.h" diff --git a/lib/util_path.c b/lib/util_path.c index c7ba7c7c..e6e8c97b 100644 --- a/lib/util_path.c +++ b/lib/util_path.c @@ -56,9 +56,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include -#include #include +#include +#include +#include #include "xbps_api_impl.h"