Main: .ks inclusion fix 06/123406/2
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 5 Apr 2017 10:27:00 +0000 (19:27 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 5 Apr 2017 11:21:58 +0000 (20:21 +0900)
1. A missing .ks won't create build errors.
2. KS package lists uses "-" to denote that the package is not
included. Handle such syntax.

Change-Id: I7c11201d1b2f30ffa427e25c2b078bbd8a891716
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
packaging/building-blocks.spec

index 63159bd..2a91cfb 100644 (file)
@@ -118,21 +118,29 @@ presets describing specific products.
 # This script writes build-spec when building the build-spec itself. :)
 # Importing .kg file with list_with_require() based on image-configuration will work
 # after Tizen:Unified starts to generate its own platform images.
+
+# TODO1: How to interpret "- pkg"? just skip? or make it conflicted?
+# TODO2: How to handle "no file error"?
 %define list_with_require() %{expand:%{lua:if posix.access(rpm.expand("%{SOURCE1001}"), "f") then \
        local start = 0 \
-       for line in io.lines(rpm.expand("%{1}")) do \
-               if (string.match(line, '%%end')) then break end \
-               if (string.match(line, '%%packages')) then \
-                       start = 1 \
-               else \
-                       if (start == 1) then \
-                               if (string.match(line, '^#')) then \
-                               elseif (string.match(line, '^$')) then \
-                               else \
-                                       print("Requires: "..line.."\\n") \
+       if posix.access(rpm.expand("%{1}")) then \
+               for line in io.lines(rpm.expand("%{1}")) do \
+                       if (string.match(line, '%%end')) then break end \
+                       if (string.match(line, '%%packages')) then \
+                               start = 1 \
+                       else \
+                               if (start == 1) then \
+                                       if (string.match(line, '^#')) then \
+                                       elseif (string.match(line, '^-')) then \
+                                       elseif (string.match(line, '^$')) then \
+                                       else \
+                                               print("Requires: "..line.."\\n") \
+                                       end \
                                end \
                        end \
                end \
+       else \
+               print("Requires: CANNOT_FIND_REQUIRED_FILES\\n") \
        end \
 end}}