From: MyungJoo Ham Date: Wed, 5 Apr 2017 10:27:00 +0000 (+0900) Subject: Main: .ks inclusion fix X-Git-Tag: submit/tizen/20170406.050031~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F06%2F123406%2F2;p=tools%2Fbuilding-blocks.git Main: .ks inclusion fix 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 --- diff --git a/packaging/building-blocks.spec b/packaging/building-blocks.spec index 63159bd..2a91cfb 100644 --- a/packaging/building-blocks.spec +++ b/packaging/building-blocks.spec @@ -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}}