summaryrefslogtreecommitdiff
path: root/rpmio/rpmfileutil.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2020-04-08 14:38:46 +0300
committerPanu Matilainen <pmatilai@redhat.com>2020-04-20 13:25:56 +0300
commit701736a18a4625557a5181df3a4f3aed7ac13506 (patch)
treef6c3ed61ed30f429ec2c7600abbb593331493522 /rpmio/rpmfileutil.c
parentd3470947a5e6adf150e999d3ec45c1fefdf62693 (diff)
downloadrpm-701736a18a4625557a5181df3a4f3aed7ac13506.tar.gz
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.
Diffstat (limited to 'rpmio/rpmfileutil.c')
-rw-r--r--rpmio/rpmfileutil.c2
1 files changed, 2 insertions, 0 deletions
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 */