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: Warn on undefined macros in buildtree setup macros (#1820349)
Date: Mon, 23 Nov 2026 09:33:14 GMT	[thread overview]
Message-ID: <179542639482.1.12523410314164362090.rpms-rpm-9f5580ba45f1@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/rpm
Branch : pmatilai-v6
Commit : 9f5580ba45f15875cbc76c2624d98f80e2b80639
Author : Panu Matilainen <pmatilai@redhat.com>
Date   : 2020-04-20T14:18:05+03:00
Stats  : +35/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rpm/c/9f5580ba45f15875cbc76c2624d98f80e2b80639?branch=pmatilai-v6

Log:
Warn on undefined macros in buildtree setup macros (#1820349)

---
diff --git a/0001-Warn-on-undefined-components-in-buildtree-macros.patch b/0001-Warn-on-undefined-components-in-buildtree-macros.patch
new file mode 100644
index 0000000..afe1493
--- /dev/null
+++ b/0001-Warn-on-undefined-components-in-buildtree-macros.patch
@@ -0,0 +1,30 @@
+From 701736a18a4625557a5181df3a4f3aed7ac13506 Mon Sep 17 00:00:00 2001
+Message-Id: <701736a18a4625557a5181df3a4f3aed7ac13506.1587381334.git.pmatilai@redhat.com>
+From: Panu Matilainen <pmatilai@redhat.com>
+Date: Wed, 8 Apr 2020 14:38:46 +0300
+Subject: [PATCH] Warn on undefined components in buildtree macros
+
+Issue a warning if buildtree macros (%_sourcedir etc) contain undefined
+macro(s) after expansion, such as things only defined during spec parse.
+This always was a murky case that doesn't work in all scenarios, so
+a warning seems appropriate. Actual behavior doesn't change here though.
+---
+ rpmio/rpmfileutil.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/rpmio/rpmfileutil.c b/rpmio/rpmfileutil.c
+index 84ee34f4d..4a939dbfe 100644
+--- a/rpmio/rpmfileutil.c
++++ b/rpmio/rpmfileutil.c
+@@ -439,6 +439,8 @@ int rpmMkdirs(const char *root, const char *pathstr)
+     
+     for (char **d = dirs; *d; d++) {
+ 	char *path = rpmGetPath(root ? root : "", *d, NULL);
++	if (strstr(path, "%{"))
++	    rpmlog(RPMLOG_WARNING, ("undefined macro(s) in %s: %s\n"), *d, path);
+ 	if ((rc = rpmioMkpath(path, 0755, -1, -1)) != 0) {
+ 	    const char *msg = _("failed to create directory");
+ 	    /* try to be more informative if the failing part was a macro */
+-- 
+2.25.2
+

diff --git a/rpm.spec b/rpm.spec
index 65d0b63..a2f2181 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -25,7 +25,7 @@
 
 %global rpmver 4.15.90
 %global snapver git14971
-%global rel 5
+%global rel 6
 
 %global srcver %{version}%{?snapver:-%{snapver}}
 %global srcdir %{?snapver:testing}%{!?snapver:%{name}-%(echo %{version} | cut -d'.' -f1-2).x}
@@ -60,6 +60,7 @@ Patch6: 0001-find-debuginfo.sh-decompress-DWARF-compressed-ELF-se.patch
 Patch100: 0001-Unset-SOURCE_DATE_EPOCH-for-the-test-suite.patch
 Patch101: 0001-rpmfc-Do-not-prepend-buildroot-to-a-path-for-paramet.patch
 Patch102: 0001-Fix-regression-causing-all-ELF-files-classified-as-O.patch
+Patch103: 0001-Warn-on-undefined-components-in-buildtree-macros.patch
 
 # These are not yet upstream
 Patch906: rpm-4.7.1-geode-i686.patch
@@ -525,6 +526,9 @@ make check || (cat tests/rpmtests.log; exit 1)
 %doc doc/librpm/html/*
 
 %changelog
+* Fri Apr 20 2020 Panu Matilainen <pmatilai@redhat.com> - 4.15.90-0.git14971.6
+- Warn on undefined macros in buildtree setup macros (#1820349)
+
 * Thu Apr 09 2020 Panu Matilainen <pmatilai@redhat.com> - 4.15.90-0.git14971.5
 - Fix regression causing all ELF files classified as OCaml
 

                 reply	other threads:[~2026-11-23  9:33 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=179542639482.1.12523410314164362090.rpms-rpm-9f5580ba45f1@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