From ea6431c521e893e6350b17a924bff6ab4b95390d Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 4 Nov 2020 11:24:56 +0200 Subject: [PATCH] Make builtin macros honor generic macro conditionals --- rpmio/macro.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/rpmio/macro.c b/rpmio/macro.c index 4ee599205..0ee2078fe 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -1508,25 +1508,6 @@ expandMacro(MacroBuf mb, const char *src, size_t slen) } } - /* Expand builtin macros */ - if (me && (me->flags & ME_BUILTIN)) { - int havearg = (me->flags & ME_HAVEARG) ? 1 : 0; - if (havearg != (g != NULL)) { - mbErr(mb, 1, "%%%s: %s\n", me->name, havearg ? - _("argument expected") : _("unexpected argument")); - continue; - } - if (me->flags & ME_PARSE) { - parseFunc parse = me->func; - s = parse(mb, me, se); - } else { - macroFunc func = me->func; - func(mb, me, g, gn); - s = se; - } - continue; - } - /* XXX Special processing for flags and existance test */ if (*f == '-' || chkexist) { if ((me == NULL && !negate) || /* Without existance, skip %{?...} */ @@ -1551,6 +1532,25 @@ expandMacro(MacroBuf mb, const char *src, size_t slen) continue; } + /* Expand builtin macros */ + if (me->flags & ME_BUILTIN) { + int havearg = (me->flags & ME_HAVEARG) ? 1 : 0; + if (havearg != (g != NULL)) { + mbErr(mb, 1, "%%%s: %s\n", me->name, havearg ? + _("argument expected") : _("unexpected argument")); + continue; + } + if (me->flags & ME_PARSE) { + parseFunc parse = me->func; + s = parse(mb, me, se); + } else { + macroFunc func = me->func; + func(mb, me, g, gn); + s = se; + } + continue; + } + /* Grab args for parametric macros */ ARGV_t args = NULL; if (me->opts != NULL) {