Skip to content

Commit

Permalink
Properly set the custom repository name (#1191491)
Browse files Browse the repository at this point in the history
- 4.4.4
  • Loading branch information
lslezak committed Nov 26, 2021
1 parent 8ab523a commit 3c56bc4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
6 changes: 6 additions & 0 deletions package/yast2-add-on.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Nov 26 13:14:28 UTC 2021 - Ladislav Slezák <lslezak@suse.cz>

- Properly set the custom repository name (#1191491)
- 4.4.4

-------------------------------------------------------------------
Wed Sep 15 13:56:13 UTC 2021 - Stefan Hundhammer <shundhammer@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-add-on.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-add-on
Version: 4.4.3
Version: 4.4.4
Release: 0
Summary: YaST2 - Add-On media installation code
License: GPL-2.0-only
Expand Down
18 changes: 17 additions & 1 deletion src/include/add-on/add-on-workflow.rb
Expand Up @@ -1824,8 +1824,24 @@ def activate_addon_changes(sources_before)
end

if !@added_repos.empty?
# rename the repository to the product name if user left the name field empty
if SourceDialogs.GetRepoName.empty?
# first set the fallback name for the added repository because the
# Packages.AdjustSourcePropertiesAccordingToProduct call
# changes only the repositories with the fallback name
sources = Pkg.SourceEditGet
sources.each do |src|
next unless @added_repos.include?(src["SrcId"])
next if Y2Packager::Resolvable.find(kind: :product, source: src["SrcId"]).empty?

log.info "Renaming repository #{src["raw_name"].inspect}"
src["raw_name"] = Packages.fallback_name
end
Pkg.SourceEditSet(sources)
end

@added_repos.each do |src_id|
# BNC #481828: Using LABEL from content file as a repository name
# use product name as a repository name
Packages.AdjustSourcePropertiesAccordingToProduct(src_id)
# used add-ons are stored in a special list
AddAddOnToStore(src_id)
Expand Down

0 comments on commit 3c56bc4

Please sign in to comment.