[Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

pavlinamv notifications at github.com
Wed Jan 9 14:33:39 UTC 2019


pavlinamv commented on this pull request.



> @@ -360,7 +364,10 @@ do { \
 int readLine(rpmSpec spec, int strip)
 {
     char *s;
-    int match;
+    char *z;
+    int match = 0;
+    int isIf = 0;
+    int isElif = 0;

Yes a line can be `%if` line, `%elif` line or "another" line. 

Yes, in some earlier version were only two variables: `isElif` + `match`. The meaning of variable `match` was quite unclear.
 ` 0 .... %if or %else line + condition after %if is not satisfied`
 ` 1 .... %if or %else line + condition after %if is satisfied`
`-1  ... %if or %else line + condition after %if is bad, or `
`  ......     not %if or %elif line`
`match` was used for both: deciding whether line is `%if` line and deciding, whether the condition after `%if` (resp. `%ifos`, ...) is satisfied.

That is why I made the first patch of this PR. In the patch I refactored `match` into two variables: `match` + `isIf` to have clean meaning and usage. 

Variables `isIf` and `isElif` can be consolidated into one. I will change it.

-- 
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/613#discussion_r246402912
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20190109/166f389e/attachment.html>


More information about the Rpm-maint mailing list