Allow BuildFlags: Buildflags: flag:key to pass an arg 44/259044/1
authorHyunggi Lee <hyunggi.lee@samsung.com>
Mon, 31 May 2021 08:12:52 +0000 (17:12 +0900)
committerHyunggi Lee <hyunggi.lee@samsung.com>
Mon, 31 May 2021 08:12:52 +0000 (17:12 +0900)
cherry-pick queyconfig only.

From b70ff4d443ecb83c0c47f935a301c44dec3aad0e Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Mon, 19 Oct 2020 16:02:59 +0200
Subject: [PATCH] Support ENV and ARG in Dockerfile

Allow BuildFlags: dockerbuildarg:key=value to pass an arg
to the build command.
---
 Build/Docker.pm     | 61 +++++++++++++++++++++++++++++++++++++--------
 build-recipe-docker | 14 +++++++++--
 queryconfig         |  5 ++++
 3 files changed, 68 insertions(+), 12 deletions(-)

Change-Id: I96bade8f06088d11ccb2f7c57dee5449876537a0
Signed-off-by: Hyunggi Lee <hyunggi.lee@samsung.com>
queryconfig

index f130931..f470605 100755 (executable)
@@ -61,6 +61,11 @@ if ($type eq 'buildflags') {
   die("Specify which buildflag to query\n") unless $argument;
   my $result = $cf->{"buildflags:$argument"};
   print "$result\n" if defined $result;
+} elsif ($type eq 'buildflags+') {
+  die("Specify which buildflag to query\n") unless $argument;
+  for (@{$cf->{'buildflags'} || []}) {
+    print "$1\n" if /\Q$argument\E:(.*)/;
+  }
 } elsif ($type eq 'hostarch') {
   my $result = $cf->{"hostarch"};
   print "$result\n" if defined $result;