[packages/poldek] Rel 6; show where duplicated sources are defined
arekm
arekm at pld-linux.org
Tue Apr 14 16:39:31 CEST 2026
commit 1c61b213ac038dd880c79058f8c68fb9b0397d8c
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Tue Apr 14 16:35:04 2026 +0200
Rel 6; show where duplicated sources are defined
poldek-dup-sources.patch | 78 ++++++++++++++++++++++++++++++++++++++++++++++++
poldek.spec | 4 ++-
2 files changed, 81 insertions(+), 1 deletion(-)
---
diff --git a/poldek.spec b/poldek.spec
index 270ced5..1e5b8e7 100644
--- a/poldek.spec
+++ b/poldek.spec
@@ -22,7 +22,7 @@
%define ver_rpm 1:4.14
%endif
-%define rel 5
+%define rel 6
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
@@ -54,6 +54,7 @@ Patch2: %{name}-ext-down-enable.patch
Patch3: %{name}-search-i-opt.patch
Patch4: %{name}-nocolor-cmp.patch
Patch5: %{name}-multilib-bare-name-install.patch
+Patch6: %{name}-dup-sources.patch
URL: http://poldek.pld-linux.org/
%{?with_rpm5:BuildRequires: %{db_pkg}-devel >= %{ver_db}}
BuildRequires: autoconf >= 2.63
@@ -232,6 +233,7 @@ Moduły języka Python dla poldka.
%patch -P3 -p1
%patch -P4 -p1
%patch -P5 -p1
+%patch -P6 -p1
%{__rm} doc/poldek.info
%{__rm} m4/libtool.m4 m4/lt*.m4
diff --git a/poldek-dup-sources.patch b/poldek-dup-sources.patch
new file mode 100644
index 0000000..ffe54ba
--- /dev/null
+++ b/poldek-dup-sources.patch
@@ -0,0 +1,78 @@
+commit 5c69a75ec8cc64b888a03fefffca9fe9b15c5cc7
+Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
+Date: Tue Apr 14 16:26:11 2026 +0200
+
+ Show config file origin when removing duplicated sources
+
+ Print which config file:line each duplicated source was defined at,
+ making it easy to find and fix the duplication.
+
+diff --git a/pkgdir/source.c b/pkgdir/source.c
+index 28c0049f..8d23592d 100644
+--- a/pkgdir/source.c
++++ b/pkgdir/source.c
+@@ -176,6 +176,7 @@ struct source *source_malloc(void)
+ //src->flags |= PKGSOURCE_PRI;
+ src->name = src->path = src->pkg_prefix = NULL;
+ src->group = src->dscr = NULL;
++ src->config_origin = NULL;
+ src->lc_lang = NULL;
+ src->_refcnt = 0;
+ src->exclude_path = n_array_new(4, free, (tn_fn_cmp)strcmp);
+@@ -213,6 +214,7 @@ struct source *source_clone(const struct source *src)
+ cp_str_ifnotnull(&nsrc->group, src->group);
+ cp_str_ifnotnull(&nsrc->lc_lang, src->lc_lang);
+ cp_str_ifnotnull(&nsrc->original_type, src->original_type);
++ cp_str_ifnotnull(&nsrc->config_origin, src->config_origin);
+
+ n_array_free(nsrc->exclude_path);
+ nsrc->exclude_path = n_ref(src->exclude_path);
+@@ -241,6 +243,7 @@ void source_free(struct source *src)
+ n_cfree(&src->group);
+ n_cfree(&src->lc_lang);
+ n_cfree(&src->original_type);
++ n_cfree(&src->config_origin);
+
+ if (src->exclude_path)
+ n_array_free(src->exclude_path);
+@@ -662,6 +665,10 @@ struct source *source_new_htcnf(const tn_hash *htcnf)
+ if (vs)
+ src->original_type = n_strdup(vs);
+
++ vs = poldek_conf_get(htcnf, "__file__line", NULL);
++ if (vs)
++ src->config_origin = n_strdup(vs);
++
+ get_conf_opt_list(htcnf, "exclude path", src->exclude_path);
+ get_conf_opt_list(htcnf, "ignore", src->ign_patterns);
+ return src;
+@@ -687,11 +694,16 @@ int source_cmp_uniq(const struct source *s1, const struct source *s2)
+ rc = strcmp(n1, n2);
+ }
+
+- if (rc == 0)
++ if (rc == 0) {
+ logn(LOGWARN, _("removed duplicated source %s%s%s"),
+ (s2->flags & PKGSOURCE_NAMED) ? s2->name : "",
+ (s2->flags & PKGSOURCE_NAMED) ? " -- " : "",
+ s2->path);
++ if (s1->config_origin || s2->config_origin)
++ logn(LOGWARN, _(" defined at %s and %s"),
++ s1->config_origin ? s1->config_origin : "(unknown)",
++ s2->config_origin ? s2->config_origin : "(unknown)");
++ }
+
+ return rc;
+ }
+diff --git a/pkgdir/source.h b/pkgdir/source.h
+index 6052ec25..b93639b5 100644
+--- a/pkgdir/source.h
++++ b/pkgdir/source.h
+@@ -55,6 +55,7 @@ struct source {
+ tn_array *exclude_path;
+ tn_array *ign_patterns; /* ignore package patterns */
+ char *original_type; /* type of source repo for this source */
++ char *config_origin; /* config file:line where source was defined */
+ unsigned subopt_flags;
+ int _refcnt;
+ char *group;
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/poldek.git/commitdiff/1c61b213ac038dd880c79058f8c68fb9b0397d8c
More information about the pld-cvs-commit
mailing list