summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMyungJoo Ham <myungjoo.ham@samsung.com>2017-03-16 15:30:30 +0900
committerMyungJoo Ham <myungjoo.ham@samsung.com>2017-03-16 15:30:30 +0900
commit3a71caf05b827b65be1587b463448ddfc8457574 (patch)
tree9c7bdc3a1b26e24b4fcfacd6d8fc5b018939d415
parentfe6ad61fcf3f773a06806f38426479a794ef4284 (diff)
downloadbuilding-blocks-3a71caf05b827b65be1587b463448ddfc8457574.tar.gz
building-blocks-3a71caf05b827b65be1587b463448ddfc8457574.tar.bz2
building-blocks-3a71caf05b827b65be1587b463448ddfc8457574.zip
RULE: enforce rule check at build
Change-Id: I67f55b495fcc864cfb54d3d202cb2ed9f4585e8a Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
-rw-r--r--packaging/building-blocks.spec8
-rwxr-xr-xrule_checker.py5
2 files changed, 12 insertions, 1 deletions
diff --git a/packaging/building-blocks.spec b/packaging/building-blocks.spec
index 8f52507..d68f19c 100644
--- a/packaging/building-blocks.spec
+++ b/packaging/building-blocks.spec
@@ -40,6 +40,9 @@ Source3700: platform-preset-home_appliance.inc
# To get .ks files
BuildRequires: image-configurations
+# To check the rules
+BuildRequires: python
+
# Root Domains
Suggests: %{name}-root-Kernel
Suggests: %{name}-root-SystemFW
@@ -100,10 +103,13 @@ In Tizen building blocks, "Requires" means mandatory package.
end \
end}}
+%prep
+%setup
%build
-ls /usr/share/image-configurations/
+# rule_checker returns non-zero if there is an error in *.inc, breaking the build
+python ./rule_checker.py
%files
diff --git a/rule_checker.py b/rule_checker.py
index 068a36e..e17f6d0 100755
--- a/rule_checker.py
+++ b/rule_checker.py
@@ -53,6 +53,11 @@ def ruleCheckInc(file):
error += 1
print("ERROR: RULE 1.1 to ensure 1.1, do not use -n option in package name")
+ # Implicit / General Rule
+ if re.search('^\s*%package\s', line, re.IGNORECASE) and not re.search('^\s*%package\s', line):
+ error += 1
+ print('ERROR: (General) Please use %package, not '+re.search('^%package'))
+
# RULE 1-3
if re.search('^\s*%package', line) and not re.search('^\s*%package\s*(root)|(sub1)|(sub2)', line):
error +=1