RULE: Do not refer to a block not existing in this repo. 55/124155/1 accepted/tizen/unified/20170410.160351 submit/tizen/20170410.101234 submit/tizen/20170410.101333
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 10 Apr 2017 10:10:13 +0000 (19:10 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 10 Apr 2017 10:10:13 +0000 (19:10 +0900)
- Added a rule
- Added the rule check in rule checker
- Corrected violating blocks.

Change-Id: I5e1006a1dafeb35a5344a2da8e1eef316898d3ff
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
RULES
packaging/domain-hal.inc
packaging/platform-preset-iot.inc
rule_checker.py

diff --git a/RULES b/RULES
index 457923f721a2a373b06158ec3d38da536b24c2fa..398b2e52e362c47ec4fa3c92a0009f23bebb1d9d 100644 (file)
--- a/RULES
+++ b/RULES
@@ -56,6 +56,8 @@
           other blocks to populate themselves with higher readability.
           Refer to RULE 5-4.
 
+2.7. Do not refer to (or declare as a child) a block that does not exist
+       in this repository.
 
 
 ===========================================================================
index 028cbdb2c94f0bb07b85cecba6b09622c2dc94bb..358f4f029688f1f254314fbb9ae0ae3eb56e3cc3 100644 (file)
@@ -121,6 +121,21 @@ Tizen Audio HAL domain
 %files sub1-domain_HAL-audio
 
 
+%package sub2-domain_HAL-audio-odroid
+Summary:       HAL packages for Odroid AUdio
+%description sub2-domain_HAL-audio-odroid
+%files sub2-domain_HAL-audio-odroid
+
+%package sub2-domain_HAL-audio-TM2
+Summary:       HAL packages for TM2 Audio
+%description sub2-domain_HAL-audio-TM2
+%files sub2-domain_HAL-audio-TM2
+
+%package sub2-domain_HAL-audio-TM1
+Summary:       HAL packages for TM1 Audio
+%description sub2-domain_HAL-audio-TM1
+%files sub2-domain_HAL-audio-TM1
+
 
 
 
@@ -133,4 +148,17 @@ Suggests:  %{name}-sub2-domain_HAL-bluetooth-TM1
 Tizen Bluetooth HAL domain
 %files sub1-domain_HAL-bluetooth
 
+
+%package sub2-domain_HAL-bluetooth-TM2
+Summary:       HAL packages for TM2 Bluetooth
+%description sub2-domain_HAL-bluetooth-TM2
+%files sub2-domain_HAL-bluetooth-TM2
+
+
+%package sub2-domain_HAL-bluetooth-TM1
+Summary:       HAL packages for TM1 Bluetooth
+%description sub2-domain_HAL-bluetooth-TM1
+%files sub2-domain_HAL-bluetooth-TM1
+
+
 # END
index a21ea0665b08dd9c755685415577c1149591667f..555019f4a6cbc9c085a94c0b89c184a5cf54467a 100644 (file)
@@ -85,7 +85,7 @@ Suggests:     cmake
 Summary:       RPI3 Headless Network Hub
 Requires:      %{name}-sub2-Preset_iot-platforms-headless_minimal
 Requires:      %{name}-sub1-Preset_boards-RPI3_headlessBSP
-Requires:      %{name}-root-network
+Requires:      %{name}-root-domain_network
 %description sub2-Preset_iot-examples-RPI3_headless_networkhub
 %files sub2-Preset_iot-examples-RPI3_headless_networkhub
 %endif
index 910f680559730e8bcb415b7d994d05e5f1bf39c2..2578d5f5266129fb097cdbf7db9bf84c5c91a068 100755 (executable)
@@ -23,6 +23,7 @@ def print_v(*args):
 
 Block = collections.namedtuple('Block', 'name level parent children description files')
 blocks = {}
+referedblock = []
 
 def report(file, lc, code):
     print(file + ":Line " + str(lc) + " |"+code)
@@ -30,6 +31,8 @@ def report(file, lc, code):
 
 def ruleCheckInterBlock():
     global blocks
+    global referedblock
+
     error = 0
     warning = 0
     root_suggested = {}
@@ -70,15 +73,24 @@ def ruleCheckInterBlock():
                if found == 0:
                    error += 1
                    print("ERROR: Orphaned sub block. The block "+n+" is not registered at the parent block "+p+" although "+p+" exists.")
-
         # TODO: Add more rules here?
 
 
+    # Check if Required/Suggested blocks exist in this repo
+    for refered in referedblock:
+        if not refered in blocks:
+            error += 1
+           print("ERROR: A nonexisting block '"+refered+"' is refered.")
+
+
+
+
 
     return (error, warning)
 
 def ruleCheckInc(file):
     global blocks
+    global referedblock
 
     print_v("Checking "+file)
 
@@ -153,6 +165,8 @@ def ruleCheckInc(file):
                        report(file, lc, line)
                        continue
 
+               referedblock.append(cname[5:].strip())
+
                cs = blocks[n].children
                cs.append(c)
                blocks[n]._replace(children = cs)