Skip to content

Commit

Permalink
Allow arch specific repository url
Browse files Browse the repository at this point in the history
In case we build multiple products from a single _product (like we do in :Ports),
we need an ability to specify REPO_LOCATION per architecture. So each
media will get architecture specific URL

e.g.
<url name="repository" arch="ppc64le">ppc64le</url>
<url name="repository" arch="aarch64">aarch64</url>
<url name="repository">default/x86</url>

Signed-off-by: Dinar Valeev <dvaleev@suse.com>
  • Loading branch information
Dinar Valeev committed Oct 4, 2015
1 parent 069a64c commit a08ef43
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/backend/BSProductXML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ our $product = [
[],
[[ 'url' =>
'name',
'arch',
[],
'_content',
]],
Expand Down
16 changes: 12 additions & 4 deletions src/backend/bs_productconvert
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,18 @@ sub getUrl( $$$ ){
my $url="";
foreach my $url ( @{$product->{'urls'}->{'url'}} ){
if ( "$url->{'name'}" eq "$searchstring" ){
my $url = $url->{'_content'};
$url =~ s/%{_target_cpu}/$arch/g;
return $url;
}
if ( exists $url->{'arch'} && "$url->{'arch'}" eq "$arch" ) {
my $url = $url->{'_content'};
$url =~ s/%{_target_cpu}/$arch/g;
return $url;
} elsif (exists $url->{'arch'}) {
next;
} else {
my $url = $url->{'_content'};
$url =~ s/%{_target_cpu}/$arch/g;
return $url;
}
}
}
return $url;
}
Expand Down

0 comments on commit a08ef43

Please sign in to comment.