public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Panu Matilainen <pmatilai@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/rpm] pmatilai-v6: - Macro-expand load macro argument
Date: Mon, 23 Nov 2026 09:28:58 GMT	[thread overview]
Message-ID: <179542613804.1.3389887132775924597.rpms-rpm-7674f0d76be7@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/rpm
Branch : pmatilai-v6
Commit : 7674f0d76be7fe09a4fb91e0494082bb9b7ccb45
Author : Panu Matilainen <pmatilai@redhat.com>
Date   : 2014-07-01T13:39:03+03:00
Stats  : +33/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rpm/c/7674f0d76be7fe09a4fb91e0494082bb9b7ccb45?branch=pmatilai-v6

Log:
- Macro-expand load macro argument

---
diff --git a/rpm-4.11.90-expand-load-arg.patch b/rpm-4.11.90-expand-load-arg.patch
new file mode 100644
index 0000000..9e2c65c
--- /dev/null
+++ b/rpm-4.11.90-expand-load-arg.patch
@@ -0,0 +1,30 @@
+commit d4ab1d82d7888f41b866751d0ef340a82be7cff2
+Author: Panu Matilainen <pmatilai@redhat.com>
+Date:   Tue Jul 1 12:04:40 2014 +0300
+
+    Macro-expand %{load:...} argument to make the thing more useful...
+
+diff --git a/rpmio/macro.c b/rpmio/macro.c
+index b00155c..1d9bd1c 100644
+--- a/rpmio/macro.c
++++ b/rpmio/macro.c
+@@ -1093,16 +1093,15 @@ expandMacro(MacroBuf mb, const char *src, size_t slen)
+ 
+ 	/* Expand builtin macros */
+ 	if (STREQ("load", f, fn)) {
+-		if (g && gn > 0) {
+-			char arg[gn + 1];
+-			strncpy(arg, g, gn);
+-			arg[gn] = '\0';
++		char *arg = NULL;
++		if (g && gn > 0 && expandThis(mb, g, gn, &arg) == 0) {
+ 			/* Print failure iff %{load:...} or %{!?load:...} */
+ 			if (loadMacroFile(mb->mc, arg) && chkexist == negate) {
+ 				rpmlog(RPMLOG_ERR,
+ 				       _("failed to load macro file %s"), arg);
+ 			}
+ 		}
++		free(arg);
+ 		s = se;
+ 		continue;
+ 	}

diff --git a/rpm.spec b/rpm.spec
index 184b1f6..62c8127 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -49,6 +49,7 @@ Patch4: rpm-4.8.1-use-gpg2.patch
 
 # Patches already upstream:
 Patch100: rpm-4.11.90-hardlink-groups.patch
+Patch101: rpm-4.11.90-expand-load-arg.patch
 
 # These are not yet upstream
 Patch302: rpm-4.7.1-geode-i686.patch
@@ -286,6 +287,7 @@ Requires: rpm-libs%{_isa} = %{version}-%{release}
 %patch4 -p1 -b .use-gpg2
 
 %patch100 -p1 -b .hardlink-groups
+%patch101 -p1 -b .expand-load-arg
 
 %patch302 -p1 -b .geode
 %patch304 -p1 -b .ldflags
@@ -541,6 +543,7 @@ exit 0
 %changelog
 * Tue Jul 01 2014 Panu Matilainen <pmatilai@redhat.com> - 4.11.90-0.git12844.3
 - Drop no longer needed temporary UsrMove patch
+- Macro-expand load macro argument
 
 * Mon Jun 30 2014 Panu Matilainen <pmatilai@redhat.com> - 4.11.90-0.git12844.2
 - Fix multiple interleaved hardlink groups during build

                 reply	other threads:[~2026-11-23  9:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179542613804.1.3389887132775924597.rpms-rpm-7674f0d76be7@fedoraproject.org \
    --to=pmatilai@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox