Hello community,

here is the log from the commit of package yast2-add-on for openSUSE:Factory 
checked in at 2017-07-17 10:31:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-add-on (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-add-on.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-add-on"

Mon Jul 17 10:31:01 2017 rev:81 rq:509383 version:3.2.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-add-on/yast2-add-on.changes        
2017-04-12 17:10:03.723532558 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-add-on.new/yast2-add-on.changes   
2017-07-17 10:31:02.576651961 +0200
@@ -1,0 +2,7 @@
+Mon Jul 10 15:20:52 UTC 2017 - lsle...@suse.cz
+
+- Do not skip the boot command line addons ("addon=...") when
+  using the default online repositories (bsc#1047239)
+- 3.2.1
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ yast2-add-on.spec ++++++
--- /var/tmp/diff_new_pack.CWFArr/_old  2017-07-17 10:31:03.056584299 +0200
+++ /var/tmp/diff_new_pack.CWFArr/_new  2017-07-17 10:31:03.056584299 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-add-on
-Version:        3.2.0
+Version:        3.2.1
 Release:        0
 Summary:        YaST2 - Add-On media installation code
 License:        GPL-2.0

++++++ yast2-add-on-3.2.0.tar.bz2 -> yast2-add-on-3.2.1.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-3.2.0/package/yast2-add-on.changes 
new/yast2-add-on-3.2.1/package/yast2-add-on.changes
--- old/yast2-add-on-3.2.0/package/yast2-add-on.changes 2017-04-07 
16:41:04.214642099 +0200
+++ new/yast2-add-on-3.2.1/package/yast2-add-on.changes 2017-07-11 
11:41:05.029789259 +0200
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Mon Jul 10 15:20:52 UTC 2017 - lsle...@suse.cz
+
+- Do not skip the boot command line addons ("addon=...") when
+  using the default online repositories (bsc#1047239)
+- 3.2.1
+
+-------------------------------------------------------------------
 Mon Apr  3 11:20:57 UTC 2017 - sch...@suse.de
 
 - AutoYaST: Expanding URL in order to handle tags like $releasever.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-3.2.0/package/yast2-add-on.spec 
new/yast2-add-on-3.2.1/package/yast2-add-on.spec
--- old/yast2-add-on-3.2.0/package/yast2-add-on.spec    2017-04-07 
16:41:04.214642099 +0200
+++ new/yast2-add-on-3.2.1/package/yast2-add-on.spec    2017-07-11 
11:41:05.029789259 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-add-on
-Version:        3.2.0
+Version:        3.2.1
 Release:        0
 Summary:        YaST2 - Add-On media installation code
 License:        GPL-2.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-3.2.0/src/clients/inst_add-on.rb 
new/yast2-add-on-3.2.1/src/clients/inst_add-on.rb
--- old/yast2-add-on-3.2.0/src/clients/inst_add-on.rb   2017-04-07 
16:41:04.238642099 +0200
+++ new/yast2-add-on-3.2.1/src/clients/inst_add-on.rb   2017-07-11 
11:41:05.065789259 +0200
@@ -5,12 +5,17 @@
 # Summary:     Select add-on products for installation
 # Authors:     Jiri Srain <jsr...@suse.de>
 #
+
+require "tempfile"
+
 module Yast
   # @note This client should not be called from other clients directly
   #  via WFM.call (only from the control.xml file), it can restart the workflow
   #  from the next step and return to the caller AFTER the complete workflow
   #  is finished (or aborted)
   class InstAddOnClient < Client
+    include Yast::Logger
+
     def main
       Yast.import "UI"
       Yast.import "Pkg"
@@ -28,6 +33,7 @@
       Yast.import "Installation"
       Yast.import "Linuxrc"
       Yast.import "String"
+      Yast.import "URL"
 
       Yast.include self, "add-on/add-on-workflow.rb"
 
@@ -43,36 +49,38 @@
       PackageCallbacks.SetMediaCallbacks
 
       # add add-ons specified on the kernel command line
-      @addon_opt = Linuxrc.InstallInf("addon")
-
-      # add the add-ons just once, skip adding if any add-on is
-      # already present (handle going back and forth properly)
-      if @addon_opt != nil && AddOnProduct.add_on_products == []
-        Builtins.y2milestone("Specified extra add-ons via kernel cmdline")
-
-        # store the add-ons list into a temporary file
-        @tmp_dir = Convert.to_string(SCR.Read(path(".target.tmpdir")))
-        @tmp_file = Ops.add(@tmp_dir, "/tmp_addon_list")
-        # each add-on on a separate line
-        @addons = String.Replace(@addon_opt, ",", "\n")
+      addon_opt = Linuxrc.InstallInf("addon")
 
-        # network setup is needed for local media installation (e.g. DVD) with 
remote Add-ons
-        @ret2 = NetworkSetupForAddons(Builtins.splitstring(@addons, "\n"))
+      # the "addon" boot option is present
+      if addon_opt != nil
+        missing_addons = addon_opt.split(",") - current_addons
+
+        # add the add-ons just once, skip adding if all add-ons are
+        # already present (handle going back and forth properly)
+        if missing_addons.empty?
+          log.info("All kernel cmdline addons already present")
+        else
+          # do not reveal the URL passwords in the log
+          missing_addons_log = missing_addons.map { |a| URL.HidePassword(a) }
+          log.info("Adding extra add-ons from kernel cmdline: 
#{missing_addons_log}")
 
-        return @ret2 if Builtins.contains([:back, :abort], @ret2)
-
-        SCR.Write(path(".target.string"), @tmp_file, @addons)
-
-        # import the add-ons from the temporary file
-        AddOnProduct.AddPreselectedAddOnProducts(
-          [{ "file" => @tmp_file, "type" => "plain" }]
-        )
+          # network setup is needed when installing from a local medium (DVD) 
with remote Add-ons
+          ret = NetworkSetupForAddons(missing_addons)
+          return ret if Builtins.contains([:back, :abort], ret)
 
-        # remove the temporary file
-        SCR.Execute(
-          path(".target.bash"),
-          Builtins.sformat("/bin/rm -rf '%1'", String.Quote(@tmp_file))
-        )
+          begin
+            tmp = Tempfile.new("cmdline-addons-")
+            # each add-on on a separate line
+            File.write(tmp.path, missing_addons.join("\n"))
+            # import the add-ons from the temporary file
+            AddOnProduct.AddPreselectedAddOnProducts(
+              [{ "file" => tmp.path, "type" => "plain" }]
+            )
+          ensure
+            tmp.close
+            tmp.unlink
+          end
+        end
       end
 
       # the module was started because of the kernel command line option
@@ -100,7 +108,7 @@
         @ret = :finish if @ret == :next
       end
 
-      @ret 
+      @ret
 
       # EOF
     end
@@ -132,7 +140,7 @@
             network_needed = true
             raise Break
           end
-        end 
+        end
 
 
         if network_needed
@@ -146,6 +154,14 @@
 
       :next
     end
+
+    # get the URLs of the all present add-ons
+    # @return [Array<String>] list of URLs (empty list if no add-on defined)
+    def current_addons
+      AddOnProduct.add_on_products.map do |addon|
+        Pkg.SourceURL(addon["media"])
+      end
+    end
   end
 end
 


Reply via email to