RULE: skip checking on requiring/suggesting packages 20/123420/3
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 5 Apr 2017 11:05:31 +0000 (20:05 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 5 Apr 2017 11:21:58 +0000 (20:21 +0900)
1. If the target is non-block packages, we do not need to check them.
2. Corrected error message.

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

index 5e7be0a..eaa574f 100755 (executable)
@@ -48,7 +48,7 @@ def ruleCheckInterBlock():
        if blocks[n].level == 0:
            if not n in root_suggested:
                error += 1
-               print("ERROR: Orphaned root block. Add Suggests: %{name}-root-"+n+" at building-blocks.spec")
+               print("ERROR: Orphaned root block. Add Suggests: %{name}-root-"+n+" at building-blocks.spec or in its categories.")
        else: # subX
            p = blocks[n].parent
            if not p in blocks:
@@ -116,6 +116,10 @@ def ruleCheckInc(file):
                report(file, lc, line)
                continue
            else:
+               # If it's just a package, skip checking.
+               c = re.sub(r'^\s*((Suggests)|(Requires)):\s*%{name}-', r'', line)
+               if c == line:
+                   continue
                c = re.sub(r'^\s*((Suggests)|(Requires)):\s*%{name}-sub[12]-', r'', line)
                c = re.sub(r'\s*', r'', c)
                c = re.sub(r'\n', r'', c)