Hello community,

here is the log from the commit of package yast2-add-on for openSUSE:Factory 
checked in at 2019-07-31 14:25:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-add-on (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-add-on.new.4126 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-add-on"

Wed Jul 31 14:25:41 2019 rev:99 rq:718823 version:4.2.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-add-on/yast2-add-on.changes        
2019-05-27 08:35:37.971135355 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-add-on.new.4126/yast2-add-on.changes      
2019-07-31 14:25:43.430299197 +0200
@@ -1,0 +2,34 @@
+Fri Jul 26 12:27:45 CEST 2019 - [email protected]
+
+- AY: Adapted docu regarding <add_on_others> flag (bsc#1125411).
+- 4.2.4
+
+-------------------------------------------------------------------
+Thu Jul 25 08:40:00 UTC 2019 - Ladislav Slezák <[email protected]>
+
+- Release the sources to avoid using up all server connections
+  (bsc#1141127)
+- 4.2.3
+
+-------------------------------------------------------------------
+Tue Jul  9 17:42:52 CEST 2019 - [email protected]
+
+- AY Export/Import: Support also repositories not containing any
+  product (usually custom or 3rd party repositories) (bsc#1125441).
+- 4.2.2
+
+-------------------------------------------------------------------
+Mon Jul  1 07:40:05 UTC 2019 - David Diaz <[email protected]>
+
+- Do not abort when an addon license is refused (bsc#1114018).
+- 4.2.1
+
+-------------------------------------------------------------------
+Fri May 31 12:23:30 UTC 2019 - Stasiek Michalski <[email protected]>
+
+- Add metainfo (fate#319035)
+- Revamp spec
+- Replace GenericName with Comment
+- 4.2.0
+
+-------------------------------------------------------------------

Old:
----
  yast2-add-on-4.1.12.tar.bz2

New:
----
  yast2-add-on-4.2.4.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-add-on.spec ++++++
--- /var/tmp/diff_new_pack.AFo8MW/_old  2019-07-31 14:25:44.038298727 +0200
+++ /var/tmp/diff_new_pack.AFo8MW/_new  2019-07-31 14:25:44.042298724 +0200
@@ -17,31 +17,34 @@
 
 
 Name:           yast2-add-on
-Version:        4.1.12
+Version:        4.2.4
 Release:        0
 Summary:        YaST2 - Add-On media installation code
 License:        GPL-2.0-only
 Group:          System/YaST
-Url:            http://github.com/yast/yast-add-on
+Url:            https://github.com/yast/yast-add-on
+
 Source0:        %{name}-%{version}.tar.bz2
+
 BuildRequires:  update-desktop-files
 BuildRequires:  yast2 >= 3.0.1
 BuildRequires:  yast2-devtools >= 3.1.10
-BuildRequires:  yast2-packager
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:rspec)
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:yast-rake)
+# Y2packager::Resolvables
+BuildRequires:  yast2-packager >= 4.2.11
+
 Requires:       autoyast2-installation
 # ProductProfile
 Requires:       yast2 >= 3.0.1
 Requires:       yast2-country
 Requires:       yast2-installation
-# new AddOnProduct.DoInstall argument
-Requires:       yast2-packager >= 4.0.25
+# Packager ProductLicense#HandleLicenseDialogRet allowing "refuse" action
+Requires:       yast2-packager >= 4.2.16
 Requires:       yast2-ruby-bindings >= 1.0.0
 
 Obsoletes:      yast2-add-on-devel-doc
 
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildArch:      noarch
 
 %description
@@ -51,30 +54,24 @@
 %setup -q
 
 %check
-rake test:unit
+%yast_check
 
 %build
 
 %install
-rake install DESTDIR=%{buildroot}
+%yast_install
+%yast_metainfo
 
 %files
-%defattr(-,root,root)
-%dir %{yast_yncludedir}/add-on
-%{yast_yncludedir}/add-on/*
-%dir %{yast_libdir}/add-on
-%dir %{yast_libdir}/add-on/clients
-%{yast_libdir}/add-on/clients/*.rb
-%{yast_clientdir}/add-on.rb
-%{yast_clientdir}/add-on_*.rb
-%{yast_clientdir}/inst_add-on*.rb
-%{yast_clientdir}/vendor.rb
-%{yast_desktopdir}/*.desktop
-%{yast_schemadir}/autoyast/rnc/add-on.rnc
-%{_datadir}/icons/*
-%dir %{yast_docdir}
+%{yast_yncludedir}
+%{yast_libdir}
+%{yast_clientdir}
+%{yast_moduledir}
+%{yast_desktopdir}
+%{yast_metainfodir}
+%{yast_schemadir}
+%{yast_icondir}
+%doc %{yast_docdir}
 %license COPYING
-%doc %{yast_docdir}/CONTRIBUTING.md
-%doc %{yast_docdir}/README.md
 
 %changelog

++++++ yast2-add-on-4.1.12.tar.bz2 -> yast2-add-on-4.2.4.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.1.12/package/yast2-add-on.changes 
new/yast2-add-on-4.2.4/package/yast2-add-on.changes
--- old/yast2-add-on-4.1.12/package/yast2-add-on.changes        2019-05-23 
10:24:34.000000000 +0200
+++ new/yast2-add-on-4.2.4/package/yast2-add-on.changes 2019-07-26 
12:49:51.000000000 +0200
@@ -1,4 +1,38 @@
 -------------------------------------------------------------------
+Fri Jul 26 12:27:45 CEST 2019 - [email protected]
+
+- AY: Adapted docu regarding <add_on_others> flag (bsc#1125411).
+- 4.2.4
+
+-------------------------------------------------------------------
+Thu Jul 25 08:40:00 UTC 2019 - Ladislav Slezák <[email protected]>
+
+- Release the sources to avoid using up all server connections
+  (bsc#1141127)
+- 4.2.3
+
+-------------------------------------------------------------------
+Tue Jul  9 17:42:52 CEST 2019 - [email protected]
+
+- AY Export/Import: Support also repositories not containing any
+  product (usually custom or 3rd party repositories) (bsc#1125441).
+- 4.2.2
+
+-------------------------------------------------------------------
+Mon Jul  1 07:40:05 UTC 2019 - David Diaz <[email protected]>
+
+- Do not abort when an addon license is refused (bsc#1114018).
+- 4.2.1
+
+-------------------------------------------------------------------
+Fri May 31 12:23:30 UTC 2019 - Stasiek Michalski <[email protected]>
+
+- Add metainfo (fate#319035)
+- Revamp spec
+- Replace GenericName with Comment
+- 4.2.0
+
+-------------------------------------------------------------------
 Wed May 22 16:20:22 CEST 2019 - [email protected]
 
 - Fix: Update repository will be registered while installing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.1.12/package/yast2-add-on.spec 
new/yast2-add-on-4.2.4/package/yast2-add-on.spec
--- old/yast2-add-on-4.1.12/package/yast2-add-on.spec   2019-05-23 
10:24:34.000000000 +0200
+++ new/yast2-add-on-4.2.4/package/yast2-add-on.spec    2019-07-26 
12:49:51.000000000 +0200
@@ -12,36 +12,39 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
 Name:           yast2-add-on
-Version:        4.1.12
+Version:        4.2.4
 Release:        0
 Summary:        YaST2 - Add-On media installation code
 License:        GPL-2.0-only
 Group:          System/YaST
-Url:            http://github.com/yast/yast-add-on
+Url:            https://github.com/yast/yast-add-on
+
 Source0:        %{name}-%{version}.tar.bz2
+
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:yast-rake)
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:rspec)
 BuildRequires:  update-desktop-files
 BuildRequires:  yast2 >= 3.0.1
 BuildRequires:  yast2-devtools >= 3.1.10
-BuildRequires:  yast2-packager
+# Y2packager::Resolvables
+BuildRequires:  yast2-packager >= 4.2.11
+
 Requires:       autoyast2-installation
 # ProductProfile
 Requires:       yast2 >= 3.0.1
 Requires:       yast2-country
 Requires:       yast2-installation
-# new AddOnProduct.DoInstall argument
-Requires:       yast2-packager >= 4.0.25
+# Packager ProductLicense#HandleLicenseDialogRet allowing "refuse" action
+Requires:       yast2-packager >= 4.2.16
 Requires:       yast2-ruby-bindings >= 1.0.0
 
 Obsoletes:      yast2-add-on-devel-doc
 
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildArch:      noarch
 
 %description
@@ -51,30 +54,24 @@
 %setup -q
 
 %check
-rake test:unit
+%yast_check
 
 %build
 
 %install
-rake install DESTDIR=%{buildroot}
+%yast_install
+%yast_metainfo
 
 %files
-%defattr(-,root,root)
-%dir %{yast_yncludedir}/add-on
-%{yast_yncludedir}/add-on/*
-%dir %{yast_libdir}/add-on
-%dir %{yast_libdir}/add-on/clients
-%{yast_libdir}/add-on/clients/*.rb
-%{yast_clientdir}/add-on.rb
-%{yast_clientdir}/add-on_*.rb
-%{yast_clientdir}/inst_add-on*.rb
-%{yast_clientdir}/vendor.rb
-%{yast_desktopdir}/*.desktop
-%{yast_schemadir}/autoyast/rnc/add-on.rnc
-%{_datadir}/icons/*
-%dir %{yast_docdir}
+%{yast_yncludedir}
+%{yast_libdir}
+%{yast_clientdir}
+%{yast_moduledir}
+%{yast_desktopdir}
+%{yast_metainfodir}
+%{yast_schemadir}
+%{yast_icondir}
+%doc %{yast_docdir}
 %license COPYING
-%doc %{yast_docdir}/CONTRIBUTING.md
-%doc %{yast_docdir}/README.md
 
 %changelog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.1.12/src/autoyast-rnc/add-on.rnc 
new/yast2-add-on-4.2.4/src/autoyast-rnc/add-on.rnc
--- old/yast2-add-on-4.1.12/src/autoyast-rnc/add-on.rnc 2019-05-23 
10:24:34.000000000 +0200
+++ new/yast2-add-on-4.2.4/src/autoyast-rnc/add-on.rnc  2019-07-26 
12:49:51.000000000 +0200
@@ -3,7 +3,10 @@
 namespace config = "http://www.suse.com/1.0/configns";
 
 add-on =
-  element add-on { add_on_products* }
+  element add-on {
+      add_on_products* &
+      add_on_others*
+  }
 listentry =
   element listentry {
      media_url & # here it is mandatory
@@ -49,8 +52,25 @@
 ask_on_error = element ask_on_error { BOOLEAN }
 confirm_license = element confirm_license { BOOLEAN }
 priority = element priority { INTEGER }
+#
+# Describes all Add-On products which have to be added
+# while and after the installation.
+#
 add_on_products =
   element add_on_products {
      attribute config:type { text }?,
      listentry*
   }
+#
+# Describes all Add-Ons which are not Add-On-Products or Base-Products.
+# Usually custom or 3rd party repositories.
+#
+# Add-On products and other user defined repos will be split in order to
+#  1. keep a better overview about the repos
+#  2. ensure backward compatibility
+#
+add_on_others =
+  element add_on_others {
+     attribute config:type { text }?,
+     listentry*
+  }  
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.1.12/src/clients/add-on.rb 
new/yast2-add-on-4.2.4/src/clients/add-on.rb
--- old/yast2-add-on-4.1.12/src/clients/add-on.rb       2019-05-23 
10:24:34.000000000 +0200
+++ new/yast2-add-on-4.2.4/src/clients/add-on.rb        2019-07-26 
12:49:51.000000000 +0200
@@ -111,7 +111,7 @@
         false
       )
 
-      Wizard.SetDesktopTitleAndIcon("add-on")
+      Wizard.SetDesktopTitleAndIcon("org.opensuse.yast.AddOn")
 
       Wizard.DisableBackButton
       Wizard.DisableAbortButton
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.1.12/src/clients/add-on_proposal.rb 
new/yast2-add-on-4.2.4/src/clients/add-on_proposal.rb
--- old/yast2-add-on-4.1.12/src/clients/add-on_proposal.rb      2019-05-23 
10:24:34.000000000 +0200
+++ new/yast2-add-on-4.2.4/src/clients/add-on_proposal.rb       2019-07-26 
12:49:51.000000000 +0200
@@ -32,13 +32,13 @@
         @items = Builtins.maplist(AddOnProduct.add_on_products) do |product|
           data = Pkg.SourceGeneralData(Ops.get_integer(product, "media", -1))
           # placeholder for unknown path
-          dir = Ops.get_locale(data, "product_dir", _("Unknown"))
+          dir = Ops.get_locale(data, "product_dir", product.fetch( 
"product_dir", _("Unknown")))
           dir = "/" if dir == ""
           # summary item, %1 is product name, %2 media URL, %3 directory on 
media
           Builtins.sformat(
             "%1 (Media %2, directory %3)",
-            Ops.get_string(product, "product", ""),
-            Ops.get_locale(data, "url", _("Unknown")),
+            Ops.get_string(product, "product", _("No name defined")),
+            Ops.get_locale(data, "url", product.fetch( "media_url", 
_("Unknown"))),
             dir
           )
         end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.1.12/src/clients/vendor.rb 
new/yast2-add-on-4.2.4/src/clients/vendor.rb
--- old/yast2-add-on-4.1.12/src/clients/vendor.rb       2019-05-23 
10:24:34.000000000 +0200
+++ new/yast2-add-on-4.2.4/src/clients/vendor.rb        2019-07-26 
12:49:51.000000000 +0200
@@ -55,7 +55,7 @@
       @result = nil
 
       Wizard.CreateDialog
-      Wizard.SetDesktopTitleAndIcon("vendor")
+      Wizard.SetDesktopTitleAndIcon("org.opensuse.yast.Vendor")
       Wizard.HideAbortButton
 
       # VENDOR: main screen heading
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.1.12/src/desktop/add-on.desktop 
new/yast2-add-on-4.2.4/src/desktop/add-on.desktop
--- old/yast2-add-on-4.1.12/src/desktop/add-on.desktop  2019-05-23 
10:24:34.000000000 +0200
+++ new/yast2-add-on-4.2.4/src/desktop/add-on.desktop   1970-01-01 
01:00:00.000000000 +0100
@@ -1,26 +0,0 @@
-[Desktop Entry]
-Type=Application
-Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Software;
-
-X-KDE-ModuleType=Library
-X-KDE-HasReadOnlyMode=true
-X-SuSE-YaST-Call=add-on
-
-X-SuSE-YaST-Group=Software
-X-SuSE-YaST-Argument=
-X-SuSE-YaST-RootOnly=true
-X-SuSE-YaST-AutoInst=configure
-X-SuSE-YaST-Geometry=
-X-SuSE-YaST-SortKey=
-X-SuSE-YaST-AutoInstResource=
-X-SuSE-YaST-AutoInstPath=install
-X-SuSE-YaST-AutoInstSchema=add-on.rnc
-X-SuSE-YaST-AutoInstClonable=true
-X-SuSE-YaST-Keywords=update,packages,repositories,software
-
-Icon=yast-addon
-Exec=xdg-su -c "/sbin/yast2 add-on"
-
-Name=Add-On Products
-GenericName=Install or remove add-on products
-StartupNotify=true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-add-on-4.1.12/src/desktop/org.opensuse.yast.AddOn.desktop 
new/yast2-add-on-4.2.4/src/desktop/org.opensuse.yast.AddOn.desktop
--- old/yast2-add-on-4.1.12/src/desktop/org.opensuse.yast.AddOn.desktop 
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-add-on-4.2.4/src/desktop/org.opensuse.yast.AddOn.desktop  
2019-07-26 12:49:51.000000000 +0200
@@ -0,0 +1,27 @@
+[Desktop Entry]
+Type=Application
+Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Software;
+
+X-KDE-ModuleType=Library
+X-KDE-HasReadOnlyMode=true
+X-SuSE-YaST-Call=add-on
+
+X-SuSE-YaST-Group=Software
+X-SuSE-YaST-Argument=
+X-SuSE-YaST-RootOnly=true
+X-SuSE-YaST-AutoInst=configure
+X-SuSE-YaST-Geometry=
+X-SuSE-YaST-SortKey=
+X-SuSE-YaST-AutoInstResource=
+X-SuSE-YaST-AutoInstPath=install
+X-SuSE-YaST-AutoInstSchema=add-on.rnc
+X-SuSE-YaST-AutoInstClonable=true
+X-SuSE-YaST-Keywords=update,packages,repositories,software
+
+Icon=yast-addon
+Exec=xdg-su -c "/sbin/yast2 add-on"
+
+Name=YaST Add-On Products
+GenericName=Add-On Products
+Comment=Install or remove add-on products
+StartupNotify=true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-add-on-4.1.12/src/desktop/org.opensuse.yast.Vendor.desktop 
new/yast2-add-on-4.2.4/src/desktop/org.opensuse.yast.Vendor.desktop
--- old/yast2-add-on-4.1.12/src/desktop/org.opensuse.yast.Vendor.desktop        
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-add-on-4.2.4/src/desktop/org.opensuse.yast.Vendor.desktop 
2019-07-26 12:49:51.000000000 +0200
@@ -0,0 +1,24 @@
+[Desktop Entry]
+Type=Application
+Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc;
+
+X-KDE-ModuleType=Library
+X-KDE-HasReadOnlyMode=true
+X-SuSE-YaST-Call=vendor
+
+X-SuSE-YaST-Group=Misc
+X-SuSE-YaST-Argument=
+X-SuSE-YaST-RootOnly=true
+X-SuSE-YaST-AutoInst=
+X-SuSE-YaST-Geometry=
+X-SuSE-YaST-SortKey=
+X-SuSE-YaST-AutoInstResource=
+X-SuSE-YaST-Keywords=vendor,cd,driver,update,packages,repositories,software
+
+Icon=yast-vendor
+Exec=xdg-su -c "/sbin/yast2 vendor"
+
+Name=YaST Vendor Driver
+GenericName=Vendor Driver
+Comment=Install a driver from a vendor-specific medium
+StartupNotify=true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.1.12/src/desktop/vendor.desktop 
new/yast2-add-on-4.2.4/src/desktop/vendor.desktop
--- old/yast2-add-on-4.1.12/src/desktop/vendor.desktop  2019-05-23 
10:24:34.000000000 +0200
+++ new/yast2-add-on-4.2.4/src/desktop/vendor.desktop   1970-01-01 
01:00:00.000000000 +0100
@@ -1,23 +0,0 @@
-[Desktop Entry]
-Type=Application
-Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc;
-
-X-KDE-ModuleType=Library
-X-KDE-HasReadOnlyMode=true
-X-SuSE-YaST-Call=vendor
-
-X-SuSE-YaST-Group=Misc
-X-SuSE-YaST-Argument=
-X-SuSE-YaST-RootOnly=true
-X-SuSE-YaST-AutoInst=
-X-SuSE-YaST-Geometry=
-X-SuSE-YaST-SortKey=
-X-SuSE-YaST-AutoInstResource=
-X-SuSE-YaST-Keywords=vendor,cd,driver,update,packages,repositories,software
-
-Icon=yast-vendor
-Exec=xdg-su -c "/sbin/yast2 vendor"
-
-Name=Vendor Driver CD
-GenericName=Install a driver from a vendor-specific CD-ROM
-StartupNotify=true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-add-on-4.1.12/src/include/add-on/add-on-workflow.rb 
new/yast2-add-on-4.2.4/src/include/add-on/add-on-workflow.rb
--- old/yast2-add-on-4.1.12/src/include/add-on/add-on-workflow.rb       
2019-05-23 10:24:34.000000000 +0200
+++ new/yast2-add-on-4.2.4/src/include/add-on/add-on-workflow.rb        
2019-07-26 12:49:51.000000000 +0200
@@ -847,7 +847,7 @@
       Wizard.HideBackButton if !enable_back
       Wizard.HideAbortButton if !enable_abort
 
-      Wizard.SetDesktopIcon("add-on")
+      Wizard.SetDesktopIcon("org.opensuse.yast.AddOn")
 
       # disable delete button if no items listed
       # bug #203809
@@ -1027,6 +1027,9 @@
           Wizard.SetTitleIcon("yast-addon")
           ret2 = RunWizard()
 
+          break if ret2 == :back
+          return :abort if ret2 == :abort
+
           log.info "Subworkflow result: ret2: #{ret2}"
 
           if ret2 == :next
@@ -1052,7 +1055,7 @@
             # Release all sources after adding a new one
             # because of CD/DVD + url cd://
             Pkg.SourceReleaseAll
-          elsif ret2 == :abort || ret2 == :cancel
+          elsif ret2 == :cancel
             log.info("Aborted, removing add-on repositories: 
#{@added_repos.inspect}")
 
             # remove the repository
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-add-on-4.1.12/src/lib/add-on/clients/add-on_auto.rb 
new/yast2-add-on-4.2.4/src/lib/add-on/clients/add-on_auto.rb
--- old/yast2-add-on-4.1.12/src/lib/add-on/clients/add-on_auto.rb       
2019-05-23 10:24:34.000000000 +0200
+++ new/yast2-add-on-4.2.4/src/lib/add-on/clients/add-on_auto.rb        
2019-07-26 12:49:51.000000000 +0200
@@ -2,6 +2,7 @@
 require "installation/auto_client"
 
 Yast.import "AddOnProduct"
+Yast.import "AddOnOthers"
 Yast.import "AutoinstSoftware"
 Yast.import "Installation"
 Yast.import "Label"
@@ -24,12 +25,15 @@
     end
 
     def import(data)
-      add_on_products = data.fetch("add_on_products", [])
+      add_ons = data.fetch("add_on_products", [])
+      # Add-on products have the same format as add-ons which have been
+      # added manually by the user. So we can take the same workflow here.
+      add_ons += data.fetch("add_on_others", [])
 
-      valid_add_on_products = add_on_products.reject.with_index(1) do |add_on, 
index|
+      valid_add_ons = add_ons.reject.with_index(1) do |add_on, index|
         next false unless add_on.fetch("media_url", "").empty?
 
-        log.error("Missing <media_url> value in the #{index}. add-on-product 
definition")
+        log.error("Missing <media_url> value in the #{index}. add-on 
definition")
 
         # abort import/installation
         return false unless skip_add_on_and_continue?(index)
@@ -37,7 +41,7 @@
         true
       end
 
-      AddOnProduct.Import("add_on_products" => valid_add_on_products)
+      AddOnProduct.Import("add_on_products" => valid_add_ons)
     end
 
     # Returns an unordered HTML list summarizing the Add-on products
@@ -114,7 +118,7 @@
     end
 
     def export
-      AddOnProduct.Export
+      AddOnProduct.Export.merge(AddOnOthers.Export())
     end
 
     # Creates sources from add on products
@@ -165,6 +169,9 @@
       Pkg.PkgSolve(true)
 
       ReadFromSystem()
+
+      # Reading user defined repos
+      AddOnOthers.Read()
     end
 
   private
@@ -189,6 +196,7 @@
 
       loop do
         source_id = Pkg.SourceCreate(url, product_dir)
+        Pkg.SourceReleaseAll
 
         log.info("New source ID: #{source_id}")
 
@@ -203,6 +211,7 @@
         else
           # bugzilla #260613
           AddOnProduct.Integrate(source_id)
+          Pkg.SourceReleaseAll
 
           adjust_source_attributes(add_on, source_id)
           install_product(product)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.1.12/src/modules/AddOnOthers.rb 
new/yast2-add-on-4.2.4/src/modules/AddOnOthers.rb
--- old/yast2-add-on-4.1.12/src/modules/AddOnOthers.rb  1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-add-on-4.2.4/src/modules/AddOnOthers.rb   2019-07-26 
12:49:51.000000000 +0200
@@ -0,0 +1,80 @@
+# encoding: utf-8
+require "yast"
+require "y2packager/resolvable"
+
+# Yast namespace
+module Yast
+  # Describes all Add-Ons which are not Add-On-Products or Base-Products.
+  # Usually custom or 3rd party repositories.
+
+  class AddOnOthersClass < Module
+           
+    include Yast::Logger
+
+    #     add_on_others = [
+    #        {
+    #          "media" => 4, # ID of the source
+    #          "name" : "openSUSE version XX.Y",
+    #          "media_url"=>"dvd:/?devices=/dev/sr1"
+    #          ....
+    #        },
+    #        ...
+    #      ]
+    attr_reader :add_on_others
+
+    def main
+      Yast.import "Pkg"
+      textdomain "add-on"
+
+      @add_on_others = []
+    end
+
+    def Read
+      # Removing all repos which have installed based products
+      # and add-on products.
+      installed_product_names = Y2Packager::Resolvable.find(kind: :product, 
status: :installed).map(&:name)
+      installed_available_products = Y2Packager::Resolvable.find(kind: 
:product, status: :available).select do |p|
+        installed_product_names.include?(p.name)
+      end
+
+      installed_src_ids = installed_available_products.map(&:source).uniq
+      other_repo_ids = Pkg.SourceGetCurrent(true) - installed_src_ids
+      @add_on_others = other_repo_ids.map{ |id| Pkg.SourceGeneralData(id) }
+    end
+
+    # Returns all enabled user added repos which are not base products or 
add-on products.
+    #
+    # @return [Hash] User defined repos.
+    #
+    # @example This is an XML file created from exported map:
+    #      <add-on>
+    #        <add_on_others config:type="list">
+    #          <listentry>
+    #            <media_url>ftp://server.name/.../</media_url>
+    #            <alias>alias name</alias>
+    #            <priority config:type="integer">20</priority>
+    #            <name>Repository name</name>
+    #            <product_dir>/</product_dir>
+    #          </listentry>
+    #          ...
+    #        </add_on_others>
+    #      </add-on>
+    def Export
+      others = @add_on_others.map do |p|
+        { "media_url"   => p["url"],
+          "alias"       => p["alias"],
+          "priority"    => p["priority"],
+          "name"        => p["name"],
+          "product_dir" => p["product_dir"] }
+      end
+      { "add_on_others" => others }
+    end
+
+    publish function: :Export, type: "map ()"
+    publish function: :Read, type: "map()"
+  end
+
+  AddOnOthers = AddOnOthersClass.new
+  AddOnOthers.main
+end
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.1.12/test/addon_others_test.rb 
new/yast2-add-on-4.2.4/test/addon_others_test.rb
--- old/yast2-add-on-4.1.12/test/addon_others_test.rb   1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-add-on-4.2.4/test/addon_others_test.rb    2019-07-26 
12:49:51.000000000 +0200
@@ -0,0 +1,96 @@
+#! /usr/bin/env rspec
+
+require_relative "./test_helper"
+Yast.import "AddOnOthers"
+
+describe Yast::AddOnOthers do
+  subject { Yast::AddOnOthers }
+  
+  let(:available_products) do
+    [ Y2Packager::Resolvable.new(kind: :product,
+        name: "SLE_RT", status: :available, source: 2 ),
+      Y2Packager::Resolvable.new(kind: :product,
+        name: "SLE_HPC", status: :available, source: 2 ),
+      Y2Packager::Resolvable.new(kind: :product,                  
+        name: "SLE_SAP", status: :available, source: 2 ),
+      Y2Packager::Resolvable.new(kind: :product,                  
+        name: "SLE_BCL", status: :available, source: 2 ),
+      Y2Packager::Resolvable.new(kind: :product,                  
+        name: "SLED", status: :available, source: 2 ),
+      Y2Packager::Resolvable.new(kind: :product,                     
+        name: "SUSE-Manager-Server", status: :available, source: 2 ),
+      Y2Packager::Resolvable.new(kind: :product,
+        name: "SUSE-Manager-Proxy", status: :available, source: 2 ),
+      Y2Packager::Resolvable.new(kind: :product,
+        name: "sle-module-desktop-applications", status: :available, source: 1 
),
+      Y2Packager::Resolvable.new(kind: :product,
+        name: "sle-module-basesystem", status: :available, source: 0 ),
+      Y2Packager::Resolvable.new(kind: :product,
+        name: "SLES", status: :available, source: 3 ),
+      Y2Packager::Resolvable.new(kind: :product,
+        name: "SLES", status: :available, source: 2 ),
+      Y2Packager::Resolvable.new(kind: :product,
+        name: "SUSE-Manager-Retail-Branch-Server", status: :available, source: 
2 )
+    ]
+  end
+
+  let(:installed_products) do
+    [ Y2Packager::Resolvable.new(kind: :product,
+        name: "sle-module-desktop-applications", status: :installed, source: 
-1 ),
+      Y2Packager::Resolvable.new(kind: :product,
+        name: "sle-module-basesystem", status: :installed, source: -1 ),
+      Y2Packager::Resolvable.new(kind: :product,
+        name: "SLES", status: :installed, source: -1 ),
+    ]
+  end
+
+  let(:repo_hash) do
+    { "alias"       => "user defined",
+      "url"         => "http://xxx.url";,
+      "name"        => "user_defined",
+      "priority"    => 19,
+      "product_dir" => "/"
+    }    
+  end
+
+  before do
+    allow(Y2Packager::Resolvable).to receive(:find).with(kind: :product, 
status: :available)
+      .and_return(available_products)
+    allow(Y2Packager::Resolvable).to receive(:find).with(kind: :product, 
status: :installed)
+      .and_return(installed_products)
+    allow(Yast::Pkg).to receive(:SourceGetCurrent).with(true)
+      .and_return([0,1,2,3,4])
+  end
+      
+  describe "#Read" do
+   
+    context "installed products and add-ons are available" do
+    
+      it "returns user defined repo only" do
+        expect(Yast::Pkg).to receive(:SourceGeneralData).with(4)
+          .and_return(repo_hash)
+        expect(Yast::AddOnOthers.Read).to eq([repo_hash])
+      end
+    end
+  end
+
+  describe "#Export" do
+   
+    context "installed products and add-ons are available" do
+      let(:ret) do
+        { "media_url"   => repo_hash["url"],
+          "alias"       => repo_hash["alias"],
+          "priority"    => repo_hash["priority"],
+          "name"        => repo_hash["name"],
+          "product_dir" => repo_hash["product_dir"] }        
+      end
+    
+      it "returns an array of user defined repos in AY format" do
+        allow(Yast::Pkg).to receive(:SourceGeneralData).with(4)
+          .and_return(repo_hash)
+        Yast::AddOnOthers.Read()
+        expect(Yast::AddOnOthers.Export).to eq({ "add_on_others" => [ret] })
+      end
+    end
+  end  
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-add-on-4.1.12/test/y2add_on/clients/add-on_auto_test.rb 
new/yast2-add-on-4.2.4/test/y2add_on/clients/add-on_auto_test.rb
--- old/yast2-add-on-4.1.12/test/y2add_on/clients/add-on_auto_test.rb   
2019-05-23 10:24:34.000000000 +0200
+++ new/yast2-add-on-4.2.4/test/y2add_on/clients/add-on_auto_test.rb    
2019-07-26 12:49:51.000000000 +0200
@@ -8,7 +8,9 @@
 describe Yast::AddOnAutoClient do
   describe "#import" do
     let(:params) do
-      { "add_on_products" => add_on_products }
+      { "add_on_products" => add_on_products,
+        "add_on_others" => add_on_others
+      }
     end
 
     context "when 'add_on_products' param is NOT given" do
@@ -32,8 +34,21 @@
         ]
       end
 
+      let(:add_on_others) do
+        [
+          {
+            "alias"       => "user defined",
+            "media_url"   => "http://xxx.url";,
+            "name"        => "user_defined",
+            "priority"    => 19,
+            "product_dir" => "/"
+          }
+        ]
+      end
+
       it "imports all add-on products given" do
-        expect(Yast::AddOnProduct).to receive(:Import).with(params)
+        expect(Yast::AddOnProduct).to receive(:Import).with(
+          { "add_on_products" => add_on_products + add_on_others})
 
         subject.import(params)
       end
@@ -68,6 +83,7 @@
           }
         ]
       end
+      let(:add_on_others) { [] }
 
       let(:rejected_package_error) { "Missing <media_url> value in the 2. 
add-on-product definition" }
       let(:missed_media_url_error) { /Missing mandatory <media_url> value at 
index 2/ }
@@ -205,11 +221,23 @@
   end
 
   describe "#export" do
-    # FIXME: use a more reallistic configuration data example
-    it "returns configuration data" do
-      allow(Yast::AddOnProduct).to receive(:Export).and_return("configuration 
data")
+    let(:add_on_products) do
+      {"add_on_products"=> [
+        { "product_dir"=>"/Module-Desktop-Applications",
+          "product"=>"sle-module-desktop-applications",
+          "media_url"=>"dvd:/?devices=/dev/sr1" },
+        { "product_dir"=>"/Module-Basesystem",
+          "product"=>"sle-module-basesystem",
+          "media_url"=>"dvd:/?devices=/dev/sr1" }
+      ]}
+    end
+    let(:add_on_others) { {"add_on_others"=>[]} }
+
+    it "returns add-on products and other user defined add-ons" do
+      expect(Yast::AddOnProduct).to 
receive(:Export).and_return(add_on_products)
+      expect(Yast::AddOnOthers).to receive(:Export).and_return(add_on_others)
 
-      expect(subject.export).to eq("configuration data")
+      expect(subject.export).to eq(add_on_products.merge(add_on_others))
     end
   end
 
@@ -276,6 +304,7 @@
       before do
         allow(Yast::AddOnProduct).to 
receive(:add_on_products).and_return(add_on_products)
         allow(Yast::Pkg).to receive(:SourceEditSet)
+        allow(Yast::Pkg).to receive(:SourceReleaseAll)
         allow(Yast::Pkg).to receive(:SourceCreate).and_return(1)
         allow(Yast::Pkg).to receive(:SourceEditGet).and_return(repos)
         allow(Yast::Pkg).to receive(:ExpandedUrl)
@@ -320,6 +349,12 @@
 
         subject.write
       end
+
+      it "releases the media accessors" do
+        expect(Yast::Pkg).to receive(:SourceReleaseAll)
+
+        subject.write
+      end
     end
   end
 


Reply via email to