Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use REPO_OSS_SOURCE to add source repo for openSUSE #6439

Merged
merged 1 commit into from Jan 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions lib/repo_tools.pm
Expand Up @@ -147,11 +147,19 @@ sub prepare_source_repo {
}
# source repository is disabled by default
else {
# OSS_SOURCE is expected to be added
if (script_run('zypper lr repo-source') != 0) {
# re-add the source repo
my $version = lc get_required_var('VERSION');
my $source_name = is_tumbleweed() ? $version : 'distribution/leap/' . $version;
zypper_call("ar -f http://download.opensuse.org/source/$source_name/repo/oss repo-source");
my $repourl;
# if REPO_OSS_SOURCE is defined - use it, if not fallback to download.opensuse.org
if (my $repo_basename = get_var("REPO_OSS_SOURCE")) {
asmorodskyi marked this conversation as resolved.
Show resolved Hide resolved
$repourl = get_required_var('MIRROR_PREFIX') . "/" . $repo_basename;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I correctly get idea to use this flow I need to define two variables, containing parts of url , what the benefit in comparison just put url into single variable ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's more about backward compatibility and what we already had, MIRROR_PREFIX is defined by rsync.pl since I know it, and for REPO_ variables we have never used full url in a single variable. In general that could work and provide a better way to provide repos from different hosts, but that's the way it is and it will be a lot of efforts for not much benefit (as of now) to change it.

} else {
my $source_name = is_tumbleweed() ? $version : 'distribution/leap/' . $version;
$repourl = "http://download.opensuse.org/source/$source_name/repo/oss";
}
zypper_call("ar -f $repourl repo-source");
}
else {
zypper_call("mr -e repo-source");
Expand Down