From 57185995ac41b068579e26eb72766c2c87d7ddcf Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 4 Nov 2022 16:48:45 +0000 Subject: [PATCH] build: Install "build-essential" by default Signed-off-by: Michael Tremer --- contrib/config/distros/ipfire3.conf | 5 --- src/libpakfire/build.c | 47 ++++++----------------------- 2 files changed, 9 insertions(+), 43 deletions(-) diff --git a/contrib/config/distros/ipfire3.conf b/contrib/config/distros/ipfire3.conf index dcc218bb6..9ed98bc29 100644 --- a/contrib/config/distros/ipfire3.conf +++ b/contrib/config/distros/ipfire3.conf @@ -12,11 +12,6 @@ slogan = An Open Source Firewall Solution source_dl = https://source.ipfire.org/source-3.x/ - -[build] - -requires = pakfire-build, gcc, filesystem, ccache, /bin/bash, filesystem, coreutils, util-linux, diffutils, make, gcc, kernel-headers, tar, patch, xz, gzip, bzip2, strace, less, vim - [repo:stable] description = IPFire 3 - stable baseurl = https://pakfire.ipfire.org/files/repos/ipfire-3/stable/%{arch} diff --git a/src/libpakfire/build.c b/src/libpakfire/build.c index c571c38e5..331e805a0 100644 --- a/src/libpakfire/build.c +++ b/src/libpakfire/build.c @@ -1062,37 +1062,21 @@ PAKFIRE_EXPORT int pakfire_build_set_target( static int pakfire_build_install_packages(struct pakfire_build* build, int* snapshot_needs_update) { - char** packages = NULL; - int r = 1; - - // Fetch configuration - struct pakfire_config* config = pakfire_get_config(build->pakfire); - if (!config) { - ERROR(build->pakfire, "Could not fetch configuration: %m\n"); - r = 1; - goto ERROR; - } - - // Fetch build environment - const char* requires = pakfire_config_get(config, "build", "requires", NULL); - if (!requires) { - ERROR(build->pakfire, "No build requirements have been defined\n"); - goto ERROR; - } + int r; - // Split requirements into packages - packages = pakfire_string_split(requires, ','); - if (!packages) - goto ERROR; + const char* packages[] = { + "build-essential", + NULL, + }; int changed = 0; // Install everything - r = pakfire_install(build->pakfire, 0, 0, (const char**)packages, NULL, 0, + r = pakfire_install(build->pakfire, 0, 0, packages, NULL, 0, &changed, NULL, NULL); if (r) { ERROR(build->pakfire, "Could not install build dependencies: %m\n"); - goto ERROR; + return r; } // Mark snapshot as changed if new packages were installed @@ -1103,27 +1087,14 @@ static int pakfire_build_install_packages(struct pakfire_build* build, r = pakfire_sync(build->pakfire, 0, 0, &changed, NULL, NULL); if (r) { ERROR(build->pakfire, "Could not update packages: %m\n"); - goto ERROR; + return r; } // Has anything changed? if (changed) *snapshot_needs_update = 1; - // Success - r = 0; - -ERROR: - if (config) - pakfire_config_unref(config); - - if (packages) { - for (char** package = packages; *package; package++) - free(*package); - free(packages); - } - - return r; + return 0; } /* -- 2.39.5