Ignore bad expressions in %if conditionals 32/299232/1
authorxuhy <huayong.xu@samsung.com>
Fri, 22 Sep 2023 06:19:07 +0000 (14:19 +0800)
committerxuhy <huayong.xu@samsung.com>
Fri, 22 Sep 2023 06:19:07 +0000 (14:19 +0800)
Author: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Date:   Fri Sep 6 10:11:49 2013 +0300

    Ignore bad expressions in %if conditionals

    Yet another hack to allow successful parsing of spec files in host
    environment.

    Change-Id: Ie47ee06b13d3e8a79e583fc6ec97350e45237cca
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Change-Id: If5b0a41fc8832c8feba42245da2cb1e76ea1c827

build/parseSpec.c

index d0c42a43e1e6cb42cf7b9206aef926d794061b99..671976e11383b737870039aec8f16e04d1ad0c94 100644 (file)
@@ -417,9 +417,9 @@ int readLine(rpmSpec spec, int strip)
         match = parseExpressionBoolean(s);
        if (match < 0) {
            rpmlog(RPMLOG_ERR,
-                       _("%s:%d: bad %%if condition\n"),
+                       _("%s:%d: bad %%if condition, continuing nevertheless\n"),
                        ofi->fileName, ofi->lineNum);
-           return PART_ERROR;
+           match = 0;
        }
     } else if (ISMACRO(s, "%else")) {
        if (! spec->readStack->next) {