[Rpm-maint] [rpm-software-management/rpm] Warn if %else is after %else (#649)
Panu Matilainen
notifications at github.com
Fri May 17 12:00:39 UTC 2019
pmatilai commented on this pull request.
> @@ -462,6 +430,22 @@ int readLine(rpmSpec spec, int strip)
lineType = parseLineType(s);
if (!lineType)
goto after_classification;
+
+ /* check ordering of the conditional */
+ if (lineType->isConditional &&
+ (spec->readStack->lastConditional->id & lineType->wrongPrecursors)) {
+ /* the conditional can't be after %endif or the 1. conditional */
+ if (spec->readStack->lastConditional->id == LINE_ENDIF)
+ rpmlog(RPMLOG_ERR,_("%s:%d: %s with no %%if\n"),
+ ofi->fileName, ofi->lineNum, lineType->text);
+ else
+ /* wrong ordering of the last two conditionals */
+ rpmlog(RPMLOG_ERR,_("%s:%d: %s after %s\n"),
Erm, actually... I guess the most common message format is just "line %d: <message>" but in a few places filename is also included. All wonderfully inconsistent, and fixing all that is beyond scope of this pr. So guess that doesn't matter.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/649#discussion_r285095341
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20190517/d8a13e44/attachment.html>
More information about the Rpm-maint
mailing list