summaryrefslogtreecommitdiff
path: root/rule_checker.py
diff options
context:
space:
mode:
authorMyungJoo Ham <myungjoo.ham@samsung.com>2017-04-12 19:54:51 +0900
committerMyungJoo Ham <myungjoo.ham@samsung.com>2017-04-13 13:17:32 +0900
commitcb6e6c8efe9e33462443ad88320d645b545c5d31 (patch)
treefec7665e44cf5ebd80c6328ba1ac709ce471750d /rule_checker.py
parentb4db6c19b2a26fc996d271108dd35f6b9db2b9cf (diff)
downloadbuilding-blocks-cb6e6c8efe9e33462443ad88320d645b545c5d31.tar.gz
building-blocks-cb6e6c8efe9e33462443ad88320d645b545c5d31.tar.bz2
building-blocks-cb6e6c8efe9e33462443ad88320d645b545c5d31.zip
RULE: UI Block Rule
Next version of TIC supports UI blocks. RULES for such UI blocks are described. Before SR'ing this, TIC-Core should merge https://review.tizen.org/gerrit/#/c/124779/ Change-Id: I55a11b5c7df4424f6a003c6f22d0f245159f967d Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'rule_checker.py')
-rwxr-xr-xrule_checker.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/rule_checker.py b/rule_checker.py
index c29e116..953c017 100755
--- a/rule_checker.py
+++ b/rule_checker.py
@@ -100,6 +100,7 @@ def ruleCheckInc(file):
files = 0 # Start checking if %files section have files (error if exists)
lastpkg = ''
+ uipkg_checking = 0 # 1 if we are in a context of uipkg (after %package, before %description/%files/...)
try:
f = open("packaging/"+file, 'r')
@@ -113,6 +114,7 @@ def ruleCheckInc(file):
if (files == 1):
if re.search(r'^\s*(%package)|(%build)|(%description)|(%prep)|(%clean)|(%install)|(%post)|(%pre)', line):
files = 0
+ uipkg_checking = 0
else:
if re.search(r'^\s*[^#\s]+', line) and \
not re.search(r'^\s*(%include)|(%endif)|(%ifarch)|(%list_require)', line):
@@ -122,6 +124,13 @@ def ruleCheckInc(file):
continue
if re.search(r'^\s*((Suggests)|(Requires))', line, re.IGNORECASE):
+ # RULE 5.5
+ if uipkg_checking == 1:
+ error += 1
+ print("ERROR: RULE 5.5 a UI block cannot have relation with others.")
+ report(file, lc, line)
+ continue
+
if not re.search(r'^\s*((Suggests)|(Requires)):', line):
error += 1
print("ERROR: Use case sensitive put : directly after the keyword")
@@ -224,6 +233,8 @@ def ruleCheckInc(file):
print("ERROR: RULE 1.3 the send prefix should be root, sub1, sub2, or sub3.")
report(file, lc, line)
continue
+ if re.search(r'^.*__UI__..$', line):
+ uipkg_checking = 1
# RULE 1-9 for root block (1-5)
if re.search(r'^\s*%package\s*root', line) and \