public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rpm] pmatilai-v6: Fix invalid path passed to parametric macro generators
@ 2026-11-23  9:33 Panu Matilainen
  0 siblings, 0 replies; only message in thread
From: Panu Matilainen @ 2026-11-23  9:33 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/rpm
Branch : pmatilai-v6
Commit : 6715757024ed1fee3acff7392ee5b67989363be0
Author : Panu Matilainen <pmatilai@redhat.com>
Date   : 2020-04-06T14:40:01+03:00
Stats  : +57/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rpm/c/6715757024ed1fee3acff7392ee5b67989363be0?branch=pmatilai-v6

Log:
Fix invalid path passed to parametric macro generators

---
diff --git a/0001-rpmfc-Do-not-prepend-buildroot-to-a-path-for-paramet.patch b/0001-rpmfc-Do-not-prepend-buildroot-to-a-path-for-paramet.patch
new file mode 100644
index 0000000..c60fd36
--- /dev/null
+++ b/0001-rpmfc-Do-not-prepend-buildroot-to-a-path-for-paramet.patch
@@ -0,0 +1,52 @@
+From 10127cdb2364de2c1408950a25b730920e665689 Mon Sep 17 00:00:00 2001
+Message-Id: <10127cdb2364de2c1408950a25b730920e665689.1586173014.git.pmatilai@redhat.com>
+From: Igor Raits <i.gnatenko.brain@gmail.com>
+Date: Sun, 5 Apr 2020 16:21:40 +0200
+Subject: [PATCH] rpmfc: Do not prepend buildroot to a path for parametric
+ generator
+
+'fn' already contains full path to a file, so no need to prepend it once
+more. This is actually breaking things.
+
+Before:
+D: Calling %{__pythonname_provides %{?__pythonname_provides_opts}}() on /home/brain/rpmbuild/BUILDROOT/hello-1-1.fc33.x86_64//home/brain/rpmbuild/BUILDROOT/hello-1-1.fc33.x86_64/usr/share/applications/org.gnome.Terminal.desktop
+
+After:
+D: Calling %{__pythonname_provides %{?__pythonname_provides_opts}}() on /home/brain/rpmbuild/BUILDROOT/hello-1-1.fc33.x86_64/usr/share/applications/org.gnome.Terminal.desktop
+
+Fixes: https://github.com/rpm-software-management/rpm/issues/1162
+Signed-off-by: Igor Raits <i.gnatenko.brain@gmail.com>
+---
+ build/rpmfc.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/build/rpmfc.c b/build/rpmfc.c
+index f6c358676..10c380ee9 100644
+--- a/build/rpmfc.c
++++ b/build/rpmfc.c
+@@ -533,20 +533,18 @@ static ARGV_t runCall(const char *cmd,
+ 		     const char *buildRoot, const char *fn)
+ {
+     ARGV_t output = NULL;
+-    char *path = rstrscat(NULL, buildRoot ? buildRoot : "", "/", fn, NULL);
+ 
+     if (_rpmfc_debug)
+-	rpmlog(RPMLOG_DEBUG, "Calling %s() on %s\n", cmd, path);
++	rpmlog(RPMLOG_DEBUG, "Calling %s() on %s\n", cmd, fn);
+ 
+     /* Hack to pass in the path as what looks like a macro argument */
+-    rpmPushMacroFlags(NULL, "1", NULL, path, 1, RPMMACRO_LITERAL);
++    rpmPushMacroFlags(NULL, "1", NULL, fn, 1, RPMMACRO_LITERAL);
+     char *exp = rpmExpand(cmd, NULL);
+     rpmPopMacro(NULL, "1");
+     if (*exp)
+ 	argvSplit(&output, exp, "\n\r");
+     free(exp);
+ 
+-    free(path);
+     return output;
+ }
+ 
+-- 
+2.25.1
+

diff --git a/rpm.spec b/rpm.spec
index 6830a28..d086e75 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -25,7 +25,7 @@
 
 %global rpmver 4.15.90
 %global snapver git14971
-%global rel 3
+%global rel 4
 
 %global srcver %{version}%{?snapver:-%{snapver}}
 %global srcdir %{?snapver:testing}%{!?snapver:%{name}-%(echo %{version} | cut -d'.' -f1-2).x}
@@ -58,6 +58,7 @@ Patch6: 0001-find-debuginfo.sh-decompress-DWARF-compressed-ELF-se.patch
 
 # Patches already upstream:
 Patch100: 0001-Unset-SOURCE_DATE_EPOCH-for-the-test-suite.patch
+Patch101: 0001-rpmfc-Do-not-prepend-buildroot-to-a-path-for-paramet.patch
 
 # These are not yet upstream
 Patch906: rpm-4.7.1-geode-i686.patch
@@ -523,6 +524,9 @@ make check || (cat tests/rpmtests.log; exit 1)
 %doc doc/librpm/html/*
 
 %changelog
+* Mon Apr 06 2020 Panu Matilainen <pmatilai@redhat.com> - 4.15.90-0.git14971.4
+- Fix invalid path passed to parametric macro generators
+
 * Thu Apr 02 2020 Panu Matilainen <pmatilai@redhat.com> - 4.15.90-0.git14971.3
 - Fix db lock files not getting packaged
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-23  9:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23  9:33 [rpms/rpm] pmatilai-v6: Fix invalid path passed to parametric macro generators Panu Matilainen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox