Hello community,

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

Package is "yast2-packager"

Mon Jul 17 10:31:06 2017 rev:336 rq:509517 version:3.2.24

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes    
2017-05-06 20:46:01.873337154 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-packager.new/yast2-packager.changes       
2017-07-17 10:31:07.455964064 +0200
@@ -1,0 +2,6 @@
+Tue Jul 11 14:41:58 UTC 2017 - lsle...@suse.cz
+
+- Properly handle multiple product renames (bsc#1048141)
+- 3.2.24
+
+-------------------------------------------------------------------

Old:
----
  yast2-packager-3.2.23.tar.bz2

New:
----
  yast2-packager-3.2.24.tar.bz2

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

Other differences:
------------------
++++++ yast2-packager.spec ++++++
--- /var/tmp/diff_new_pack.Oz0GaQ/_old  2017-07-17 10:31:08.023883997 +0200
+++ /var/tmp/diff_new_pack.Oz0GaQ/_new  2017-07-17 10:31:08.023883997 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-packager
-Version:        3.2.23
+Version:        3.2.24
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-packager-3.2.23.tar.bz2 -> yast2-packager-3.2.24.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.2.23/package/yast2-packager.changes 
new/yast2-packager-3.2.24/package/yast2-packager.changes
--- old/yast2-packager-3.2.23/package/yast2-packager.changes    2017-05-04 
16:09:30.817375667 +0200
+++ new/yast2-packager-3.2.24/package/yast2-packager.changes    2017-07-11 
18:27:19.967423519 +0200
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Tue Jul 11 14:41:58 UTC 2017 - lsle...@suse.cz
+
+- Properly handle multiple product renames (bsc#1048141)
+- 3.2.24
+
+-------------------------------------------------------------------
 Fri Apr 28 08:45:31 UTC 2017 - jreidin...@suse.com
 
 - Escape backslashes in installation repo URL (bsc#1032506)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.2.23/package/yast2-packager.spec 
new/yast2-packager-3.2.24/package/yast2-packager.spec
--- old/yast2-packager-3.2.23/package/yast2-packager.spec       2017-05-04 
16:09:30.817375667 +0200
+++ new/yast2-packager-3.2.24/package/yast2-packager.spec       2017-07-11 
18:27:19.967423519 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-packager
-Version:        3.2.23
+Version:        3.2.24
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.2.23/src/modules/AddOnProduct.rb 
new/yast2-packager-3.2.24/src/modules/AddOnProduct.rb
--- old/yast2-packager-3.2.23/src/modules/AddOnProduct.rb       2017-05-04 
16:09:30.893375667 +0200
+++ new/yast2-packager-3.2.24/src/modules/AddOnProduct.rb       2017-07-11 
18:27:20.103423519 +0200
@@ -2335,8 +2335,8 @@
     def add_rename_to_hash(renames, old_name, new_name)
       return renames if old_name == new_name || renamed_at?(renames, old_name, 
new_name)
       log.info "Adding product rename: '#{old_name}' => '#{new_name}'"
-      renames.merge(old_name => new_name) do |key, old_val, new_val|
-        old_val.nil? ? [new_val] : old_val + [new_val]
+      renames.merge(old_name => [new_name]) do |key, old_val, new_val|
+        old_val.nil? ? [new_val] : old_val + new_val
       end
     end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.2.23/test/addon_product_test.rb 
new/yast2-packager-3.2.24/test/addon_product_test.rb
--- old/yast2-packager-3.2.23/test/addon_product_test.rb        2017-05-04 
16:09:30.997375667 +0200
+++ new/yast2-packager-3.2.24/test/addon_product_test.rb        2017-07-11 
18:27:20.235423519 +0200
@@ -65,6 +65,11 @@
   end
 
   describe "#add_rename" do
+    before do
+      # reset the known renames for each test
+      subject.main
+    end
+
     it "adds a new product rename" do
       expect(Yast::AddOnProduct.renamed?("FOO", "BAR")).to eq(false)
       Yast::AddOnProduct.add_rename("FOO", "BAR")
@@ -79,6 +84,54 @@
       # check the already known rename
       expect(Yast::AddOnProduct.renamed?("SUSE_SLES", "SLES")).to eq(true)
     end
+
+    it "handles single rename" do
+      # not known yet
+      expect(Yast::AddOnProduct.renamed?("SUSE_SLE", "SLES")).to eq(false)
+      # add a single rename
+      Yast::AddOnProduct.add_rename("SUSE_SLE", "SLES")
+
+      # the rename is known
+      expect(Yast::AddOnProduct.renamed?("SUSE_SLE", "SLES")).to eq(true)
+      # the rest is unknown
+      expect(Yast::AddOnProduct.renamed?("SUSE_SLE", "SLES_SAP")).to eq(false)
+      expect(Yast::AddOnProduct.renamed?("SUSE_SLE", "SLES_NEW")).to eq(false)
+    end
+
+    # handle correctly double renames (bsc#1048141)
+    it "handles double rename" do
+      # not known yet
+      expect(Yast::AddOnProduct.renamed?("SUSE_SLE", "SLES")).to eq(false)
+      expect(Yast::AddOnProduct.renamed?("SUSE_SLE", "SLES_SAP")).to eq(false)
+
+      # add several renames
+      Yast::AddOnProduct.add_rename("SUSE_SLE", "SLES")
+      Yast::AddOnProduct.add_rename("SUSE_SLE", "SLES_SAP")
+
+      # the renames are known
+      expect(Yast::AddOnProduct.renamed?("SUSE_SLE", "SLES")).to eq(true)
+      expect(Yast::AddOnProduct.renamed?("SUSE_SLE", "SLES_SAP")).to eq(true)
+      # the rest is unknown
+      expect(Yast::AddOnProduct.renamed?("SUSE_SLE", "SLES_NEW")).to eq(false)
+    end
+
+    # handle correctly multiple renames
+    it "handles multiple renames" do
+      # not known yet
+      expect(Yast::AddOnProduct.renamed?("SUSE_SLE", "SLES")).to eq(false)
+      expect(Yast::AddOnProduct.renamed?("SUSE_SLE", "SLES_SAP")).to eq(false)
+      expect(Yast::AddOnProduct.renamed?("SUSE_SLE", "SLES_NEW")).to eq(false)
+
+      # add several renames
+      Yast::AddOnProduct.add_rename("SUSE_SLE", "SLES")
+      Yast::AddOnProduct.add_rename("SUSE_SLE", "SLES_SAP")
+      Yast::AddOnProduct.add_rename("SUSE_SLE", "SLES_NEW")
+
+      # all renames are known
+      expect(Yast::AddOnProduct.renamed?("SUSE_SLE", "SLES")).to eq(true)
+      expect(Yast::AddOnProduct.renamed?("SUSE_SLE", "SLES_SAP")).to eq(true)
+      expect(Yast::AddOnProduct.renamed?("SUSE_SLE", "SLES_NEW")).to eq(true)
+    end
   end
 
   describe "#SetRepoUrlAlias" do


Reply via email to