From d77215c227f95765919aa2d1f1e14acab0e129d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Lach?= Date: Tue, 1 Aug 2023 08:28:48 -0400 Subject: [PATCH 1/6] - Made installing of flatpaks possible --- src/modules/packages/main.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/modules/packages/main.py b/src/modules/packages/main.py index 26ed30a19..063f45b58 100644 --- a/src/modules/packages/main.py +++ b/src/modules/packages/main.py @@ -337,6 +337,22 @@ class PMEntropy(PackageManager): # Doesn't need to update the system explicitly pass +class PMFlatpak(PackageManager): + backend = "flatpak" + + def install(self, pkgs, from_local=False): + check_target_env_call(["flatpak", "install"] + pkgs) + + def remove(self, pkgs): + check_target_env_call(["flatpak", "uninstall"] + pkgs) + check_target_env_call(["flatpak", "uninstall", "--unneeded"]) + + def update_db(self): + pass + + def update_system(self): + # Doesn't need to update the system explicitly + pass class PMLuet(PackageManager): backend = "luet" From cc90dcf556f20bdaea7648e06ff02d7865053afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Lach?= Date: Tue, 1 Aug 2023 08:30:05 -0400 Subject: [PATCH 2/6] Made possible to select flatpaks to install (fill list of netinstall) --- src/modules/flatpakinfo/CMakeLists.txt | 17 ++++ src/modules/flatpakinfo/ItemFlatpak.cpp | 32 ++++++++ src/modules/flatpakinfo/ItemFlatpak.h | 47 +++++++++++ src/modules/flatpakinfo/PackagePool.cpp | 90 ++++++++++++++++++++++ src/modules/flatpakinfo/PackagePool.h | 15 ++++ src/modules/flatpakinfo/flatpakInfo.cfg | 8 ++ src/modules/flatpakinfo/flatpakInfoJob.cpp | 59 ++++++++++++++ src/modules/flatpakinfo/flatpakInfoJob.h | 43 +++++++++++ src/modules/flatpakinfo/module.desc | 7 ++ 9 files changed, 318 insertions(+) create mode 100644 src/modules/flatpakinfo/CMakeLists.txt create mode 100644 src/modules/flatpakinfo/ItemFlatpak.cpp create mode 100644 src/modules/flatpakinfo/ItemFlatpak.h create mode 100644 src/modules/flatpakinfo/PackagePool.cpp create mode 100644 src/modules/flatpakinfo/PackagePool.h create mode 100644 src/modules/flatpakinfo/flatpakInfo.cfg create mode 100644 src/modules/flatpakinfo/flatpakInfoJob.cpp create mode 100644 src/modules/flatpakinfo/flatpakInfoJob.h create mode 100644 src/modules/flatpakinfo/module.desc diff --git a/src/modules/flatpakinfo/CMakeLists.txt b/src/modules/flatpakinfo/CMakeLists.txt new file mode 100644 index 000000000..4c6c31ddf --- /dev/null +++ b/src/modules/flatpakinfo/CMakeLists.txt @@ -0,0 +1,17 @@ +# === This file is part of Calamares - === +# +# SPDX-FileCopyrightText: 2020 Adriaan de Groot +# SPDX-License-Identifier: BSD-2-Clause +# +calamares_add_plugin(flatpakInfo + TYPE job + EXPORT_MACRO PLUGINDLLEXPORT_PRO + SOURCES + flatpakInfoJob.h + ItemFlatpak.h + PackagePool.h + flatpakInfoJob.cpp + ItemFlatpak.cpp + PackagePool.cpp + SHARED_LIB +) diff --git a/src/modules/flatpakinfo/ItemFlatpak.cpp b/src/modules/flatpakinfo/ItemFlatpak.cpp new file mode 100644 index 000000000..842fafd7c --- /dev/null +++ b/src/modules/flatpakinfo/ItemFlatpak.cpp @@ -0,0 +1,32 @@ +#include +#include +#include + +#include "utils/Logger.h" +#include "utils/Variant.h" +#include "ItemFlatpak.h" + +PackageItem +fromFlatpak( const QVariantMap& item_map ) +{ + // check if it is installed + PackageItem item(CalamaresUtils::getString( item_map, "appstream" )); + int status; + int pid = fork(); + if (0 == pid) + { + execlp("flatpak", "flatpak", "info", item.getAppStreamId().toStdString().c_str(), NULL); + } + waitpid(pid, &status, 0); + + if (WEXITSTATUS(status) == 0) + { + item.setInstalled(true); + } + else + { + item.setInstalled(false); + } + + return item; +} diff --git a/src/modules/flatpakinfo/ItemFlatpak.h b/src/modules/flatpakinfo/ItemFlatpak.h new file mode 100644 index 000000000..a76793748 --- /dev/null +++ b/src/modules/flatpakinfo/ItemFlatpak.h @@ -0,0 +1,47 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Calamares is Free Software: see the License-Identifier above. + * + */ + +#ifndef ITEMFLATPAK_H +#define ITEMFLATPAK_H + +#include +#include +#include + +class PackageItem +{ +public: + PackageItem(QString appstreamid): + appstreamid(appstreamid), + installed(false) + { + + } + QString& getAppStreamId(void) + { + return this->appstreamid; + } + void setInstalled(bool installed) + { + this->installed = installed; + } + bool getInstalled(void) + { + return this->installed; + } +private: + QString appstreamid; + bool installed; +}; + + + +PackageItem fromFlatpak( const QVariantMap& map ); + +#endif diff --git a/src/modules/flatpakinfo/PackagePool.cpp b/src/modules/flatpakinfo/PackagePool.cpp new file mode 100644 index 000000000..88d73b513 --- /dev/null +++ b/src/modules/flatpakinfo/PackagePool.cpp @@ -0,0 +1,90 @@ + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include "GlobalStorage.h" +#include "JobQueue.h" +#include "packages/Globals.h" +#include "utils/Logger.h" +#include "utils/Variant.h" +#include "ItemFlatpak.h" + + +void serializePackagesInfo(void); + +QVector < PackageItem > packages; + +void downloadPackagesInfo(void) +{ + int pid; + int pipefd[2]; + bool poolOk = false; + pipe(pipefd); + + pid = fork(); + if (0 == pid) + { + close(pipefd[0]); + dup2(pipefd[1], 1); + execlp("flatpak", "flatpak", "search", "--columns=application", "", NULL); + exit(1); + } + close(pipefd[1]); + + std::string line; + __gnu_cxx::stdio_filebuf filebuf(pipefd[0], std::ios::in); + std::istream stream(&filebuf); + + while (!stream.eof()) + { + getline(stream, line); + QVariantMap item_map; + + //std::cerr << line; + item_map.insert("appstream", QVariant(QString::fromStdString(line))); + item_map.insert("id", QVariant(QString::fromStdString(line))); + + PackageItem item = fromFlatpak(item_map); + packages.append(item); + } + + waitpid(pid, nullptr, 0); + + serializePackagesInfo(); +} + +void serializePackagesInfo(void) +{ + QList changedValue; + auto* gs = Calamares::JobQueue::instance()->globalStorage(); + + // If an earlier packagechooser instance added this data to global storage, combine them + if ( gs->contains( "groups" ) ) + { + auto selectedOrig = gs->value( "groups" ); + + changedValue = selectedOrig.toList(); + for (auto current: packages) + { + QStringList selfInstall; + QVariantMap newValue; + newValue.insert("name", current.getAppStreamId()); + + selfInstall.append(current.getAppStreamId()); + newValue.insert("packages", selfInstall); + changedValue.append(newValue); + } + + gs->remove( "groups" ); + } + gs->insert( "gropus", changedValue ); +} diff --git a/src/modules/flatpakinfo/PackagePool.h b/src/modules/flatpakinfo/PackagePool.h new file mode 100644 index 000000000..611212458 --- /dev/null +++ b/src/modules/flatpakinfo/PackagePool.h @@ -0,0 +1,15 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2021 Evan James + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Calamares is Free Software: see the License-Identifier above. + */ + +#ifndef ___PACKAGEPOOL__H___ +#define ___PACKAGEPOOL__H___ + +void downloadPackagesInfo(void); +void serializePackagesInfo(void); + +#endif diff --git a/src/modules/flatpakinfo/flatpakInfo.cfg b/src/modules/flatpakinfo/flatpakInfo.cfg new file mode 100644 index 000000000..92aec69c6 --- /dev/null +++ b/src/modules/flatpakinfo/flatpakInfo.cfg @@ -0,0 +1,8 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +# +# The zfs module creates the zfs pools and datasets +# +# +# +--- diff --git a/src/modules/flatpakinfo/flatpakInfoJob.cpp b/src/modules/flatpakinfo/flatpakInfoJob.cpp new file mode 100644 index 000000000..d537e1082 --- /dev/null +++ b/src/modules/flatpakinfo/flatpakInfoJob.cpp @@ -0,0 +1,59 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2021 Evan James + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Calamares is Free Software: see the License-Identifier above. + * + */ + +#include "flatpakInfoJob.h" + +#include "utils/CalamaresUtilsSystem.h" +#include "utils/Logger.h" +#include "utils/Variant.h" + +#include "GlobalStorage.h" +#include "JobQueue.h" +#include "Settings.h" + +#include + +#include + +#include "PackagePool.h" + +FlatpakInfoJob::FlatpakInfoJob( QObject* parent ) + : Calamares::CppJob( parent ) +{ +} + +FlatpakInfoJob::~FlatpakInfoJob() {} + +QString +FlatpakInfoJob::prettyName() const +{ + return tr( "Fill netinstall with flatpak packages" ); +} + + +Calamares::JobResult +FlatpakInfoJob::exec() +{ + QVariantList partitions; + Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage(); + + + downloadPackagesInfo(); + + return Calamares::JobResult::ok(); +} + + +void +FlatpakInfoJob::setConfigurationMap( const QVariantMap& map ) +{ + +} + +CALAMARES_PLUGIN_FACTORY_DEFINITION( FlatpakInfoJobFactory, registerPlugin< FlatpakInfoJob >(); ) diff --git a/src/modules/flatpakinfo/flatpakInfoJob.h b/src/modules/flatpakinfo/flatpakInfoJob.h new file mode 100644 index 000000000..0a273699d --- /dev/null +++ b/src/modules/flatpakinfo/flatpakInfoJob.h @@ -0,0 +1,43 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2021 Evan James + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Calamares is Free Software: see the License-Identifier above. + * + */ + +#ifndef FLATPAKINFOJOB_H +#define FLATPAKINFOJOB_H + +#include +#include +#include + +#include "CppJob.h" + +#include "utils/PluginFactory.h" + +#include "DllMacro.h" + +/** @brief Create zpools and zfs datasets + * + */ +class PLUGINDLLEXPORT FlatpakInfoJob : public Calamares::CppJob +{ + Q_OBJECT + +public: + explicit FlatpakInfoJob( QObject* parent = nullptr ); + ~FlatpakInfoJob() override; + + QString prettyName() const override; + + Calamares::JobResult exec() override; + + void setConfigurationMap( const QVariantMap& configurationMap ) override; +}; + +CALAMARES_PLUGIN_FACTORY_DECLARATION( FlatpakInfoJobFactory ) + +#endif // ZFSJOB_H diff --git a/src/modules/flatpakinfo/module.desc b/src/modules/flatpakinfo/module.desc new file mode 100644 index 000000000..b5ac4cbd6 --- /dev/null +++ b/src/modules/flatpakinfo/module.desc @@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +--- +type: "job" +name: "flatpakinfo" +interface: "qtplugin" +load: "libcalamares_job_flatpakInfo.so" From 3666e3af7b02702566b82e7fae69607b229518a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Lach?= Date: Wed, 2 Aug 2023 10:28:50 -0400 Subject: [PATCH 3/6] Revert "Made possible to select flatpaks to install (fill list of netinstall)" This reverts commit cc90dcf556f20bdaea7648e06ff02d7865053afc. --- src/modules/flatpakinfo/CMakeLists.txt | 17 ---- src/modules/flatpakinfo/ItemFlatpak.cpp | 32 -------- src/modules/flatpakinfo/ItemFlatpak.h | 47 ----------- src/modules/flatpakinfo/PackagePool.cpp | 90 ---------------------- src/modules/flatpakinfo/PackagePool.h | 15 ---- src/modules/flatpakinfo/flatpakInfo.cfg | 8 -- src/modules/flatpakinfo/flatpakInfoJob.cpp | 59 -------------- src/modules/flatpakinfo/flatpakInfoJob.h | 43 ----------- src/modules/flatpakinfo/module.desc | 7 -- 9 files changed, 318 deletions(-) delete mode 100644 src/modules/flatpakinfo/CMakeLists.txt delete mode 100644 src/modules/flatpakinfo/ItemFlatpak.cpp delete mode 100644 src/modules/flatpakinfo/ItemFlatpak.h delete mode 100644 src/modules/flatpakinfo/PackagePool.cpp delete mode 100644 src/modules/flatpakinfo/PackagePool.h delete mode 100644 src/modules/flatpakinfo/flatpakInfo.cfg delete mode 100644 src/modules/flatpakinfo/flatpakInfoJob.cpp delete mode 100644 src/modules/flatpakinfo/flatpakInfoJob.h delete mode 100644 src/modules/flatpakinfo/module.desc diff --git a/src/modules/flatpakinfo/CMakeLists.txt b/src/modules/flatpakinfo/CMakeLists.txt deleted file mode 100644 index 4c6c31ddf..000000000 --- a/src/modules/flatpakinfo/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -# === This file is part of Calamares - === -# -# SPDX-FileCopyrightText: 2020 Adriaan de Groot -# SPDX-License-Identifier: BSD-2-Clause -# -calamares_add_plugin(flatpakInfo - TYPE job - EXPORT_MACRO PLUGINDLLEXPORT_PRO - SOURCES - flatpakInfoJob.h - ItemFlatpak.h - PackagePool.h - flatpakInfoJob.cpp - ItemFlatpak.cpp - PackagePool.cpp - SHARED_LIB -) diff --git a/src/modules/flatpakinfo/ItemFlatpak.cpp b/src/modules/flatpakinfo/ItemFlatpak.cpp deleted file mode 100644 index 842fafd7c..000000000 --- a/src/modules/flatpakinfo/ItemFlatpak.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include -#include -#include - -#include "utils/Logger.h" -#include "utils/Variant.h" -#include "ItemFlatpak.h" - -PackageItem -fromFlatpak( const QVariantMap& item_map ) -{ - // check if it is installed - PackageItem item(CalamaresUtils::getString( item_map, "appstream" )); - int status; - int pid = fork(); - if (0 == pid) - { - execlp("flatpak", "flatpak", "info", item.getAppStreamId().toStdString().c_str(), NULL); - } - waitpid(pid, &status, 0); - - if (WEXITSTATUS(status) == 0) - { - item.setInstalled(true); - } - else - { - item.setInstalled(false); - } - - return item; -} diff --git a/src/modules/flatpakinfo/ItemFlatpak.h b/src/modules/flatpakinfo/ItemFlatpak.h deleted file mode 100644 index a76793748..000000000 --- a/src/modules/flatpakinfo/ItemFlatpak.h +++ /dev/null @@ -1,47 +0,0 @@ -/* === This file is part of Calamares - === - * - * SPDX-FileCopyrightText: 2019 Adriaan de Groot - * SPDX-License-Identifier: GPL-3.0-or-later - * - * Calamares is Free Software: see the License-Identifier above. - * - */ - -#ifndef ITEMFLATPAK_H -#define ITEMFLATPAK_H - -#include -#include -#include - -class PackageItem -{ -public: - PackageItem(QString appstreamid): - appstreamid(appstreamid), - installed(false) - { - - } - QString& getAppStreamId(void) - { - return this->appstreamid; - } - void setInstalled(bool installed) - { - this->installed = installed; - } - bool getInstalled(void) - { - return this->installed; - } -private: - QString appstreamid; - bool installed; -}; - - - -PackageItem fromFlatpak( const QVariantMap& map ); - -#endif diff --git a/src/modules/flatpakinfo/PackagePool.cpp b/src/modules/flatpakinfo/PackagePool.cpp deleted file mode 100644 index 88d73b513..000000000 --- a/src/modules/flatpakinfo/PackagePool.cpp +++ /dev/null @@ -1,90 +0,0 @@ - -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -#include "GlobalStorage.h" -#include "JobQueue.h" -#include "packages/Globals.h" -#include "utils/Logger.h" -#include "utils/Variant.h" -#include "ItemFlatpak.h" - - -void serializePackagesInfo(void); - -QVector < PackageItem > packages; - -void downloadPackagesInfo(void) -{ - int pid; - int pipefd[2]; - bool poolOk = false; - pipe(pipefd); - - pid = fork(); - if (0 == pid) - { - close(pipefd[0]); - dup2(pipefd[1], 1); - execlp("flatpak", "flatpak", "search", "--columns=application", "", NULL); - exit(1); - } - close(pipefd[1]); - - std::string line; - __gnu_cxx::stdio_filebuf filebuf(pipefd[0], std::ios::in); - std::istream stream(&filebuf); - - while (!stream.eof()) - { - getline(stream, line); - QVariantMap item_map; - - //std::cerr << line; - item_map.insert("appstream", QVariant(QString::fromStdString(line))); - item_map.insert("id", QVariant(QString::fromStdString(line))); - - PackageItem item = fromFlatpak(item_map); - packages.append(item); - } - - waitpid(pid, nullptr, 0); - - serializePackagesInfo(); -} - -void serializePackagesInfo(void) -{ - QList changedValue; - auto* gs = Calamares::JobQueue::instance()->globalStorage(); - - // If an earlier packagechooser instance added this data to global storage, combine them - if ( gs->contains( "groups" ) ) - { - auto selectedOrig = gs->value( "groups" ); - - changedValue = selectedOrig.toList(); - for (auto current: packages) - { - QStringList selfInstall; - QVariantMap newValue; - newValue.insert("name", current.getAppStreamId()); - - selfInstall.append(current.getAppStreamId()); - newValue.insert("packages", selfInstall); - changedValue.append(newValue); - } - - gs->remove( "groups" ); - } - gs->insert( "gropus", changedValue ); -} diff --git a/src/modules/flatpakinfo/PackagePool.h b/src/modules/flatpakinfo/PackagePool.h deleted file mode 100644 index 611212458..000000000 --- a/src/modules/flatpakinfo/PackagePool.h +++ /dev/null @@ -1,15 +0,0 @@ -/* === This file is part of Calamares - === - * - * SPDX-FileCopyrightText: 2021 Evan James - * SPDX-License-Identifier: GPL-3.0-or-later - * - * Calamares is Free Software: see the License-Identifier above. - */ - -#ifndef ___PACKAGEPOOL__H___ -#define ___PACKAGEPOOL__H___ - -void downloadPackagesInfo(void); -void serializePackagesInfo(void); - -#endif diff --git a/src/modules/flatpakinfo/flatpakInfo.cfg b/src/modules/flatpakinfo/flatpakInfo.cfg deleted file mode 100644 index 92aec69c6..000000000 --- a/src/modules/flatpakinfo/flatpakInfo.cfg +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-FileCopyrightText: no -# SPDX-License-Identifier: CC0-1.0 -# -# The zfs module creates the zfs pools and datasets -# -# -# ---- diff --git a/src/modules/flatpakinfo/flatpakInfoJob.cpp b/src/modules/flatpakinfo/flatpakInfoJob.cpp deleted file mode 100644 index d537e1082..000000000 --- a/src/modules/flatpakinfo/flatpakInfoJob.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* === This file is part of Calamares - === - * - * SPDX-FileCopyrightText: 2021 Evan James - * SPDX-License-Identifier: GPL-3.0-or-later - * - * Calamares is Free Software: see the License-Identifier above. - * - */ - -#include "flatpakInfoJob.h" - -#include "utils/CalamaresUtilsSystem.h" -#include "utils/Logger.h" -#include "utils/Variant.h" - -#include "GlobalStorage.h" -#include "JobQueue.h" -#include "Settings.h" - -#include - -#include - -#include "PackagePool.h" - -FlatpakInfoJob::FlatpakInfoJob( QObject* parent ) - : Calamares::CppJob( parent ) -{ -} - -FlatpakInfoJob::~FlatpakInfoJob() {} - -QString -FlatpakInfoJob::prettyName() const -{ - return tr( "Fill netinstall with flatpak packages" ); -} - - -Calamares::JobResult -FlatpakInfoJob::exec() -{ - QVariantList partitions; - Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage(); - - - downloadPackagesInfo(); - - return Calamares::JobResult::ok(); -} - - -void -FlatpakInfoJob::setConfigurationMap( const QVariantMap& map ) -{ - -} - -CALAMARES_PLUGIN_FACTORY_DEFINITION( FlatpakInfoJobFactory, registerPlugin< FlatpakInfoJob >(); ) diff --git a/src/modules/flatpakinfo/flatpakInfoJob.h b/src/modules/flatpakinfo/flatpakInfoJob.h deleted file mode 100644 index 0a273699d..000000000 --- a/src/modules/flatpakinfo/flatpakInfoJob.h +++ /dev/null @@ -1,43 +0,0 @@ -/* === This file is part of Calamares - === - * - * SPDX-FileCopyrightText: 2021 Evan James - * SPDX-License-Identifier: GPL-3.0-or-later - * - * Calamares is Free Software: see the License-Identifier above. - * - */ - -#ifndef FLATPAKINFOJOB_H -#define FLATPAKINFOJOB_H - -#include -#include -#include - -#include "CppJob.h" - -#include "utils/PluginFactory.h" - -#include "DllMacro.h" - -/** @brief Create zpools and zfs datasets - * - */ -class PLUGINDLLEXPORT FlatpakInfoJob : public Calamares::CppJob -{ - Q_OBJECT - -public: - explicit FlatpakInfoJob( QObject* parent = nullptr ); - ~FlatpakInfoJob() override; - - QString prettyName() const override; - - Calamares::JobResult exec() override; - - void setConfigurationMap( const QVariantMap& configurationMap ) override; -}; - -CALAMARES_PLUGIN_FACTORY_DECLARATION( FlatpakInfoJobFactory ) - -#endif // ZFSJOB_H diff --git a/src/modules/flatpakinfo/module.desc b/src/modules/flatpakinfo/module.desc deleted file mode 100644 index b5ac4cbd6..000000000 --- a/src/modules/flatpakinfo/module.desc +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-FileCopyrightText: no -# SPDX-License-Identifier: CC0-1.0 ---- -type: "job" -name: "flatpakinfo" -interface: "qtplugin" -load: "libcalamares_job_flatpakInfo.so" From ec30fe1b61584d0b1fcb714bb5e39864a18b0704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Lach?= Date: Wed, 2 Aug 2023 17:42:11 +0200 Subject: [PATCH 4/6] - Force flatpak do not asks questions --- src/modules/packages/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/packages/main.py b/src/modules/packages/main.py index 063f45b58..039250559 100644 --- a/src/modules/packages/main.py +++ b/src/modules/packages/main.py @@ -341,11 +341,11 @@ class PMFlatpak(PackageManager): backend = "flatpak" def install(self, pkgs, from_local=False): - check_target_env_call(["flatpak", "install"] + pkgs) + check_target_env_call(["flatpak", "install", "--assumeyes"] + pkgs) def remove(self, pkgs): - check_target_env_call(["flatpak", "uninstall"] + pkgs) - check_target_env_call(["flatpak", "uninstall", "--unneeded"]) + check_target_env_call(["flatpak", "uninstall", "--noninteractive"] + pkgs) + check_target_env_call(["flatpak", "uninstall", "--noninteractive", "--unneeded"]) def update_db(self): pass From 79085b5e80444f0a7d6390b649b0fef0af863f07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Lach?= Date: Thu, 3 Aug 2023 19:08:55 +0200 Subject: [PATCH 5/6] - Uninstalling flatpak is possible (repair bad command) --- src/modules/packages/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/packages/main.py b/src/modules/packages/main.py index 039250559..49c7f0e4c 100644 --- a/src/modules/packages/main.py +++ b/src/modules/packages/main.py @@ -345,7 +345,7 @@ class PMFlatpak(PackageManager): def remove(self, pkgs): check_target_env_call(["flatpak", "uninstall", "--noninteractive"] + pkgs) - check_target_env_call(["flatpak", "uninstall", "--noninteractive", "--unneeded"]) + check_target_env_call(["flatpak", "uninstall", "--noninteractive", "--unused"]) def update_db(self): pass From ab7b78e9ced49765cc0c57193068d1b1e6cc2342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Lach?= Date: Sat, 5 Aug 2023 15:55:00 +0200 Subject: [PATCH 6/6] Newer flatpak will remove unused, so do not instruct for do that --- src/modules/packages/main.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/modules/packages/main.py b/src/modules/packages/main.py index 49c7f0e4c..77753cbe9 100644 --- a/src/modules/packages/main.py +++ b/src/modules/packages/main.py @@ -345,7 +345,6 @@ class PMFlatpak(PackageManager): def remove(self, pkgs): check_target_env_call(["flatpak", "uninstall", "--noninteractive"] + pkgs) - check_target_env_call(["flatpak", "uninstall", "--noninteractive", "--unused"]) def update_db(self): pass