RULE: fix: allow %ifarch/%endif 27/123527/1
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 6 Apr 2017 04:20:26 +0000 (13:20 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 6 Apr 2017 04:20:26 +0000 (13:20 +0900)
1. Allow %ifarch/%endif in %files section
2. Make a more clear error message for RULE 5-3.

Change-Id: I2f04234c8b01dd6d718ceece94643ee085081131
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
rule_checker.py

index e587cfa..d01eff6 100755 (executable)
@@ -97,9 +97,9 @@ def ruleCheckInc(file):
                files = 0
            else:
                if re.search(r'^\s*[^#\s]+', line) and \
-                  not re.search(r'^\s*%include', line):
+                  not re.search(r'^\s*(%include)|(%endif)|(%ifarch)', line):
                    error += 1
-                   print("ERROR: RULE 5.3 a block must not have a file included")
+                   print("ERROR: RULE 5.3 a block must not have a file included (%files section must be empty)")
                    report(file, lc, line)
                    continue