RULE: UI Block Rule 09/124809/4
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 12 Apr 2017 10:54:51 +0000 (19:54 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 13 Apr 2017 04:17:32 +0000 (13:17 +0900)
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>
RULES
packaging/platform-preset-iot.inc
rule_checker.py

diff --git a/RULES b/RULES
index 398b2e52e362c47ec4fa3c92a0009f23bebb1d9d..ee6bd69d926a92edfabe9736771545da2253b313 100644 (file)
--- a/RULES
+++ b/RULES
 another block that is not a direct child of it (ref. RULE 2.6)
        E.g., sub2-* cannot Requires/Suggests another root/sub1/sub2
        E.g., sub1-A cannot Requires/Suggests sub2-B-X
+
+5.5. A UI Block is a block that cannot be chosen or have relation with other blocks
+or packages, but is used to provide UI elements in TIC.
+
+    5.5.1. A UI Block has the same naming rule with others.
+    5.5.2. A block becomes a UI block if it satisfies the following regex:
+       /__UI__..$/
+    5.5.3. The last two characters (.. in the regex above) are "tag" that consists of
+       the placement of the block.
+        5.5.3.1. Tags are:
+            BR or br: blank line
+            HR or hr: <hr>
+            SD or sd: shaded blank line
+            SM or sm: summary text is shown (HTML tags works)
+            HT or ht: HTML tags from summary text is used. (same with SM/sm...)
+
+5.6. Blocks in TIC are placed sorted by package name. (ascending order)
index f2e9ffcf0047100d48e89c05579c6e16947e5944..144488284a5cecf1b122f2ddc14026bb032b0b27 100644 (file)
@@ -26,22 +26,39 @@ Tizen IoT Presets of Software Plaforms independent from specific hardware/BSPs.
 
 %package sub1-Preset_iot-examples
 Summary:       IOT Device Board and SW Platform Presets
-%ifarch aarch64 armv7l
-Suggests:      %{name}-sub2-Preset_iot-examples-RPI3_headless_devboard
-Suggests:      %{name}-sub2-Preset_iot-examples-RPI3_headless_networkhub
-Suggests:      %{name}-sub2-Preset_iot-examples-RPI3_headless_minimal
-Suggests:      %{name}-sub2-Preset_iot-examples-RPI3_headless
-%endif
 %ifarch armv7l
-Suggests:      %{name}-sub2-Preset_iot-examples-ARTIK_headless
-Suggests:      %{name}-sub2-Preset_iot-examples-ARTIK_headed_full
-Suggests:      %{name}-sub2-Preset_iot-examples-ODROID_headed_full
+Suggests:      %{name}-sub2-Preset_iot-examples-1_AAA_BLANK1__UI__SM
+Suggests:      %{name}-sub2-Preset_iot-examples-1_ARTIK_headless
+Suggests:      %{name}-sub2-Preset_iot-examples-1_ARTIK_headed_full
+Suggests:      %{name}-sub2-Preset_iot-examples-1_ODROID_headed_full
+%endif
+Suggests:      %{name}-sub2-Preset_iot-examples-1_ZZZBLANK1__UI__HR
+Suggests:      %{name}-sub2-Preset_iot-examples-1_ZZZBLANK2__UI__SM
+%ifarch aarch64 armv7l
+Suggests:      %{name}-sub2-Preset_iot-examples-1_RPI3_headless
+Suggests:      %{name}-sub2-Preset_iot-examples-3_RPI3_headless_devboard
+Suggests:      %{name}-sub2-Preset_iot-examples-3_RPI3_headless_networkhub
+Suggests:      %{name}-sub2-Preset_iot-examples-3_RPI3_headless_minimal
 %endif
 %description sub1-Preset_iot-examples
 Tizen IoT Presets of specific devices, which have both BSPs and software platforms.
 An item in this section is intended to represent a whole OS image.
 %files sub1-Preset_iot-examples
 
+%package sub2-Preset_iot-examples-1_AAA_BLANK1__UI__SM
+Summary:       <b>Examples of Official Tizen Snapshot Images</b>
+%description sub2-Preset_iot-examples-1_AAA_BLANK1__UI__SM
+%files sub2-Preset_iot-examples-1_AAA_BLANK1__UI__SM
+
+%package sub2-Preset_iot-examples-1_ZZZBLANK1__UI__HR
+Summary:       UI Blank
+%description sub2-Preset_iot-examples-1_ZZZBLANK1__UI__HR
+%files sub2-Preset_iot-examples-1_ZZZBLANK1__UI__HR
+
+%package sub2-Preset_iot-examples-1_ZZZBLANK2__UI__SM
+Summary:       <b>Examples Not Verified</b>
+%description sub2-Preset_iot-examples-1_ZZZBLANK2__UI__SM
+%files sub2-Preset_iot-examples-1_ZZZBLANK2__UI__SM
 
 
 %package sub2-Preset_iot-platforms-headless_minimal
@@ -69,7 +86,7 @@ Tizen IoT Headed/Minimal Preset
 
 
 %ifarch aarch64 armv7l
-%package sub2-Preset_iot-examples-RPI3_headless_devboard
+%package sub2-Preset_iot-examples-3_RPI3_headless_devboard
 Summary:       RPI3 Headless for Developers
 Requires:      %{name}-sub2-Preset_iot-platforms-headless_minimal
 Requires:      %{name}-sub1-Preset_boards-RPI3_headlessBSP
@@ -77,69 +94,69 @@ Requires:   rpm
 Suggests:      gcc
 Suggests:      make
 Suggests:      cmake
-%description sub2-Preset_iot-examples-RPI3_headless_devboard
-%files sub2-Preset_iot-examples-RPI3_headless_devboard
+%description sub2-Preset_iot-examples-3_RPI3_headless_devboard
+%files sub2-Preset_iot-examples-3_RPI3_headless_devboard
 %endif
 
 %ifarch aarch64 armv7l
-%package sub2-Preset_iot-examples-RPI3_headless_networkhub
+%package sub2-Preset_iot-examples-3_RPI3_headless_networkhub
 Summary:       RPI3 Headless Network Hub
 Requires:      %{name}-sub2-Preset_iot-platforms-headless_minimal
 Requires:      %{name}-sub1-Preset_boards-RPI3_headlessBSP
 Requires:      %{name}-root-domain_network
-%description sub2-Preset_iot-examples-RPI3_headless_networkhub
-%files sub2-Preset_iot-examples-RPI3_headless_networkhub
+%description sub2-Preset_iot-examples-3_RPI3_headless_networkhub
+%files sub2-Preset_iot-examples-3_RPI3_headless_networkhub
 %endif
 
 %ifarch aarch64 armv7l
-%package sub2-Preset_iot-examples-RPI3_headless_minimal
+%package sub2-Preset_iot-examples-3_RPI3_headless_minimal
 Summary:       RPI3 Minimal Headless
 Requires:      %{name}-sub2-Preset_iot-platforms-headless_minimal
 Requires:      %{name}-sub1-Preset_boards-RPI3_headlessBSP
-%description sub2-Preset_iot-examples-RPI3_headless_minimal
-%files sub2-Preset_iot-examples-RPI3_headless_minimal
+%description sub2-Preset_iot-examples-3_RPI3_headless_minimal
+%files sub2-Preset_iot-examples-3_RPI3_headless_minimal
 %endif
 
 %ifarch aarch64 armv7l
-%package sub2-Preset_iot-examples-RPI3_headless
+%package sub2-Preset_iot-examples-1_RPI3_headless
 Summary:       RPI3 Headless Tizen Official Example
 %list_with_require %{_datadir}/image-configurations/common-headless-2parts-armv7l-rpi3.ks
-%description sub2-Preset_iot-examples-RPI3_headless
+%description sub2-Preset_iot-examples-1_RPI3_headless
 Replication of Tizen IoT RPI3 Snapshot Release (download.tizen.org/snapshots/tizen/unified)
 This is from common-headless-2parts-armv7l-rpi3. (armv7l)
 Userspace rootfs only.
-%files sub2-Preset_iot-examples-RPI3_headless
+%files sub2-Preset_iot-examples-1_RPI3_headless
 %endif
 
 %ifarch armv7l
-%package sub2-Preset_iot-examples-ARTIK_headless
+%package sub2-Preset_iot-examples-1_ARTIK_headless
 Summary:       ARTIK Headless Tizen Official Example
 %list_with_require %{_datadir}/image-configurations/common-headless-3parts-armv7l-artik.ks
-%description sub2-Preset_iot-examples-ARTIK_headless
+%description sub2-Preset_iot-examples-1_ARTIK_headless
 Replication of Tizen IoT ARTIK Snapshot Release (download.tizen.org/snapshots/tizen/unified)
 This is from common-headless-3parts-armv7l-artik. (armv7l)
 Userspace rootfs only
-%files sub2-Preset_iot-examples-ARTIK_headless
+%files sub2-Preset_iot-examples-1_ARTIK_headless
 %endif
 
 %ifarch armv7l
-%package sub2-Preset_iot-examples-ARTIK_headed_full
+%package sub2-Preset_iot-examples-1_ARTIK_headed_full
 Summary:       ARTIK Headed Tizen Official Example (common/full)
 %list_with_require %{_datadir}/image-configurations/common-wayland-3parts-armv7l-artik.ks
-%description sub2-Preset_iot-examples-ARTIK_headed_full
+%description sub2-Preset_iot-examples-1_ARTIK_headed_full
 Replication of Tizen IoT ARTIK Headed/Wayland Snapshot Release (download.tizen.org/snapshots/tizen/unified)
 This is from common-wayland-3parts-armv7l-artik. (armv7l)
 Userspace rootfs only
-%files sub2-Preset_iot-examples-ARTIK_headed_full
+%files sub2-Preset_iot-examples-1_ARTIK_headed_full
 %endif
 
 %ifarch armv7l
-%package sub2-Preset_iot-examples-ODROID_headed_full
+%package sub2-Preset_iot-examples-1_ODROID_headed_full
 Summary:       ODROID U3/XU3 Headed Tizen Official Example (common/full)
 %list_with_require %{_datadir}/image-configurations/common-wayland-3parts-armv7l-odroidu3.ks
-%description sub2-Preset_iot-examples-ODROID_headed_full
+%description sub2-Preset_iot-examples-1_ODROID_headed_full
 Replication of Tizen IoT Odroid U3/XU3 Headed/Wayland Snapshot Release (download.tizen.org/snapshots/tizen/unified)
 This is from common-wayland-3parts-armv7l-odroidu3. (armv7l)
 Userspace rootfs only
-%files sub2-Preset_iot-examples-ODROID_headed_full
+%files sub2-Preset_iot-examples-1_ODROID_headed_full
 %endif
index c29e1162418ae159a381f81665660a3f44f77972..953c017e1c7c20f9e4bfb92caf6dd5b3ac564200 100755 (executable)
@@ -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 \