Compare commits

..

No commits in common. "c8" and "c9s" have entirely different histories.
c8 ... c9s

12 changed files with 871 additions and 197 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

14
.gitignore vendored
View File

@ -1 +1,13 @@
SOURCES/microdnf-3.8.0.tar.gz /microdnf-1.tar.gz
/microdnf-2.tar.gz
/microdnf-3.tar.gz
/microdnf-3.0.1.tar.gz
/microdnf-3.0.2.tar.gz
/microdnf-3.3.0.tar.gz
/microdnf-3.4.0.tar.gz
/microdnf-3.5.0.tar.gz
/microdnf-3.5.1.tar.gz
/microdnf-3.6.0.tar.gz
/microdnf-3.7.1.tar.gz
/microdnf-3.8.0.tar.gz
/microdnf-3.9.1.tar.gz

View File

@ -1 +0,0 @@
c59c103e4cf88420e13dfd5ab9cc1558f0723227 SOURCES/microdnf-3.8.0.tar.gz

View File

@ -0,0 +1,103 @@
From 61c94be108ed5b525ab330175523a224b8922b70 Mon Sep 17 00:00:00 2001
From: Emil Renner Berthing <esmil@mailme.dk>
Date: Wed, 1 Jun 2022 15:07:27 +0200
Subject: [PATCH 1/2] Revert "leaves: Treat recommends as dependencies when
install_weak_deps=True"
This reverts commit 5275fe83fa5a941f994a81a2546ae1d8dc095e96.
---
dnf/plugins/leaves/dnf-command-leaves.c | 60 +++++++++++--------------
1 file changed, 27 insertions(+), 33 deletions(-)
diff --git a/dnf/plugins/leaves/dnf-command-leaves.c b/dnf/plugins/leaves/dnf-command-leaves.c
index 7789dfc..f264f65 100644
--- a/dnf/plugins/leaves/dnf-command-leaves.c
+++ b/dnf/plugins/leaves/dnf-command-leaves.c
@@ -80,35 +80,8 @@ gtree_dnf_package_cmp (gconstpointer a, gconstpointer b)
return dnf_package_cmp ((DnfPackage *)a, (DnfPackage *)b);
}
-static void
-add_edges (GHashTable *edges, HyQuery query, GTree *pkg2idx, DnfReldepList *deps)
-{
- const gint ndeps = dnf_reldep_list_count (deps);
-
- // resolve dependencies and add an edge if there is exactly one package satisfying it
- for (gint j = 0; j < ndeps; j++)
- {
- DnfReldep *dep = dnf_reldep_list_index (deps, j);
-
- hy_query_filter_reldep (query, HY_PKG_PROVIDES, dep);
- g_autoptr(GPtrArray) ppkgs = hy_query_run (query);
- hy_query_clear (query);
- dnf_reldep_free (dep);
-
- if (ppkgs->len != 1)
- continue;
-
- const DnfPackage *ppkg = g_ptr_array_index (ppkgs, 0);
- GTreeNode *node = g_tree_lookup_node (pkg2idx, ppkg);;
- g_assert (node);
- g_hash_table_insert (edges, g_tree_node_value (node), NULL);
- }
-
- dnf_reldep_list_free (deps);
-}
-
static GPtrArray *
-build_graph (HyQuery query, const GPtrArray *pkgs, gboolean recommends)
+build_graph (HyQuery query, const GPtrArray *pkgs)
{
// create pkg2idx to map DnfPackages to their index in pkgs
g_autoptr(GTree) pkg2idx = g_tree_new (gtree_dnf_package_cmp);
@@ -121,13 +94,34 @@ build_graph (HyQuery query, const GPtrArray *pkgs, gboolean recommends)
GPtrArray *graph = g_ptr_array_new_full (pkgs->len, g_free);
g_autoptr(GHashTable) edges = g_hash_table_new (g_direct_hash, g_direct_equal);
+ // for each package resolve its dependencies and add an edge if there is
+ // exactly one package satisfying it
for (guint i = 0; i < pkgs->len; i++)
{
DnfPackage *pkg = g_ptr_array_index (pkgs, i);
- add_edges (edges, query, pkg2idx, dnf_package_get_requires (pkg));
- if (recommends)
- add_edges (edges, query, pkg2idx, dnf_package_get_recommends (pkg));
- g_hash_table_remove (edges, GUINT_TO_POINTER (i)); // remove self-edges
+ g_autoptr(DnfReldepList) reqs = dnf_package_get_requires (pkg);
+
+ const gint nreqs = dnf_reldep_list_count (reqs);
+ for (gint j = 0; j < nreqs; j++)
+ {
+ DnfReldep *req = dnf_reldep_list_index (reqs, j);
+
+ hy_query_filter_reldep (query, HY_PKG_PROVIDES, req);
+ g_autoptr(GPtrArray) ppkgs = hy_query_run (query);
+ hy_query_clear (query);
+ dnf_reldep_free (req);
+
+ if (ppkgs->len != 1)
+ continue;
+
+ DnfPackage *ppkg = g_ptr_array_index (ppkgs, 0);
+ GTreeNode *node = g_tree_lookup_node (pkg2idx, ppkg);;
+ g_assert (node);
+ guint idx = GPOINTER_TO_UINT (g_tree_node_value (node));
+ if (idx != i) // don't add self-edges
+ g_hash_table_insert (edges, GUINT_TO_POINTER (idx), NULL);
+ }
+
g_ptr_array_add (graph, idx_array_from_set (edges));
}
@@ -341,7 +335,7 @@ dnf_command_leaves_run (DnfCommand *cmd,
g_ptr_array_sort (pkgs, gptrarr_dnf_package_cmp);
// build the directed graph of dependencies
- g_autoptr(GPtrArray) graph = build_graph (query, pkgs, dnf_context_get_install_weak_deps ());
+ g_autoptr(GPtrArray) graph = build_graph (query, pkgs);
// run Kosaraju's algorithm to find strongly connected components
// withhout any incoming edges
--
2.37.3

View File

@ -0,0 +1,522 @@
From f4aa2e7c3021775e38d259fe818a94fca4f4fbfc Mon Sep 17 00:00:00 2001
From: Nicola Sella <nsella@redhat.com>
Date: Mon, 31 Oct 2022 10:34:23 +0100
Subject: [PATCH 2/2] Revert "Add leaves command"
This reverts commit d1be5fd8fbf07d1204403f641044c83f940ea08a.
---
dnf/CMakeLists.txt | 6 -
dnf/meson.build | 9 -
dnf/plugins/leaves/dnf-command-leaves.c | 386 ------------------
.../leaves/dnf-command-leaves.gresource.xml | 6 -
dnf/plugins/leaves/dnf-command-leaves.h | 31 --
dnf/plugins/leaves/leaves.plugin | 9 -
6 files changed, 447 deletions(-)
delete mode 100644 dnf/plugins/leaves/dnf-command-leaves.c
delete mode 100644 dnf/plugins/leaves/dnf-command-leaves.gresource.xml
delete mode 100644 dnf/plugins/leaves/dnf-command-leaves.h
delete mode 100644 dnf/plugins/leaves/leaves.plugin
diff --git a/dnf/CMakeLists.txt b/dnf/CMakeLists.txt
index a85906b..89cd1e4 100644
--- a/dnf/CMakeLists.txt
+++ b/dnf/CMakeLists.txt
@@ -35,11 +35,6 @@ glib_compile_resources (DNF_COMMAND_REPOQUERY plugins/repoquery/dnf-command-repo
INTERNAL)
list (APPEND DNF_COMMAND_REPOQUERY "plugins/repoquery/dnf-command-repoquery.c")
-glib_compile_resources (DNF_COMMAND_LEAVES plugins/leaves/dnf-command-leaves.gresource.xml
- C_PREFIX dnf_command_leaves
- INTERNAL)
-list (APPEND DNF_COMMAND_LEAVES "plugins/leaves/dnf-command-leaves.c")
-
glib_compile_resources (DNF_COMMAND_CLEAN plugins/clean/dnf-command-clean.gresource.xml
C_PREFIX dnf_command_clean
INTERNAL)
@@ -80,7 +75,6 @@ add_executable (microdnf dnf-main.c ${DNF_SRCS}
${DNF_COMMAND_DISTROSYNC}
${DNF_COMMAND_REPOLIST}
${DNF_COMMAND_REPOQUERY}
- ${DNF_COMMAND_LEAVES}
${DNF_COMMAND_CLEAN}
${DNF_COMMAND_DOWNLOAD}
${DNF_COMMAND_MAKECACHE}
diff --git a/dnf/meson.build b/dnf/meson.build
index 074d347..daf8fd7 100644
--- a/dnf/meson.build
+++ b/dnf/meson.build
@@ -66,15 +66,6 @@ microdnf_srcs = [
),
'plugins/repoquery/dnf-command-repoquery.c',
- # leaves
- gnome.compile_resources(
- 'dnf-leaves',
- 'plugins/leaves/dnf-command-leaves.gresource.xml',
- c_name : 'dnf_command_leaves',
- source_dir : 'plugins/leaves',
- ),
- 'plugins/leaves/dnf-command-leaves.c',
-
# clean
gnome.compile_resources(
'dnf-clean',
diff --git a/dnf/plugins/leaves/dnf-command-leaves.c b/dnf/plugins/leaves/dnf-command-leaves.c
deleted file mode 100644
index f264f65..0000000
--- a/dnf/plugins/leaves/dnf-command-leaves.c
+++ /dev/null
@@ -1,386 +0,0 @@
-/* dnf-command-leaves.c
- *
- * Copyright © 2022 Emil Renner Berthing <esmil@mailme.dk>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "dnf-command-leaves.h"
-
-typedef struct {
- guint len;
- guint idx[];
-} IdxArray;
-
-static IdxArray *
-idx_array_new (guint len)
-{
- return g_malloc0 (G_STRUCT_OFFSET (IdxArray, idx) + len * sizeof (guint));
-}
-
-static void
-idx_array_add (IdxArray *arr, guint idx)
-{
- arr->idx[arr->len++] = idx;
-}
-
-static gboolean
-idx_array_from_set_iter (gpointer key, gpointer value, gpointer user_data)
-{
- IdxArray *arr = user_data;
- idx_array_add (arr, GPOINTER_TO_UINT (key));
- return TRUE;
-}
-
-static gint
-idx_array_compare_func (gconstpointer a, gconstpointer b, gpointer user_data)
-{
- guint x = *(const guint *)a;
- guint y = *(const guint *)b;
-
- if (x < y)
- return -1;
- return x > y;
-}
-
-static IdxArray *
-idx_array_copy (const guint *idx, guint len)
-{
- IdxArray *arr = idx_array_new (len);
- arr->len = len;
- for (guint i = 0; i < len; i++)
- arr->idx[i] = idx[i];
- g_qsort_with_data (arr->idx, arr->len, sizeof (*arr->idx), idx_array_compare_func, NULL);
- return arr;
-}
-
-static IdxArray *
-idx_array_from_set (GHashTable *set)
-{
- IdxArray *arr = idx_array_new (g_hash_table_size (set));
- g_hash_table_foreach_remove (set, idx_array_from_set_iter, arr);
- g_qsort_with_data (arr->idx, arr->len, sizeof (*arr->idx), idx_array_compare_func, NULL);
- return arr;
-}
-
-static gint
-gtree_dnf_package_cmp (gconstpointer a, gconstpointer b)
-{
- return dnf_package_cmp ((DnfPackage *)a, (DnfPackage *)b);
-}
-
-static GPtrArray *
-build_graph (HyQuery query, const GPtrArray *pkgs)
-{
- // create pkg2idx to map DnfPackages to their index in pkgs
- g_autoptr(GTree) pkg2idx = g_tree_new (gtree_dnf_package_cmp);
- for (guint i = 0; i < pkgs->len; i++)
- {
- DnfPackage *pkg = g_ptr_array_index (pkgs, i);
- g_tree_insert (pkg2idx, pkg, GUINT_TO_POINTER (i));
- }
-
- GPtrArray *graph = g_ptr_array_new_full (pkgs->len, g_free);
- g_autoptr(GHashTable) edges = g_hash_table_new (g_direct_hash, g_direct_equal);
-
- // for each package resolve its dependencies and add an edge if there is
- // exactly one package satisfying it
- for (guint i = 0; i < pkgs->len; i++)
- {
- DnfPackage *pkg = g_ptr_array_index (pkgs, i);
- g_autoptr(DnfReldepList) reqs = dnf_package_get_requires (pkg);
-
- const gint nreqs = dnf_reldep_list_count (reqs);
- for (gint j = 0; j < nreqs; j++)
- {
- DnfReldep *req = dnf_reldep_list_index (reqs, j);
-
- hy_query_filter_reldep (query, HY_PKG_PROVIDES, req);
- g_autoptr(GPtrArray) ppkgs = hy_query_run (query);
- hy_query_clear (query);
- dnf_reldep_free (req);
-
- if (ppkgs->len != 1)
- continue;
-
- DnfPackage *ppkg = g_ptr_array_index (ppkgs, 0);
- GTreeNode *node = g_tree_lookup_node (pkg2idx, ppkg);;
- g_assert (node);
- guint idx = GPOINTER_TO_UINT (g_tree_node_value (node));
- if (idx != i) // don't add self-edges
- g_hash_table_insert (edges, GUINT_TO_POINTER (idx), NULL);
- }
-
- g_ptr_array_add (graph, idx_array_from_set (edges));
- }
-
- return graph;
-}
-
-static GPtrArray *
-reverse_graph (const GPtrArray *graph)
-{
- g_autofree guint *len = g_malloc0 (graph->len * sizeof (*len));
-
- for (guint i = 0; i < graph->len; i++)
- {
- const IdxArray *edges = g_ptr_array_index (graph, i);
-
- for (guint j = 0; j < edges->len; j++)
- len[edges->idx[j]]++;
- }
-
- GPtrArray *rgraph = g_ptr_array_new_full (graph->len, g_free);
- for (guint i = 0; i < graph->len; i++)
- g_ptr_array_add (rgraph, idx_array_new (len[i]));
-
- for (guint i = 0; i < graph->len; i++)
- {
- const IdxArray *edges = g_ptr_array_index (graph, i);
-
- for (guint j = 0; j < edges->len; j++)
- {
- IdxArray *redges = g_ptr_array_index (rgraph, edges->idx[j]);
- idx_array_add (redges, i);
- }
- }
-
- return rgraph;
-}
-
-static GPtrArray *
-kosaraju (const GPtrArray *graph)
-{
- const guint N = graph->len;
- g_autofree guint *rstack = g_malloc (N * sizeof (*rstack));
- g_autofree guint *stack = g_malloc (N * sizeof (*stack));
- g_autofree gboolean *tag = g_malloc0 (N * sizeof (*tag));
- guint r = N;
- guint top = 0;
-
- // do depth-first searches in the graph and push nodes to rstack
- // "on the way up" until all nodes have been pushed.
- // tag nodes as they're processed so we don't visit them more than once
- for (guint i = 0; i < N; i++)
- {
- if (tag[i])
- continue;
-
- guint u = i;
- guint j = 0;
- tag[u] = TRUE;
- while (true)
- {
- const IdxArray *edges = g_ptr_array_index (graph, u);
- if (j < edges->len)
- {
- const guint v = edges->idx[j++];
- if (!tag[v])
- {
- rstack[top] = j;
- stack[top++] = u;
- u = v;
- j = 0;
- tag[u] = TRUE;
- }
- }
- else
- {
- rstack[--r] = u;
- if (!top)
- break;
- u = stack[--top];
- j = rstack[top];
- }
- }
- }
- g_assert (r == 0);
-
- // now searches beginning at nodes popped from rstack in the graph with all
- // edges reversed will give us the strongly connected components.
- // this time all nodes are tagged, so let's remove the tags as we visit each
- // node.
- // the incoming edges to each component is the union of incoming edges to
- // each node in the component minus the incoming edges from component nodes
- // themselves.
- // if there are no such incoming edges the component is a leaf and we
- // add it to the array of leaves.
- g_autoptr(GPtrArray) rgraph = reverse_graph (graph);
- g_autoptr(GHashTable) sccredges = g_hash_table_new (g_direct_hash, g_direct_equal);
- GPtrArray *leaves = g_ptr_array_new_with_free_func (g_free);
- for (; r < N; r++)
- {
- guint u = rstack[r];
- if (!tag[u])
- continue;
-
- stack[top++] = u;
- tag[u] = FALSE;
- guint s = N;
- while (top)
- {
- u = stack[--s] = stack[--top];
- const IdxArray *redges = g_ptr_array_index (rgraph, u);
- for (guint j = 0; j < redges->len; j++)
- {
- const guint v = redges->idx[j];
- g_hash_table_insert (sccredges, GUINT_TO_POINTER (v), NULL);
- if (!tag[v])
- continue;
-
- stack[top++] = v;
- tag[v] = FALSE;
- }
- }
-
- for (guint i = s; i < N; i++)
- g_hash_table_remove (sccredges, GUINT_TO_POINTER (stack[i]));
-
- if (g_hash_table_size (sccredges) == 0)
- g_ptr_array_add (leaves, idx_array_copy (&stack[s], N - s));
- else
- g_hash_table_remove_all (sccredges);
- }
-
- return leaves;
-}
-
-struct _DnfCommandLeaves
-{
- PeasExtensionBase parent_instance;
-};
-
-static void dnf_command_leaves_iface_init (DnfCommandInterface *iface);
-
-G_DEFINE_DYNAMIC_TYPE_EXTENDED (DnfCommandLeaves,
- dnf_command_leaves,
- PEAS_TYPE_EXTENSION_BASE,
- 0,
- G_IMPLEMENT_INTERFACE (DNF_TYPE_COMMAND,
- dnf_command_leaves_iface_init))
-
-static void
-dnf_command_leaves_init (DnfCommandLeaves *self)
-{
-}
-
-static void
-disable_available_repos (DnfContext *ctx)
-{
- const GPtrArray *repos = dnf_context_get_repos (ctx);
-
- for (guint i = 0; i < repos->len; ++i)
- {
- DnfRepo *repo = g_ptr_array_index (repos, i);
- dnf_repo_set_enabled (repo, DNF_REPO_ENABLED_NONE);
- }
-}
-
-static gint
-gptrarr_dnf_package_cmp (gconstpointer a, gconstpointer b)
-{
- DnfPackage *const *x = a;
- DnfPackage *const *y = b;
- return dnf_package_cmp (*x, *y);
-}
-
-static gint
-gptrarr_first_package_cmp (gconstpointer a, gconstpointer b)
-{
- IdxArray *const *x = a;
- IdxArray *const *y = b;
- guint i = (*x)->idx[0];
- guint j = (*y)->idx[0];
-
- if (i < j)
- return -1;
- return i > j;
-}
-
-static gboolean
-dnf_command_leaves_run (DnfCommand *cmd,
- int argc,
- char *argv[],
- GOptionContext *opt_ctx,
- DnfContext *ctx,
- GError **error)
-{
- if (!g_option_context_parse (opt_ctx, &argc, &argv, error))
- return FALSE;
-
- // only look at installed packages
- disable_available_repos (ctx);
- if (!dnf_context_setup_sack_with_flags (ctx,
- dnf_context_get_state (ctx),
- DNF_CONTEXT_SETUP_SACK_FLAG_NONE,
- error)) {
-
- return FALSE;
- }
-
- // get a sorted array of all installed packages
- hy_autoquery HyQuery query = hy_query_create (dnf_context_get_sack (ctx));
- g_autoptr(GPtrArray) pkgs = hy_query_run (query);
- g_ptr_array_sort (pkgs, gptrarr_dnf_package_cmp);
-
- // build the directed graph of dependencies
- g_autoptr(GPtrArray) graph = build_graph (query, pkgs);
-
- // run Kosaraju's algorithm to find strongly connected components
- // withhout any incoming edges
- g_autoptr(GPtrArray) leaves = kosaraju (graph);
- g_ptr_array_sort (leaves, gptrarr_first_package_cmp);
-
- // print the packages grouped by their components
- for (guint i = 0; i < leaves->len; i++)
- {
- const IdxArray *scc = g_ptr_array_index (leaves, i);
- gchar mark = '-';
-
- for (guint j = 0; j < scc->len; j++)
- {
- DnfPackage *pkg = g_ptr_array_index (pkgs, scc->idx[j]);
- g_print ("%c %s\n", mark, dnf_package_get_nevra (pkg));
- mark = ' ';
- }
- }
-
- return TRUE;
-}
-
-static void
-dnf_command_leaves_class_init (DnfCommandLeavesClass *klass)
-{
-}
-
-static void
-dnf_command_leaves_iface_init (DnfCommandInterface *iface)
-{
- iface->run = dnf_command_leaves_run;
-}
-
-static void
-dnf_command_leaves_class_finalize (DnfCommandLeavesClass *klass)
-{
-}
-
-G_MODULE_EXPORT void
-dnf_command_leaves_register_types (PeasObjectModule *module)
-{
- dnf_command_leaves_register_type (G_TYPE_MODULE (module));
-
- peas_object_module_register_extension_type (module,
- DNF_TYPE_COMMAND,
- DNF_TYPE_COMMAND_LEAVES);
-}
diff --git a/dnf/plugins/leaves/dnf-command-leaves.gresource.xml b/dnf/plugins/leaves/dnf-command-leaves.gresource.xml
deleted file mode 100644
index b679fb6..0000000
--- a/dnf/plugins/leaves/dnf-command-leaves.gresource.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gresources>
- <gresource prefix="/org/fedoraproject/dnf/plugins/leaves">
- <file>leaves.plugin</file>
- </gresource>
-</gresources>
diff --git a/dnf/plugins/leaves/dnf-command-leaves.h b/dnf/plugins/leaves/dnf-command-leaves.h
deleted file mode 100644
index e78c857..0000000
--- a/dnf/plugins/leaves/dnf-command-leaves.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* dnf-command-leaves.h
- *
- * Copyright © 2022 Emil Renner Berthing <esmil@mailme.dk>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#pragma once
-
-#include "dnf-command.h"
-#include <libpeas/peas.h>
-
-G_BEGIN_DECLS
-
-#define DNF_TYPE_COMMAND_LEAVES dnf_command_leaves_get_type ()
-G_DECLARE_FINAL_TYPE (DnfCommandLeaves, dnf_command_leaves, DNF, COMMAND_LEAVES, PeasExtensionBase)
-
-G_MODULE_EXPORT void dnf_command_leaves_register_types (PeasObjectModule *module);
-
-G_END_DECLS
diff --git a/dnf/plugins/leaves/leaves.plugin b/dnf/plugins/leaves/leaves.plugin
deleted file mode 100644
index 4deb320..0000000
--- a/dnf/plugins/leaves/leaves.plugin
+++ /dev/null
@@ -1,9 +0,0 @@
-[Plugin]
-Module = command_leaves
-Embedded = dnf_command_leaves_register_types
-Name = leaves
-Description = List installed packages not required by other installed packages
-Authors = Emil Renner Berthing <esmil@mailme.dk>
-License = GPL-2.0+
-Copyright = Copyright (C) 2022 Emil Renner Berthing
-X-Command-Syntax = leaves
--
2.37.3

View File

@ -1,41 +0,0 @@
From f60d1b6930b4602a24ae2ce4078795268384c87d Mon Sep 17 00:00:00 2001
From: Pavla Kratochvilova <pkratoch@redhat.com>
Date: Thu, 20 May 2021 11:06:27 +0200
Subject: [PATCH] Revert "Don't set default value of "assumeyes" to TRUE"
This reverts commit 9e028a51fea6eceee0de6e155374a0bd81289e14.
---
dnf/dnf-main.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/dnf/dnf-main.c b/dnf/dnf-main.c
index 661dfee..cfaf714 100644
--- a/dnf/dnf-main.c
+++ b/dnf/dnf-main.c
@@ -595,6 +595,14 @@ main (int argc,
{
dnf_conf_main_set_option ("assumeyes", DNF_CONF_COMMANDLINE, "1", NULL);
}
+ else
+ {
+ enum DnfConfPriority priority;
+ dnf_utils_conf_main_get_bool_opt ("assumeyes", &priority);
+ /* microdnf has a default value for "assumeyes" equal to TRUE, backward compatibility */
+ if (priority == DNF_CONF_DEFAULT)
+ dnf_conf_main_set_option ("assumeyes", DNF_CONF_COMMANDLINE, "1", NULL);
+ }
}
const gchar *cmd_name = get_command (&argc, argv);
@@ -609,6 +617,8 @@ main (int argc,
g_set_prgname (prg_name);
g_autofree gchar *help = g_option_context_get_help (opt_ctx, TRUE, NULL);
g_print ("%s", help);
+ g_print ("Notes:\n");
+ g_print (" The \"--assumeyes\" option is turned on by default. To switch it to an interactive prompt, specify \"assumeyes=0\" in the configuration file.\n\n");
goto out;
}
--
libgit2 1.0.1

View File

@ -1,154 +0,0 @@
%global libdnf_version 0.62.0
Name: microdnf
Version: 3.8.0
Release: 2%{?dist}
Summary: Lightweight implementation of DNF in C
License: GPLv2+
URL: https://github.com/rpm-software-management/microdnf
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Patch1: 0001-Revert-Dont-set-default-value-of-assumeyes-to-TRUE.patch
BuildRequires: gcc
BuildRequires: meson >= 0.36.0
BuildRequires: pkgconfig(glib-2.0) >= 2.44.0
BuildRequires: pkgconfig(gobject-2.0) >= 2.44.0
BuildRequires: pkgconfig(libpeas-1.0) >= 1.20.0
BuildRequires: pkgconfig(libdnf) >= %{libdnf_version}
BuildRequires: pkgconfig(smartcols)
BuildRequires: help2man
Requires: libdnf%{?_isa} >= %{libdnf_version}
%if 0%{?rhel} > 8 || 0%{?fedora}
# Ensure DNF package manager configuration skeleton is installed
Requires: dnf-data
%endif
%description
Micro DNF is a lightweight C implementation of DNF, designed to be used
for doing simple packaging actions when you don't need full-blown DNF and
you want the tiniest useful environments possible.
That is, you don't want any interpreter stack and you want the most
minimal environment possible so you can build up to exactly what you need.
%prep
%autosetup -p1
%build
%meson
%meson_build
%install
%meson_install
%check
%meson_test
%files
%license COPYING
%doc README.md
%{_mandir}/man8/microdnf.8*
%{_bindir}/%{name}
%changelog
* Thu May 20 2021 Pavla Kratochvilova <pkratoch@redhat.com> - 3.8.0-2
- Revert: Don't set default value of "assumeyes" to TRUE
* Wed May 19 2021 Pavla Kratochvilova <pkratoch@redhat.com> - 3.8.0-1
- Update to 3.8.0
- Don't set default value of "assumeyes" to TRUE
- Support for user confirmation and assumeyes, assumeno, defaultyes
- Add commands: distro-sync, makecache
- Add subcommands support
- Add support for command aliases
- Added alias "update" to "upgrade" command
- Relicense to GPLv2+
- Add support for setting allow_vendor_change
- [download] Support for "--resolve", "--alldeps" and "--archlist=" arguments
- [download] several optimizations
- Support "--setopt=keepcache=0/1"
- Extend "--setopt" to support repository options
* Mon Feb 08 2021 Nicola Sella <nsella@redhat.com> - 3.4.0-4
- Print info about obsoleted packages before transaction (RhBug:1855542)
* Fri Jan 29 2021 Nicola Sella <nsella@redhat.com> - 3.4.0-3
- Patch: Add support for setting a platform module ID
- Rename "update" command to "upgrade", "update" remain as compatibility alias
* Fri Jan 15 2021 Nicola Sella <nsella@redhat.com> - 3.4.0-2
- Patch: Add module enable/disable/reset command
* Mon Apr 06 2020 Ales Matej <amatej@redhat.com> - 3.4.0-1
- Update to 3.4.0
- Fix: do not download metadata in remove command
- Add reinstall command
- Add "--setopt=tsflags=test" support
- Add "--setopt=reposdir=<path>" and "--setopt=varsdir=<path1>,<path2>,..." support
- Add "--config=<path_to_config_file>" support
- Add "--disableplugin", "--enableplugin" support (RhBug:1781126)
- Add "--noplugins" support
- Add "--setopt=cachedir=<path_to_cache_directory>" support
- Add "--installroot=<path_to_installroot_directory>" support
- Add "--refresh" support
- Support "install_weak_deps" conf option and "--setopt=install_weak_deps=0/1"
- Respect reposdir from conf file
- Respect "metadata_expire" conf file opton (RhBug:1771147)
- [repolist] Print padding spaces only if output is terminal
* Mon Jan 13 2020 Ales Matej <amatej@redhat.com> - 3.0.1-8
- Fix: Don't print lines with (null) in transaction report (RhBug:1691353)
* Tue Dec 17 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 3.0.1-7
- Add dependency on libdnf
* Tue Dec 17 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 3.0.1-6
- Allow downgrade for all transactions microdnf does (RhBug:1725863)
* Tue Nov 26 2019 Ales Matej <amatej@redhat.com> - 3.0.1-5
- Add repolist command (RhBug:1584952)
- Add repoquery command (RhBug:1769245)
* Wed Nov 13 2019 Ales Matej <amatej@redhat.com> - 3.0.1-4
- Add support of best behavior (RhBug:1679476)
- Add support for --releasever (RhBug:1591627)
* Fri Aug 30 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 3.0.1-3
- Fix microdnf --help coredump (RhBug:1744979)
* Thu Aug 01 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 3.0.1-2
- Fix minor memory leaks (RhBug:1702283)
- Use help2man to generate a man page (RhBug:1612520)
* Wed Jun 27 2018 Jaroslav Mracek <jmracek@redhat.com> - 3.0.1-1
- Update to 3.0.1
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Jul 22 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3-2
- No CMake, only meson
* Thu Jun 01 2017 Igor Gnatenko <ignatenko@redhat.com> - 3-1
- Update to 3
* Fri May 12 2017 Igor Gnatenko <ignatenko@redhat.com> - 2-3
- Apply few patches from upstream
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Thu Feb 02 2017 Igor Gnatenko <ignatenko@redhat.com> - 2-1
- Update to 2
* Mon Dec 12 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1-1
- Initial package

1
ci.fmf Normal file
View File

@ -0,0 +1 @@
resultsdb-testcase: separate

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/internal/CI-Tier-1.functional}

203
microdnf.spec Normal file
View File

@ -0,0 +1,203 @@
%global libdnf_version 0.62.0
Name: microdnf
Version: 3.9.1
Release: 3%{?dist}
Summary: Lightweight implementation of DNF in C
License: GPLv2+
URL: https://github.com/rpm-software-management/microdnf
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Patch1: 0001-Revert-leaves-Treat-recommends-as-dependencies.patch
Patch2: 0002-Revert-Add-leaves-command.patch
BuildRequires: gcc
BuildRequires: meson >= 0.36.0
BuildRequires: pkgconfig(glib-2.0) >= 2.44.0
BuildRequires: pkgconfig(gobject-2.0) >= 2.44.0
BuildRequires: pkgconfig(libpeas-1.0) >= 1.20.0
BuildRequires: pkgconfig(libdnf) >= %{libdnf_version}
BuildRequires: pkgconfig(smartcols)
BuildRequires: help2man
Requires: libdnf%{?_isa} >= %{libdnf_version}
%if 0%{?rhel} > 8 || 0%{?fedora}
# Ensure DNF package manager configuration skeleton is installed
Requires: dnf-data
%endif
%description
Micro DNF is a lightweight C implementation of DNF, designed to be used
for doing simple packaging actions when you don't need full-blown DNF and
you want the tiniest useful environments possible.
That is, you don't want any interpreter stack and you want the most
minimal environment possible so you can build up to exactly what you need.
%prep
%autosetup -p1
%build
%meson
%meson_build
%install
%meson_install
%check
%meson_test
%files
%license COPYING
%doc README.md
%{_mandir}/man8/microdnf.8*
%{_bindir}/%{name}
%changelog
* Fri Jan 06 2023 Nicola Sella <nsella@redhat.com> - 3.9.1-3
- Bump release (needed to rebuild)
* Mon Oct 31 2022 Nicola Sella <nsella@redhat.com> - 3.9.1-2
- Revert: leaves: Treat recommends as dependencies when install_weak_deps=True
- Revert: Add leaves command
* Thu Sep 22 2022 Lukas Hrazky <lhrazky@redhat.com> - 3.9.1-1
- Update to 3.9.1
- leaves: Treat recommends as dependencies when install_weak_deps=True
- Add leaves command
- Remove non-breaking space from "Size" column (RhBug:2010676)
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 3.8.0-3
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Tue Jun 22 2021 Mohan Boddu <mboddu@redhat.com> - 3.8.0-2
- Rebuilt for RHEL 9 BETA for openssl 3.0
Related: rhbz#1971065
* Wed Jun 02 2021 Pavla Kratochvilova <pkratoch@redhat.com> - 3.8.0-1
- Update to 3.8.0
- distrosync: Fix style issues and plugin build with Meson
- Add distro-sync subcommand
- Add "makecache" command
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 3.7.1-2
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Mon Mar 01 2021 Nicola Sella <nsella@redhat.com> - 3.7.1-1
- Update to 3.7.1
- [download] fix: unwanted dependency on newer glib
- [download] Support for "--resolve" and "--alldeps" arguments
- [download] New get_packages_query function
- Support "--setopt=keepcache=0/1"
- [download] Support "--archlist=" argument
- [download] Move package download code to "download_packages" function
- [download] several optimizations
- Don't set default value of "assumeyes" to TRUE
- Support for user confirmation and assumeyes, assumeno, defaultyes
- Extend "--setopt" to support repository options
- Added alias "update" to "upgrade" command
- Command "update" renamed to "upgrade"
- Add support for command aliases
- dnf-data requirement only for Fedora and future RHEL
- Relicense to GPLv2+ [errata corrige: not in 3.5.1-1]
- Sync summary and description from openSUSE [errata corrige: not in 3.6.0-1]
* Thu Jan 28 2021 Nicola Sella <nsella@redhat.com> - 3.6.0-1
- Update to 3.6.0
- spec: Sync summary and description from openSUSE
- Add support for setting a platform module ID
- Add dependency for DNF configurations skeleton
- Add support for setting allow_vendor_change
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.5.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Thu Nov 26 2020 Nicola Sella <nsella@redhat.com> - 3.5.1-1
- Update to 3.5.1
- Relicense to GPLv2+
- Bump minimum version of libdnf in CMake and Meson
* Fri Nov 13 2020 Nicola Sella <nsella@redhat.com> - 3.5.0-1
- Update to 3.5.0
- Add module enable and disable commands
- Add reports of module changes
- Add "module enable" command
- Add subcommands support
- Print info about obsoleted packages before transaction (RhBug:1855542)
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.4.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Wed Jan 15 2020 Ales Matej <amatej@redhat.com> - 3.4.0-1
- Add reinstall command
- Add "--setopt=tsflags=test" support
- Add "--setopt=reposdir=<path>" and "--setopt=varsdir=<path1>,<path2>,..." support
- Add "--config=<path_to_config_file>" support
- Add "--disableplugin", "--enableplugin" support (RhBug:1781126)
- Add "--noplugins" support
- Add "--setopt=cachedir=<path_to_cache_directory>" support
- Add "--installroot=<path_to_installroot_directory>" support
- Add "--refresh" support
- Support "install_weak_deps" conf option and "--setopt=install_weak_deps=0/1"
- Respect reposdir from conf file
- Respect "metadata_expire" conf file opton (RhBug:1771147)
- Fix: Don't print lines with (null) in transaction report (RhBug:1691353)
- [repolist] Print padding spaces only if output is terminal
* Fri Nov 29 2019 Ales Matej <amatej@redhat.com> - 3.3.0-1
- Update to 3.3.0
- Fix: do not download metadata in remove command
- Add repolist command (RhBug:1584952)
- Add repoquery command (RhBug:1769245)
* Wed Nov 06 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 3.0.2-1
- Update to 3.0.2
- Add support for --releasever (RhBug:1591627)
- Fix minor memory leaks (RhBug:1702283)
- Use help2man to generate a man page (RhBug:1612520)
- Allow downgrade for all transactions microdnf does (RhBug:1725863)
- Add options --best and --nobest for transactions (RhBug:1679476)
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Jun 27 2018 Jaroslav Mracek <jmracek@redhat.com> - 3.0.1-1
- Update to 3.0.1
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Jul 22 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3-2
- No CMake, only meson
* Thu Jun 01 2017 Igor Gnatenko <ignatenko@redhat.com> - 3-1
- Update to 3
* Fri May 12 2017 Igor Gnatenko <ignatenko@redhat.com> - 2-3
- Apply few patches from upstream
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Thu Feb 02 2017 Igor Gnatenko <ignatenko@redhat.com> - 2-1
- Update to 2
* Mon Dec 12 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1-1
- Initial package

View File

@ -0,0 +1,21 @@
summary: Internal CI-Tier-1 tests plan
discover:
- name: microdnf
how: fmf
filter: 'tag: CI-Tier-1'
url: https://pkgs.devel.redhat.com/git/tests/microdnf
- name: dnf-upstream-test-suite
how: fmf
url: https://pkgs.devel.redhat.com/git/tests/dnf
test:
- /Sanity/run-upstream-tests-on-rhel/TC#0570162
- name: integration-with-modularity-unaware-tools
how: fmf
url: https://pkgs.devel.redhat.com/git/tests/dnf
test:
- /Sanity/integration-with-modularity-unaware-tools
execute:
how: tmt
adjust:
enabled: false
when: distro == centos-stream or distro == fedora

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (microdnf-3.9.1.tar.gz) = 2e3327819d5e872d1efdd5d3b936707d7befe78ce4b59c6b981c257648b13ba13a2df81e6d606a628f2c0bba712e53e138e1e6132ec3a61110a0ad1e6946be69