RULE: a board package may include KS construction infomation 09/124909/5
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 13 Apr 2017 04:24:02 +0000 (13:24 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 13 Apr 2017 05:21:16 +0000 (14:21 +0900)
An example is given with Preset_boards-RPI3_headlessBSP

Added RULE 5.7.
Added rulechecker for RULE 5.7.

NOTE: TIC/TIC-Core update for KS Construction is in progress
(will send the commit today or tomorrow)

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

diff --git a/RULES b/RULES
index ee6bd69d926a92edfabe9736771545da2253b313..bad631f45164482187c636e3a463ea1141bbcc1d 100644 (file)
--- a/RULES
+++ b/RULES
@@ -126,3 +126,13 @@ or packages, but is used to provide UI elements in TIC.
             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)
+
+5.7. If the first line of %description starts with __KS_URL__, it denotes for
+the model ks file URL to be interpreted by TIC.
+
+    5.7.1. Only platform-preset-boards may use such keywords
+    5.7.2. Only one package with such keyword is effective. If there are two packages
+        with such keywords are chosen simultaneously, the behavior is "undefined".
+    5.7.3. The section of "%packages" in the linked ks file is ignored.
+    5.7.4. If the URL points to a directory index, any ks file in the directory can be
+       used. (ending with /)
index 5660ab65136597689e26071b49a8cd1801a4b828..9cfeec2da517cd3d6f0feed3a6e0a966866c01fe 100644 (file)
@@ -46,6 +46,7 @@ Conflicts:    %{name}-sub1-Preset_boards-TW1_fullBSP
 Conflicts:     %{name}-sub1-Preset_boards-TW2_fullBSP
 
 %description sub1-Preset_boards-RPI3_headlessBSP
+__KS_URL__: http://download.tizen.org/snapshots/tizen/unified/latest/images/standard/common-headless-2parts-armv7l-rpi3/
 These are manually extracted from common-headless-2parts-armv7l-rpi3.ks
 %files sub1-Preset_boards-RPI3_headlessBSP
 %endif
index 953c017e1c7c20f9e4bfb92caf6dd5b3ac564200..fc159019fa12d48722adbe31b8b8da6ff0f324fd 100755 (executable)
@@ -100,7 +100,9 @@ def ruleCheckInc(file):
 
     files = 0 # Start checking if %files section have files (error if exists)
     lastpkg = ''
+    descpkg = ''
     uipkg_checking = 0 # 1 if we are in a context of uipkg (after %package, before %description/%files/...)
+    description = 0 # 1 if it is next line of description
 
     try:
         f = open("packaging/"+file, 'r')
@@ -111,6 +113,18 @@ def ruleCheckInc(file):
     for line in f:
         lc += 1
 
+        # RULE 5.7
+       if description == 1:
+           description = 0
+           if re.search(r'^__KS_URL__', line):
+               if not re.search(r'Preset_boards-', descpkg):
+                   error += 1
+                   print("ERROR: Rule 5.7.1. The package: "+descpkg)
+                   report(file, lc, line)
+                   continue
+       if re.search(r'^\s*%description', line):
+           description = 1
+
        if (files == 1):
            if re.search(r'^\s*(%package)|(%build)|(%description)|(%prep)|(%clean)|(%install)|(%post)|(%pre)', line):
                files = 0
@@ -308,6 +322,7 @@ def ruleCheckInc(file):
 
        # Check for %description entry
        if re.search(r'^\s*%description\s+', line):
+           descpkg = lastpkg
            lastpkg = ''
 
            # remove tag