]> git.ipfire.org Git - people/stevee/pakfire.git/commitdiff
pakfire: Drop interactive flag
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 16 Aug 2022 16:54:57 +0000 (16:54 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 16 Aug 2022 16:54:57 +0000 (16:54 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/_pakfire/pakfire.c
src/libpakfire/archive.c
src/libpakfire/build.c
src/libpakfire/include/pakfire/pakfire.h
src/libpakfire/pakfire.c
src/libpakfire/transaction.c
src/libpakfire/ui.c

index b2b8e19055b7daf05e2b64cf0c925df685f676c4..e80f1ffa6a0bfd55160099a4002fa96ab2f1df72 100644 (file)
@@ -138,7 +138,6 @@ static int Pakfire_init(PakfireObject* self, PyObject* args, PyObject* kwds) {
                "path",
                "arch",
                "logger",
-               "interactive",
                "offline",
                "conf",
                "build",
@@ -148,12 +147,11 @@ static int Pakfire_init(PakfireObject* self, PyObject* args, PyObject* kwds) {
        const char* path = NULL;
        const char* arch = NULL;
        const char* conf = NULL;
-       int interactive = 0;
        int offline = 0;
        int build = 0;
 
-       if (!PyArg_ParseTupleAndKeywords(args, kwds, "|zzOppzpO", kwlist,
-                       &path, &arch, &self->callbacks.log, &interactive, &offline, &conf, &build,
+       if (!PyArg_ParseTupleAndKeywords(args, kwds, "|zzOpzpO", kwlist,
+                       &path, &arch, &self->callbacks.log, &offline, &conf, &build,
                        &self->callbacks.confirm))
                return -1;
 
@@ -171,10 +169,6 @@ static int Pakfire_init(PakfireObject* self, PyObject* args, PyObject* kwds) {
 
        int flags = 0;
 
-       // Enable interactive mode
-       if (interactive)
-               flags |= PAKFIRE_FLAGS_INTERACTIVE;
-
        // Enable offline mode
        if (offline)
                flags |= PAKFIRE_FLAGS_OFFLINE;
index 5e029ca12e0989d21afdde138cea22378dc2ddaa..2730698f5f4fcae8d83f8400698d1b2790db03ba 100644 (file)
@@ -1000,11 +1000,9 @@ PAKFIRE_EXPORT int pakfire_archive_extract(struct pakfire_archive* archive, cons
        DEBUG(archive->pakfire, "Extracting %s to %s\n", archive->path, path);
 
        // Create a progressbar
-       if (pakfire_has_flag(archive->pakfire, PAKFIRE_FLAGS_INTERACTIVE)) {
-               r = pakfire_archive_extract_progressbar(archive, &progressbar);
-               if (r)
-                       goto ERROR;
-       }
+       r = pakfire_archive_extract_progressbar(archive, &progressbar);
+       if (r)
+               goto ERROR;
 
        // Open payload
        payload = pakfire_archive_open_payload(archive, &a, &size);
index 4883003c24421c03ef2c95f29c2badd7b432bf49..e87f698d056e8a58aa879c63b38974af9a2b153c 100644 (file)
@@ -800,7 +800,7 @@ static int pakfire_build_makefile(struct pakfire_build* build, const char* path)
                r = pakfire_build_stage(build, makefile, *stage);
                if (r) {
                        // Drop to a shell for debugging
-                       if (pakfire_has_flag(build->pakfire, PAKFIRE_FLAGS_INTERACTIVE))
+                       if (pakfire_has_flag(build->pakfire, PAKFIRE_BUILD_INTERACTIVE))
                                pakfire_build_shell(build);
 
                        goto ERROR;
index 3316c33b130d4d2249d2d323f8cde6aa39a5c940..5299abbd4aacf8afc7fce4b5240f8c58fa6a1625 100644 (file)
@@ -43,7 +43,6 @@ enum pakfire_digests {
 #include <pakfire/repolist.h>
 
 enum pakfire_flags {
-       PAKFIRE_FLAGS_INTERACTIVE               = (1 << 0),
        PAKFIRE_FLAGS_OFFLINE                   = (1 << 1),
        PAKFIRE_FLAGS_BUILD                             = (1 << 2),
 };
index 8e30665d9e70ebd0794ac44d6b2f2a04b9eba284..654bb7c42fcdca9059fcb6fae88b90b593310b03 100644 (file)
@@ -741,15 +741,6 @@ PAKFIRE_EXPORT int pakfire_create(struct pakfire** pakfire, const char* path,
        DEBUG(p, "  arch   = %s\n", pakfire_get_arch(p));
        DEBUG(p, "  path   = %s\n", pakfire_get_path(p));
 
-       // Automatically disable interactive mode
-       if (pakfire_has_flag(p, PAKFIRE_FLAGS_INTERACTIVE)) {
-               if (pakfire_tty_is_noninteractive()) {
-                       DEBUG(p, "Interactive mode disabled\n");
-
-                       flags &= ~PAKFIRE_FLAGS_INTERACTIVE;
-               }
-       }
-
        // Fetch sub UID/GIDs
        if (!pakfire_on_root(p)) {
                // UID
@@ -854,12 +845,6 @@ PAKFIRE_EXPORT int pakfire_create(struct pakfire** pakfire, const char* path,
        if (r)
                goto ERROR;
 
-       // Setup build stuff
-       if (pakfire_has_flag(p, PAKFIRE_FLAGS_BUILD)) {
-               // Builds are never interactive
-               p->flags &= ~PAKFIRE_FLAGS_INTERACTIVE;
-       }
-
        *pakfire = p;
 
        return 0;
@@ -1460,8 +1445,10 @@ int pakfire_confirm(struct pakfire* pakfire, const char* message, const char* qu
                return 0;
 
        // Skip this, if running in non-interactive mode
+#if 0
        if (!pakfire_has_flag(pakfire, PAKFIRE_FLAGS_INTERACTIVE))
                return 0;
+#endif
 
        // Run callback
        return pakfire->callbacks.confirm(
index 3070088ffa8f862c7295013bd26f768df4d52901..e931268c3ddf6a00173b9d06009fa930517b59da 100644 (file)
@@ -1268,12 +1268,10 @@ PAKFIRE_EXPORT int pakfire_transaction_run(
        char* dump = pakfire_transaction_dump(transaction, 80);
 
        // Check if we should continue
-       if (pakfire_has_flag(transaction->pakfire, PAKFIRE_FLAGS_INTERACTIVE)) {
-               r = pakfire_confirm(transaction->pakfire, dump, _("Is this okay? [y/N]"));
-               if (r) {
-                       ERROR(transaction->pakfire, "Transaction aborted upon user request\n");
-                       goto ERROR;
-               }
+       r = pakfire_confirm(transaction->pakfire, dump, _("Is this okay? [y/N]"));
+       if (r) {
+               ERROR(transaction->pakfire, "Transaction aborted upon user request\n");
+               goto ERROR;
        }
 
        // Write transaction dump to log
index f62f60371abc9aa4f93329f16ff8ea8ec3f64c81..befb2ad180c3b75eaa7f778105ab4caf0af7c32b 100644 (file)
@@ -77,10 +77,6 @@ END:
 
 static int pakfire_ui_enter_number(struct pakfire* pakfire, const char* question,
                unsigned int* choice, unsigned int min, unsigned int max) {
-       // Skip this, if running in non-interactive mode
-       if (!pakfire_has_flag(pakfire, PAKFIRE_FLAGS_INTERACTIVE))
-               return 0;
-
        char* line = NULL;
        size_t length = 0;
        char* remainder = NULL;
@@ -212,12 +208,6 @@ int pakfire_ui_pick_solution(struct pakfire* pakfire, struct pakfire_request* re
                free(solutions);
        }
 
-       // Skip this, if running in non-interactive mode
-       if (!pakfire_has_flag(pakfire, PAKFIRE_FLAGS_INTERACTIVE)) {
-               r = 1;
-               goto ERROR;
-       }
-
        unsigned int choice = 0;
 
        // Let the user choose which solution they want