[packages/poldek] Rel 10; per source ignores no longer overwrite global setting and just merge instead
arekm
arekm at pld-linux.org
Wed Apr 22 13:06:23 CEST 2026
commit 5d7ff70d11b90725413548173d72cc654ffcd142
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Wed Apr 22 13:05:59 2026 +0200
Rel 10; per source ignores no longer overwrite global setting and just merge instead
poldek-global-ignore-merges.patch | 145 ++++++++++++++++++++++++++++++++++++++
poldek.spec | 4 +-
2 files changed, 148 insertions(+), 1 deletion(-)
---
diff --git a/poldek.spec b/poldek.spec
index 623bf4a..5e55f6c 100644
--- a/poldek.spec
+++ b/poldek.spec
@@ -22,7 +22,7 @@
%define ver_rpm 1:4.14
%endif
-%define rel 9
+%define rel 10
Summary: RPM packages management helper tool
Summary(hu.UTF-8): RPM csomagkezelést segítő eszköz
Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
@@ -57,6 +57,7 @@ Patch5: %{name}-multilib-bare-name-install.patch
Patch6: %{name}-dup-sources.patch
Patch7: %{name}-env-columns-lines.patch
Patch8: %{name}-scoring-evr.patch
+Patch9: %{name}-global-ignore-merges.patch
URL: http://poldek.pld-linux.org/
%{?with_rpm5:BuildRequires: %{db_pkg}-devel >= %{ver_db}}
BuildRequires: autoconf >= 2.63
@@ -238,6 +239,7 @@ Moduły języka Python dla poldka.
%patch -P6 -p1
%patch -P7 -p1
%patch -P8 -p1
+%patch -P9 -p1
%{__rm} doc/poldek.info
%{__rm} m4/libtool.m4 m4/lt*.m4
diff --git a/poldek-global-ignore-merges.patch b/poldek-global-ignore-merges.patch
new file mode 100644
index 0000000..b644846
--- /dev/null
+++ b/poldek-global-ignore-merges.patch
@@ -0,0 +1,145 @@
+commit 3c95e64a0da01ebb1ab8ac5eb296317806af784f
+Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
+Date: Wed Apr 22 09:50:32 2026 +0200
+
+ fix: merge [global] ignore patterns into per-source lists
+
+ Previously a per-source `ignore = ...` entry silently replaced the
+ [global] ignore list for that source, so global patterns were dropped
+ whenever a source had any ignore line of its own. With
+ /etc/poldek/repos.d/*.conf shipping per-source `ignore = kernel-*`
+ lines by default, any [global] ignore (e.g. openjdk*-jdk) was dead.
+
+ Always concatenate the global list into each source's ign_patterns.
+
+diff --git a/doc/poldek.conf.xml b/doc/poldek.conf.xml
+index 86cb545b..828bb683 100644
+--- a/doc/poldek.conf.xml
++++ b/doc/poldek.conf.xml
+@@ -395,7 +395,10 @@ and [filename]*-source.conf[/filename], file getters are declared in
+
+ <option name="ignore" type="string" list="yes" default="vserver-packages" multiple="yes">
+ <description>
+- Ignore package list - packages fits given mask will be invisible.
++ Ignore package list - packages matching given masks will be invisible.
++ Patterns listed here apply to every [option]source[/option]; any
++ per-source [option]ignore[/option] entry adds more masks on top of this
++ global list rather than replacing it.
+ [screen]
+ ignore = *-smp-* foo*
+ ignore = vserver-packages
+@@ -634,7 +637,9 @@ Every repository is configured in its own [ source ] section.
+
+ <option name="ignore" type="string" list="yes" default="" multiple="yes">
+ <description>
+- Have the same meaning as [ global ] parameter. Example:
++ Additional ignore masks for this source, merged with the [ global ]
++ [option]ignore[/option] list (global patterns always apply; per-source
++ entries add more). Example:
+ [screen]
+ ignore = kernel*smp* dev
+ [/screen]
+diff --git a/lib_init.c b/lib_init.c
+index 297ec37e..88684654 100644
+--- a/lib_init.c
++++ b/lib_init.c
+@@ -245,12 +245,11 @@ struct source *do_source_new_htcnf(struct poldek_ctx *ctx,
+ (tn_fn_dup)strdup);
+ }
+
+- if (n_array_size(src->ign_patterns) == 0 && /* take global */
+- n_array_size(ctx->ts->ign_patterns) > 0) {
+-
+- n_array_free(src->ign_patterns);
+- src->ign_patterns = n_array_dup(ctx->ts->ign_patterns,
+- (tn_fn_dup)strdup);
++ if (n_array_size(ctx->ts->ign_patterns) > 0) {
++ n_array_concat_ex(src->ign_patterns, ctx->ts->ign_patterns,
++ (tn_fn_dup)strdup);
++ n_array_sort(src->ign_patterns);
++ n_array_uniq(src->ign_patterns);
+ }
+
+ return src;
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 04654c67..ff08ccb9 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -2,7 +2,7 @@ CPPFLAGS = @CPPFLAGS@ @CHECK_CFLAGS@
+ LDADD = $(top_builddir)/libpoldek.la @CHECK_LIBS@
+
+ check_PROGRAMS = test_match test_env test_pmdb test_op test_config \
+- test_store test_cmp test_booldeps
++ test_store test_cmp test_booldeps test_ignore_merge
+
+ TESTS = $(check_PROGRAMS)
+
+diff --git a/tests/test_ignore_merge.c b/tests/test_ignore_merge.c
+new file mode 100644
+index 00000000..97e061ed
+--- /dev/null
++++ b/tests/test_ignore_merge.c
+@@ -0,0 +1,63 @@
++#include "test.h"
++#include "poldek.h"
++#include "pkgdir/source.h"
++
++static int list_contains(tn_array *list, const char *s)
++{
++ int i;
++ for (i = 0; i < n_array_size(list); i++)
++ if (n_str_eq((const char *)n_array_nth(list, i), s))
++ return 1;
++ return 0;
++}
++
++START_TEST (test_ignore_merge) {
++ const char *path = "poldek_test_ignore_merge.conf";
++ FILE *f = fopen(path, "w");
++ fail_if(f == NULL, "cannot open %s for write", path);
++ fprintf(f,
++ "[global]\n"
++ "ignore = foo* baz*\n"
++ "\n"
++ "[source]\n"
++ "name = testsrc\n"
++ "type = pndir\n"
++ "url = file:///tmp/poldek-test-nonexistent\n"
++ "ignore = bar*\n");
++ fclose(f);
++
++ poldeklib_init();
++ struct poldek_ctx *ctx = poldek_new(0);
++ fail_if(ctx == NULL, "poldek_new failed");
++ fail_if(poldek_load_config(ctx, path, NULL, 0) == 0,
++ "load_config failed");
++ fail_if(poldek_setup(ctx) == 0, "poldek_setup failed");
++
++ tn_array *sources = poldek_get_sources(ctx);
++ fail_if(sources == NULL, "no sources?");
++
++ struct source *src = NULL;
++ int i;
++ for (i = 0; i < n_array_size(sources); i++) {
++ struct source *s = n_array_nth(sources, i);
++ if (s->name && n_str_eq(s->name, "testsrc")) {
++ src = s;
++ break;
++ }
++ }
++ fail_if(src == NULL, "testsrc not found in sources");
++
++ fail_unless(list_contains(src->ign_patterns, "foo*"),
++ "global 'foo*' missing from merged ign_patterns");
++ fail_unless(list_contains(src->ign_patterns, "baz*"),
++ "global 'baz*' missing from merged ign_patterns");
++ fail_unless(list_contains(src->ign_patterns, "bar*"),
++ "per-source 'bar*' missing from merged ign_patterns");
++
++ n_array_free(sources);
++ poldek_free(ctx);
++ unlink(path);
++}
++END_TEST
++
++NTEST_RUNNER("ignore_merge", test_ignore_merge);
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/poldek.git/commitdiff/5d7ff70d11b90725413548173d72cc654ffcd142
More information about the pld-cvs-commit
mailing list