diff --git a/package/yast2-add-on.changes b/package/yast2-add-on.changes index 6430531..5a00bb2 100644 --- a/package/yast2-add-on.changes +++ b/package/yast2-add-on.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Nov 26 13:14:28 UTC 2021 - Ladislav Slezák + +- Properly set the custom repository name (#1191491) +- 4.4.4 + ------------------------------------------------------------------- Wed Sep 15 13:56:13 UTC 2021 - Stefan Hundhammer diff --git a/package/yast2-add-on.spec b/package/yast2-add-on.spec index efd1ecd..7cc8a0c 100644 --- a/package/yast2-add-on.spec +++ b/package/yast2-add-on.spec @@ -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 diff --git a/src/include/add-on/add-on-workflow.rb b/src/include/add-on/add-on-workflow.rb index cd05f8f..0e92085 100755 --- a/src/include/add-on/add-on-workflow.rb +++ b/src/include/add-on/add-on-workflow.rb @@ -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)