From d602eaddee325488b6cc845930eaf23d1d50d777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Wed, 19 Jan 2022 15:12:05 +0100 Subject: [PATCH] KIWI: Allow to extend cointainer name with profile This should be default, but changing the default would break existing aggregates. This has also a limitation that it only works properly when build just one profile per build atm. --- Build/Kiwi.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Build/Kiwi.pm b/Build/Kiwi.pm index b8cea5ce2..9065f3ed8 100644 --- a/Build/Kiwi.pm +++ b/Build/Kiwi.pm @@ -246,6 +246,7 @@ sub kiwiparse { $obsprofiles = [ grep {defined($_)} map {$_ eq '@BUILD_FLAVOR@' ? $buildflavor : $_} split(' ', $obsprofiles) ]; } $unorderedrepos = 1 if $xml =~ /^\s*\s*$/im; + $ret->{'appendprofiletocontainername'} = 1 if $xml =~ /^\s*\s*$/im; for ($xml =~ /^\s*\s*$/img) { push @imagerepos, { 'url' => $_ }; } @@ -625,6 +626,10 @@ sub showcontainerinfo { 'buildtime' => $buildtime, '_type' => {'buildtime' => 'number'}, }; + if ($d->{'appendprofiletocontainername'} && @{$d->{'profiles'} || []}) { + # we can currently only handle one profile + $containerinfo->{'name'} .= "-$d->{'profiles'}->[0]"; + } $containerinfo->{'version'} = $d->{'version'} if defined $d->{'version'}; $containerinfo->{'release'} = $release if defined $release; $containerinfo->{'tags'} = $d->{'container_tags'} if @{$d->{'container_tags'} || []};