diff options
author | MyungJoo Ham <myungjoo.ham@samsung.com> | 2017-03-16 16:22:58 +0900 |
---|---|---|
committer | MyungJoo Ham <myungjoo.ham@samsung.com> | 2017-03-16 16:22:58 +0900 |
commit | 9818461b7b9a107343c735f06c6aa1f7fbdfb7c7 (patch) | |
tree | cf304a21fe7350ae5ab27eea53e2f9deab954934 | |
parent | 5238f3d5df712068e905be5b59cd765d56b9af39 (diff) | |
download | building-blocks-9818461b7b9a107343c735f06c6aa1f7fbdfb7c7.tar.gz building-blocks-9818461b7b9a107343c735f06c6aa1f7fbdfb7c7.tar.bz2 building-blocks-9818461b7b9a107343c735f06c6aa1f7fbdfb7c7.zip |
RULE: add rulechk 1.6/1.7. fix block defs accordingly
Change-Id: If83c96417c4318c2fafef70993c5ebd799f99c9e
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
-rw-r--r-- | RULES | 1 | ||||
-rw-r--r-- | packaging/platform-preset-mobile.inc | 24 | ||||
-rwxr-xr-x | rule_checker.py | 25 |
3 files changed, 36 insertions, 14 deletions
@@ -27,6 +27,7 @@ 1-8. In order to implement "radio-button" UI (choose only one), the block name starts with "chooseonlyone_" E.g., "building-blocks-root-chooseonlyone_Kernel" + #### CAUTION: NOT SUPPORTED. NOT GUARANTEED TO WORK AS SUPPOSED #### 1-9. [NAME] = [a-zA-Z0-9_]+ diff --git a/packaging/platform-preset-mobile.inc b/packaging/platform-preset-mobile.inc index ca01725..738d2c1 100644 --- a/packaging/platform-preset-mobile.inc +++ b/packaging/platform-preset-mobile.inc @@ -8,8 +8,8 @@ Conflicts: %{name}-sub1-preset-wearable Conflicts: %{name}-sub1-preset-ivi Conflicts: %{name}-sub1-preset-iot Suggests: %{name}-sub2-preset-mobile-tm1 -Suggests: %{name}-sub2-preset-mobile-tm2-aarch64 -Suggests: %{name}-sub2-preset-mobile-tm2-armv7l +Suggests: %{name}-sub2-preset-mobile-tm2_aarch64 +Suggests: %{name}-sub2-preset-mobile-tm2_armv7l Suggests: %{name}-sub2-preset-mobile-minimal %description sub1-preset-mobile Tizen Mobile Platform Presets @@ -18,8 +18,8 @@ Tizen Mobile Platform Presets %package sub2-preset-mobile-tm1 Summary: Mobile-TM1 Preset -Conflicts: %{name}-sub2-preset-mobile-tm2-aarch64 -Conflicts: %{name}-sub2-preset-mobile-tm2-armv7l +Conflicts: %{name}-sub2-preset-mobile-tm2_aarch64 +Conflicts: %{name}-sub2-preset-mobile-tm2_armv7l Conflicts: %{name}-sub2-preset-mobile-minimal # image-configuration must have this file supplied. %list_with_require %{_datadir}/image-configurations/mobile-wayland-armv7l-tm1.ks @@ -33,30 +33,30 @@ You may need mobile + tm1 MIC post script as well. (TIC RECIPE for POST is not READY YET) %files sub2-preset-mobile-tm1 -%package sub2-preset-mobile-tm2-aarch64 +%package sub2-preset-mobile-tm2_aarch64 Summary: Mobile-TM2 Preset Conflicts: %{name}-sub2-preset-mobile-tm1 -Conflicts: %{name}-sub2-preset-mobile-tm2-armv7l +Conflicts: %{name}-sub2-preset-mobile-tm2_armv7l Conflicts: %{name}-sub2-preset-mobile-minimal # image-configuration must have this file supplied. %list_with_require %{_datadir}/image-configurations/mobile-wayland-arm64-tm2.ks -%description sub2-preset-mobile-tm2-aarch64 +%description sub2-preset-mobile-tm2_aarch64 Tizen Mobile TM2 Preset. This is for aarch64 architecture only. For architectural/post-script note, please refer to tm1 twin. -%files sub2-preset-mobile-tm2-aarch64 +%files sub2-preset-mobile-tm2_aarch64 -%package sub2-preset-mobile-tm2-armv7l +%package sub2-preset-mobile-tm2_armv7l Summary: Mobile-TM2 Preset Conflicts: %{name}-sub2-preset-mobile-tm1 -Conflicts: %{name}-sub2-preset-mobile-tm2-aarch64 +Conflicts: %{name}-sub2-preset-mobile-tm2_aarch64 Conflicts: %{name}-sub2-preset-mobile-minimal # image-configuration must have this file supplied. %list_with_require %{_datadir}/image-configurations/mobile-wayland-armv7l-tm2.ks -%description sub2-preset-mobile-tm2-armv7l +%description sub2-preset-mobile-tm2_armv7l Tizen Mobile TM2 Preset. This is for armv7l architecture only. Although TM2 has 64bit processor, we may use 32bit userspace binaries for it. For architectural/post-script note, please refer to tm1 twin. -%files sub2-preset-mobile-tm2-armv7l +%files sub2-preset-mobile-tm2_armv7l %package sub2-preset-mobile-minimal Summary: Mobile Minimal Preset diff --git a/rule_checker.py b/rule_checker.py index 539ee8a..abf4212 100755 --- a/rule_checker.py +++ b/rule_checker.py @@ -8,6 +8,11 @@ # This does not check all rules of "RULES" # This is a prototype with a lot of work in progress +# TODO: Context-Aware Rule Check. (inter-block relations) +# Check if root exists for RULE 1-6 +# Check if sub1 exists for RULE 1-7 +# Check if a block is "Suggested/Required" by another block (orphan check) + from __future__ import print_function @@ -76,14 +81,30 @@ def ruleCheckInc(file): report(file, lc, line) continue - # RULE 1-5 + 1-9 / there is - in the name + # RULE 1-9 for root block (1-5) if re.search('^\s*%package\s*root', line) and \ - not re.search('^\s*%package\s*root-[a-zA-Z0-9_]*\s*$', line): + not re.search('^\s*%package\s*root-[a-zA-Z0-9_]+\s*$', line): error += 1 print("ERROR: RULE 1.9 not met with root (RULE 1.5)") report(file, lc, line) continue + # RULE 1-9 for sub1 block (1-6) + if re.search('^\s*%package\s*sub1', line) and \ + not re.search('^\s*%package\s*sub1-[a-zA-Z0-9_]+-[a-zA-Z0-9_]+\s*$', line): + error += 1 + print("ERROR: RULE 1.9 not met with sub1 (RULE 1.6)") + report(file, lc, line) + continue + + # RULE 1-9 for sub2 block (1-7) + if re.search('^\s*%package\s*sub2', line) and \ + not re.search('^\s*%package\s*sub2-[a-zA-Z0-9_]+-[a-zA-Z0-9_]+-[a-zA-Z0-9_]+\s*$', line): + error += 1 + print("ERROR: RULE 1.9 not met with sub1 (RULE 1.7)") + report(file, lc, line) + continue + |