]> git.ipfire.org Git - pakfire.git/commitdiff
build: Remove old-style snapshots
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 13 Oct 2024 13:42:57 +0000 (13:42 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 13 Oct 2024 13:42:57 +0000 (13:42 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/build.c
src/libpakfire/include/pakfire/build.h
src/libpakfire/job.c

index 57809f23717f07cc5ec158c0a30b296026fd83a6..4704239cf9a6dc55a20991184c599301e2e3aa95 100644 (file)
@@ -47,7 +47,6 @@
 #include <pakfire/problem.h>
 #include <pakfire/repo.h>
 #include <pakfire/scriptlet.h>
-#include <pakfire/snapshot.h>
 #include <pakfire/solution.h>
 #include <pakfire/string.h>
 #include <pakfire/transaction.h>
@@ -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;
 
index ef4f6473e4d6cedd220796dc07f99c08be05916a..5250aa024a867c38b590200550725c9ee84bd579 100644 (file)
@@ -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)
index f41635c0ad2547be22553140efc1c83a2cebe2a3..7656d94f29440713413bf08b292d497f63d15f85 100644 (file)
@@ -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);