]> git.ipfire.org Git - pakfire.git/commitdiff
transaction: Remove option to perform a dry-run
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 23 Sep 2023 10:19:38 +0000 (10:19 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 23 Sep 2023 10:19:38 +0000 (10:19 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/_pakfire/pakfire.c
src/libpakfire/build.c
src/libpakfire/include/pakfire/transaction.h
src/libpakfire/pakfire.c
src/libpakfire/transaction.c

index 258b3ed3ddb7eb0319eeb57d065a80de60881eec..711525d3dadc8d31d8bcf0c8218a74b89e64af23 100644 (file)
@@ -427,7 +427,6 @@ ERROR:
 static PyObject* Pakfire_install(PakfireObject* self, PyObject* args, PyObject* kwargs) {
        char* kwlist[] = {
                "packages",
-               "dryrun",
                "without_recommended",
                "allow_uninstall",
                "allow_downgrade",
@@ -435,7 +434,6 @@ static PyObject* Pakfire_install(PakfireObject* self, PyObject* args, PyObject*
                NULL
        };
        char** packages = NULL;
-       int dryrun = 0;
        int without_recommended = 0;
        int allow_uninstall = 0;
        int allow_downgrade = 0;
@@ -444,8 +442,8 @@ static PyObject* Pakfire_install(PakfireObject* self, PyObject* args, PyObject*
        PyObject* status_callback = NULL;
        int r;
 
-       if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&|$ppppO", kwlist,
-                       convert_packages, &packages, &dryrun, &without_recommended, &allow_uninstall,
+       if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&|$pppO", kwlist,
+                       convert_packages, &packages, &without_recommended, &allow_uninstall,
                        &allow_downgrade, &status_callback))
                return NULL;
 
@@ -455,9 +453,6 @@ static PyObject* Pakfire_install(PakfireObject* self, PyObject* args, PyObject*
                return NULL;
        }
 
-       // Enable dry-run mode
-       if (dryrun)
-               transaction_flags |= PAKFIRE_TRANSACTION_DRY_RUN;
 
        // Do not install recommended packages
        if (without_recommended)
@@ -497,21 +492,19 @@ static PyObject* Pakfire_install(PakfireObject* self, PyObject* args, PyObject*
 static PyObject* Pakfire_erase(PakfireObject* self, PyObject* args, PyObject* kwargs) {
        char* kwlist[] = {
                "packages",
-               "dryrun",
                "keep_dependencies",
                "status_callback",
                NULL
        };
        char** packages = NULL;
-       int dryrun = 0;
        int keep_dependencies = 0;
        int transaction_flags = 0;
        int flags = 0;
        PyObject* status_callback = NULL;
        int r;
 
-       if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&|$ppO", kwlist,
-                       convert_packages, &packages, &dryrun, &keep_dependencies, &status_callback))
+       if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&|$pO", kwlist,
+                       convert_packages, &packages, &keep_dependencies, &status_callback))
                return NULL;
 
        // Check if callback is callable
@@ -520,9 +513,6 @@ static PyObject* Pakfire_erase(PakfireObject* self, PyObject* args, PyObject* kw
                return NULL;
        }
 
-       if (dryrun)
-               transaction_flags |= PAKFIRE_TRANSACTION_DRY_RUN;
-
        if (keep_dependencies)
                flags |= PAKFIRE_JOB_KEEP_DEPS;
 
@@ -552,7 +542,6 @@ static PyObject* Pakfire_erase(PakfireObject* self, PyObject* args, PyObject* kw
 static PyObject* Pakfire_update(PakfireObject* self, PyObject* args, PyObject* kwargs) {
        char* kwlist[] = {
                "packages",
-               "dryrun",
                "excludes",
                "allow_uninstall",
                "allow_downgrade",
@@ -561,7 +550,6 @@ static PyObject* Pakfire_update(PakfireObject* self, PyObject* args, PyObject* k
        };
        char** packages = NULL;
        char** excludes = NULL;
-       int dryrun = 0;
        int allow_uninstall = 0;
        int allow_downgrade = 0;
        int solver_flags = 0;
@@ -569,8 +557,8 @@ static PyObject* Pakfire_update(PakfireObject* self, PyObject* args, PyObject* k
        PyObject* status_callback = NULL;
        int r;
 
-       if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&|$pO&ppO", kwlist,
-                       convert_packages, &packages, &dryrun, convert_packages, &excludes,
+       if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&|$O&ppO", kwlist,
+                       convert_packages, &packages, convert_packages, &excludes,
                        &allow_uninstall, &allow_downgrade, &status_callback))
                return NULL;
 
@@ -580,9 +568,6 @@ static PyObject* Pakfire_update(PakfireObject* self, PyObject* args, PyObject* k
                return NULL;
        }
 
-       if (dryrun)
-               transaction_flags |= PAKFIRE_TRANSACTION_DRY_RUN;
-
        // Can the solver uninstall packages?
        if (allow_uninstall)
                solver_flags |= PAKFIRE_TRANSACTION_ALLOW_UNINSTALL;
index 863f5886891e1e4bf41d15ab912a3caf91d17112..8385b80005ef0b0bac5c334b9bdd5f8280dadbbf 100644 (file)
@@ -2056,7 +2056,7 @@ static int pakfire_build_install_source_package(
        }
 
        // Run the transaction
-       r = pakfire_transaction_run(transaction, 0);
+       r = pakfire_transaction_run(transaction);
        if (r)
                goto ERROR;
 
@@ -2209,7 +2209,7 @@ static int pakfire_build_mkimage_install_deps(struct pakfire_build* build,
        }
 
        // Run the transaction
-       r = pakfire_transaction_run(transaction, 0);
+       r = pakfire_transaction_run(transaction);
        if (r)
                goto ERROR;
 
index 264f2722d051f251b6436889813b28c0c38236c1..c8b988afc7c5a9ce2d8a43f2923cad2c88189959 100644 (file)
@@ -85,7 +85,7 @@ char* pakfire_transaction_dump(struct pakfire_transaction* transaction, size_t w
 void pakfire_transaction_set_status_callback(
        struct pakfire_transaction* transaction, pakfire_status_callback callback, void* data);
 
-int pakfire_transaction_run(struct pakfire_transaction* transaction, int flags);
+int pakfire_transaction_run(struct pakfire_transaction* transaction);
 
 int pakfire_transaction_download(struct pakfire_transaction* transaction);
 
index 2b1691dff36d8da74e27694e05589e41013ea9f6..3c84665879d7f711655406f49ebdc5ca80608007 100644 (file)
@@ -1959,7 +1959,7 @@ static int pakfire_perform_transaction(
                *changed = pakfire_transaction_count(transaction);
 
        // Run the transaction
-       r = pakfire_transaction_run(transaction, transaction_flags);
+       r = pakfire_transaction_run(transaction);
        if (r)
                goto ERROR;
 
@@ -2058,7 +2058,7 @@ static int pakfire_perform_transaction_simple(struct pakfire* pakfire, int solve
                *changed = pakfire_transaction_count(transaction);
 
        // Run the transaction
-       r = pakfire_transaction_run(transaction, 0);
+       r = pakfire_transaction_run(transaction);
        if (r)
                goto ERROR;
 
index 3c7ea113cd3f7fdcc5a43724aee9d0b2d9aa7ea3..841ed0b87f84a9bd75a406897546f98d694625fc 100644 (file)
@@ -1963,8 +1963,7 @@ ERROR:
        return r;
 }
 
-PAKFIRE_EXPORT int pakfire_transaction_run(
-               struct pakfire_transaction* transaction, int flags) {
+PAKFIRE_EXPORT int pakfire_transaction_run(struct pakfire_transaction* transaction) {
        char* dump = NULL;
        int r;
 
@@ -1996,10 +1995,6 @@ PAKFIRE_EXPORT int pakfire_transaction_run(
        if (r)
                goto ERROR;
 
-       // End here for a dry run
-       if (flags & PAKFIRE_TRANSACTION_DRY_RUN)
-               goto ERROR;
-
        // Download what we need
        r = pakfire_transaction_download(transaction);
        if (r)