From: Michael Tremer Date: Sun, 13 Oct 2024 13:42:57 +0000 (+0000) Subject: build: Remove old-style snapshots X-Git-Tag: 0.9.30~1039 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e4c6bb14f08606f62823bbef3289848708ef819;p=pakfire.git build: Remove old-style snapshots Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/build.c b/src/libpakfire/build.c index 57809f237..4704239cf 100644 --- a/src/libpakfire/build.c +++ b/src/libpakfire/build.c @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include @@ -1666,8 +1665,7 @@ PAKFIRE_EXPORT int pakfire_build_set_target( return pakfire_string_set(build->target, target); } -static int pakfire_build_install_packages( - struct pakfire_build* build, int* snapshot_needs_update) { +static int pakfire_build_install_packages(struct pakfire_build* build) { struct pakfire_transaction* transaction = NULL; char* problems = NULL; int r; @@ -1697,10 +1695,6 @@ static int pakfire_build_install_packages( goto ERROR; } - // If there are changes, we have to update the snapshot - if (pakfire_transaction_count(transaction)) - *snapshot_needs_update = 1; - // Run the transaction r = pakfire_transaction_run(transaction); if (r) @@ -1727,35 +1721,11 @@ static int pakfire_build_init(struct pakfire_build* build) { return 0; } - const int use_snapshot = !pakfire_build_has_flag(build, PAKFIRE_BUILD_DISABLE_SNAPSHOT); - - // Tells us whether we need to (re-)create the snapshot - int snapshot_needs_update = 0; - -#if 0 - // Extract snapshot - if (use_snapshot) { - r = pakfire_snapshot_restore(build->pakfire); - if (r) - return r; - } -#endif - // Install or update any build dependencies - r = pakfire_build_install_packages(build, &snapshot_needs_update); + r = pakfire_build_install_packages(build); if (r) return r; -#if 0 - // Update the snapshot if there were changes - if (use_snapshot && snapshot_needs_update) { - // Store the snapshot - r = pakfire_snapshot_store(build->pakfire); - if (r) - return r; - } -#endif - // Mark as ready build->state = PAKFIRE_BUILD_READY; diff --git a/src/libpakfire/include/pakfire/build.h b/src/libpakfire/include/pakfire/build.h index ef4f6473e..5250aa024 100644 --- a/src/libpakfire/include/pakfire/build.h +++ b/src/libpakfire/include/pakfire/build.h @@ -27,9 +27,8 @@ struct pakfire_build; enum pakfire_build_flags { PAKFIRE_BUILD_INTERACTIVE = (1 << 0), - PAKFIRE_BUILD_DISABLE_SNAPSHOT = (1 << 1), - PAKFIRE_BUILD_DISABLE_CCACHE = (1 << 2), - PAKFIRE_BUILD_DISABLE_TESTS = (1 << 3), + PAKFIRE_BUILD_DISABLE_CCACHE = (1 << 1), + PAKFIRE_BUILD_DISABLE_TESTS = (1 << 2), }; typedef int (*pakfire_build_log_callback) diff --git a/src/libpakfire/job.c b/src/libpakfire/job.c index f41635c0a..7656d94f2 100644 --- a/src/libpakfire/job.c +++ b/src/libpakfire/job.c @@ -472,9 +472,11 @@ static int pakfire_job_child(struct pakfire_job* job) { goto ERROR; } - int build_flags = - PAKFIRE_BUILD_DISABLE_SNAPSHOT | - (job->flags & PAKFIRE_JOB_CCACHE) ? 0 : PAKFIRE_BUILD_DISABLE_CCACHE; + int build_flags = 0; + + // Disable the ccache + if (!(job->flags & PAKFIRE_JOB_CCACHE)) + build_flags |= PAKFIRE_BUILD_DISABLE_CCACHE; // Create a new build environment r = pakfire_build_create(&build, pakfire, job_id, build_flags);