From: wchang kim Date: Wed, 9 Aug 2017 23:58:41 +0000 (+0900) Subject: [Update] Addding a macro for removing device-dependant package from ks X-Git-Tag: submit/tizen/20170810.021350~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0d5ab9352d9fe20f9acdedbadd0f57fbe40be7e2;p=tools%2Fbuilding-blocks.git [Update] Addding a macro for removing device-dependant package from ks file. Change-Id: I1fae8553602b9c65d9c32fc4da4f48fdeea1dccc Signed-off-by: Woochang Kim --- diff --git a/packaging/building-blocks.spec b/packaging/building-blocks.spec index 8ec5b21..e818528 100644 --- a/packaging/building-blocks.spec +++ b/packaging/building-blocks.spec @@ -127,6 +127,40 @@ presets describing specific products. end \ end}} +# Create a target device preset from .ks file used to create device iamge. +# This script writes build-spec when building the build-spec itself. :) +# Importing .ks file with list_with_require() based on image-configuration will work +# after Tizen:Unified starts to generate its own platform images. +# Removing the target-dependent files. +%define list_with_require_nodep_device() %{expand:%{lua:if posix.access(rpm.expand("%{SOURCE1200}"), "f") then \ + local start = 0 \ + 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.sub(line, 1, 1) == '-') then \ + elseif (string.len(line) == 0) then\ + elseif (string.match(line,"model%-config")) then\ + elseif (string.match(line,"pepper")) then\ + elseif (string.match(line,"system%-plugin")) then\ + elseif (string.match(line,"vconf%-internal%-keys%-config%-profile")) then\ + else \ + print("Requires: "..line) \ + print("\\n") \ + end \ + end \ + end \ + end \ + else \ + print("Requires: CANNOT_FIND_REQUIRED_FILES\\n") \ + end \ +end}} + + # Create Suggests List of blocks with yaml file list # DIRECTORY, Prefix-To-Be-Removed, Prefix-for-block-name %define list_suggest() %{expand:%{lua:if posix.access(rpm.expand("%{SOURCE1200}"), "f") then \ diff --git a/packaging/platform-preset-iot.inc b/packaging/platform-preset-iot.inc index 8aadf87..b8b8601 100644 --- a/packaging/platform-preset-iot.inc +++ b/packaging/platform-preset-iot.inc @@ -3,7 +3,7 @@ %package root-Preset_iot_core Summary: IOT Core Presets -%list_with_require %{_datadir}/image-configurations/common-iot_core-2parts-armv7l-rpi3.ks +%list_with_require_nodep_device %{_datadir}/image-configurations/common-iot_core-2parts-armv7l-rpi3.ks %description root-Preset_iot_core __EXPAND__: preset The packages of Tizen IoT Core.