Hello community,

here is the log from the commit of package yast2-installation for 
openSUSE:Factory checked in at 2016-08-22 10:48:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-installation (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-installation.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-installation"

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-installation/yast2-installation.changes    
2016-08-18 10:20:52.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.yast2-installation.new/yast2-installation.changes   
    2016-08-22 10:48:15.000000000 +0200
@@ -1,0 +2,7 @@
+Wed Aug 17 15:02:02 UTC 2016 - jreidin...@suse.com
+
+- filter out same repositories from extraurls if they differ only
+  in trailing slash (bnc#970488)
+- 3.1.210
+
+-------------------------------------------------------------------

Old:
----
  yast2-installation-3.1.208.tar.bz2

New:
----
  yast2-installation-3.1.210.tar.bz2

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

Other differences:
------------------
++++++ yast2-installation.spec ++++++
--- /var/tmp/diff_new_pack.DlYWll/_old  2016-08-22 10:48:16.000000000 +0200
+++ /var/tmp/diff_new_pack.DlYWll/_new  2016-08-22 10:48:16.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-installation
-Version:        3.1.208
+Version:        3.1.210
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-installation-3.1.208.tar.bz2 -> yast2-installation-3.1.210.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-installation-3.1.208/CONTRIBUTING.md 
new/yast2-installation-3.1.210/CONTRIBUTING.md
--- old/yast2-installation-3.1.208/CONTRIBUTING.md      2016-08-17 
11:06:09.000000000 +0200
+++ new/yast2-installation-3.1.210/CONTRIBUTING.md      2016-08-19 
16:32:01.000000000 +0200
@@ -3,7 +3,7 @@
 
 YaST is an open source project and as such it welcomes all kinds of
 contributions. If you decide to contribute, please follow these guidelines to
-ensure the process is effective and pleasant both for you and YaST maintainers.
+ensure the process is effective and pleasant both for you and the YaST 
maintainers.
 
 There are two main forms of contribution: reporting bugs and performing code
 changes.
@@ -17,13 +17,11 @@
 
registration](https://secure-www.novell.com/selfreg/jsp/createSimpleAccount.jsp)
 if you don't have an account yet.)
 
-If you find a problem, please report it either using
-[Bugzilla](https://bugzilla.suse.com/) or GitHub issues. We can't guarantee
-that every bug will be fixed, but we'll try.
-
 When creating a bug report, please follow our [bug reporting
 guidelines](http://en.opensuse.org/openSUSE:Report_a_YaST_bug).
 
+We can't guarantee that every bug will be fixed, but we'll try.
+
 Code Changes
 ------------
 
@@ -44,15 +42,22 @@
      to the [Ruby style
      guide](https://github.com/SUSE/style-guides/blob/master/Ruby.md).
 
-  4. Make sure your change didn't break anything by building the RPM package
+  4. Update the package version (in `packages/*.spec`, usually by
+     `rake version:bump`) and add a new entry to the `package/*.changes` file
+     (by `osc vc package`).  
+     For bigger changes or changes which need longer discussion it is advised 
to
+     add this as a separate last commit so it can be easily updated when 
another
+     change is merged in the meantime.
+
+  5. Make sure your change didn't break anything by building the RPM package
      (`rake osc:build`). The build process includes running the full testsuite.
 
-  5. Publish the branch and create a pull request.
+  6. Publish the branch and create a pull request.
 
-  6. YaST developers will review your change and possibly point out issues.
+  7. YaST developers will review your change and possibly point out issues.
      Adapt the code under their guidance until they are all resolved.
 
-  7. Finally, the pull request will get merged or rejected.
+  8. Finally, the pull request will get merged or rejected.
 
 See also [GitHub's guide on
 contributing](https://help.github.com/articles/fork-a-repo).
@@ -60,9 +65,6 @@
 If you want to do multiple unrelated changes, use separate branches and pull
 requests.
 
-Do not change the `VERSION` and `*.changes` files as this could lead to
-conflicts.
-
 ### Commits
 
 Each commit in the pull request should do only one thing, which is clearly
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-3.1.208/package/yast2-installation.changes 
new/yast2-installation-3.1.210/package/yast2-installation.changes
--- old/yast2-installation-3.1.208/package/yast2-installation.changes   
2016-08-17 11:06:09.000000000 +0200
+++ new/yast2-installation-3.1.210/package/yast2-installation.changes   
2016-08-19 16:32:01.000000000 +0200
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Wed Aug 17 15:02:02 UTC 2016 - jreidin...@suse.com
+
+- filter out same repositories from extraurls if they differ only
+  in trailing slash (bnc#970488)
+- 3.1.210
+
+-------------------------------------------------------------------
 Tue Aug 16 15:34:43 UTC 2016 - kanders...@suse.com
 
 - SSH Importer: Width fix to avoid cut of CheckBoxFrame Label
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-3.1.208/package/yast2-installation.spec 
new/yast2-installation-3.1.210/package/yast2-installation.spec
--- old/yast2-installation-3.1.208/package/yast2-installation.spec      
2016-08-17 11:06:09.000000000 +0200
+++ new/yast2-installation-3.1.210/package/yast2-installation.spec      
2016-08-19 16:32:01.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-installation
-Version:        3.1.208
+Version:        3.1.210
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-3.1.208/src/lib/installation/clients/inst_extrasources.rb
 
new/yast2-installation-3.1.210/src/lib/installation/clients/inst_extrasources.rb
--- 
old/yast2-installation-3.1.208/src/lib/installation/clients/inst_extrasources.rb
    2016-08-17 11:06:09.000000000 +0200
+++ 
new/yast2-installation-3.1.210/src/lib/installation/clients/inst_extrasources.rb
    2016-08-19 16:32:01.000000000 +0200
@@ -19,29 +19,28 @@
 # current contact information at www.novell.com.
 # 
------------------------------------------------------------------------------
 
+Yast.import "UI"
+Yast.import "Pkg"
+Yast.import "GetInstArgs"
+Yast.import "Mode"
+Yast.import "PackageLock"
+Yast.import "ProductFeatures"
+# We need the constructor
+Yast.import "ProductControl"
+Yast.import "Installation"
+Yast.import "Icon"
+Yast.import "NetworkService"
+Yast.import "PackagesUI"
+Yast.import "Label"
+
 module Yast
   # This client loads the target and initializes the package manager.
   # Adds all sources defined in control file (software->extra_urls)
   # and stores them at the end.
   class InstExtrasourcesClient < Client
     def main
-      Yast.import "UI"
-      Yast.import "Pkg"
-
       textdomain "installation"
 
-      Yast.import "GetInstArgs"
-      Yast.import "Mode"
-      Yast.import "PackageLock"
-      Yast.import "ProductFeatures"
-      # We need the constructor
-      Yast.import "ProductControl"
-      Yast.import "Installation"
-      Yast.import "Icon"
-      Yast.import "NetworkService"
-      Yast.import "PackagesUI"
-      Yast.import "Label"
-
       # local sources that have been attached under /mnt during upgrade
       @local_urls = {}
 
@@ -213,12 +212,7 @@
     # @param [Array<String>] registered URLs of already registered 
repositories (they will be ignored to not register the same repository one more)
     # @return [Array<Hash>] of URLs to register
     def GetURLsToRegister(registered)
-      registered = deep_copy(registered)
-      urls_from_control_file = Convert.convert(
-        ProductFeatures.GetFeature("software", "extra_urls"),
-        from: "any",
-        to:   "list <map>"
-      )
+      urls_from_control_file = ProductFeatures.GetFeature("software", 
"extra_urls")
 
       if urls_from_control_file.nil?
         Builtins.y2milestone(
@@ -229,7 +223,9 @@
       end
 
       urls_from_control_file = Builtins.filter(urls_from_control_file) do 
|one_url|
-        if Builtins.contains(registered, Ops.get_string(one_url, "baseurl", 
""))
+        url = one_url["baseurl"] || ""
+        normalized_url = url.end_with?("/") ? url.chop : url
+        if registered.include?(normalized_url)
           Builtins.y2milestone(
             "Already registered: %1",
             Ops.get_string(one_url, "baseurl", "")
@@ -337,29 +333,26 @@
 
     # Returns list of already registered repositories.
     #
-    # @return [Array<String>] of registered repositories
+    # @return [Array<String>] of registered repositories without trailing '/'
     def RegisteredUrls
       # get all registered installation sources
       srcs = Pkg.SourceGetCurrent(false)
 
-      ret = []
-      Builtins.foreach(srcs) do |src|
+      result = srcs.each_with_object([]) do |src, ret|
         general = Pkg.SourceGeneralData(src)
-        url = Ops.get_string(general, "url", "")
-        ret = Builtins.add(ret, url) if !url.nil? && url != ""
-        if Mode.update && Builtins.regexpmatch(url, "^dir:[/]+mnt[/]+")
-          Ops.set(@local_urls, src, url)
-        end
+        url = general["url"]
+        next if url.nil? || url.empty?
+        @local_urls[src] = url if Mode.update && url =~ /^dir:\/+mnt\/+/
         # check for USB sources which should be disabled
-        if Builtins.issubstring(url, "device=/dev/disk/by-id/usb-")
-          Ops.set(@usb_sources, src, url)
-        end
+        @usb_sources[src] = url if url.include?("device=/dev/disk/by-id/usb-")
+        url.chop! if url.end_with?("/") # remove trailing slash to normalize 
path (see bnc#970488)
+        ret << url
       end
 
       # remove duplicates
-      ret = Builtins.toset(ret)
+      result.uniq!
 
-      Builtins.y2milestone("Registered sources: %1", ret)
+      Builtins.y2milestone("Registered sources: %1", result)
 
       Builtins.y2milestone(
         "Registered local sources under /mnt: %1",
@@ -368,7 +361,7 @@
 
       Builtins.y2milestone("Registered USB sources: %1", @usb_sources)
 
-      deep_copy(ret)
+      result
     end
 
     # Initialize the package manager
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-installation-3.1.208/test/Makefile.am 
new/yast2-installation-3.1.210/test/Makefile.am
--- old/yast2-installation-3.1.208/test/Makefile.am     2016-08-17 
11:06:09.000000000 +0200
+++ new/yast2-installation-3.1.210/test/Makefile.am     2016-08-19 
16:32:01.000000000 +0200
@@ -1,4 +1,5 @@
 TESTS = \
+  inst_extrasources_test.rb \
   inst_functions_test.rb \
   inst_finish_test.rb \
   inst_instsys_cleanup_client_test.rb \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-3.1.208/test/inst_extrasources_test.rb 
new/yast2-installation-3.1.210/test/inst_extrasources_test.rb
--- old/yast2-installation-3.1.208/test/inst_extrasources_test.rb       
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-installation-3.1.210/test/inst_extrasources_test.rb       
2016-08-19 16:32:01.000000000 +0200
@@ -0,0 +1,56 @@
+#! /usr/bin/env rspec
+
+require_relative "test_helper"
+
+require "installation/clients/inst_extrasources"
+
+describe Yast::InstExtrasourcesClient do
+  describe "#RegisteredUrls" do
+    before do
+      # fake main run, to avoid huge stubbing
+      subject.instance_variable_set(:"@local_urls", {})
+      subject.instance_variable_set(:"@usb_sources", {})
+
+      allow(Yast::Pkg).to 
receive(:SourceGetCurrent).with(false).and_return([0, 1, 2, 3])
+      allow(Yast::Pkg).to receive(:SourceGeneralData).with(0).and_return("url" 
=> "http://test.com/";)
+      allow(Yast::Pkg).to receive(:SourceGeneralData).with(1)
+        .and_return("url" => "usb://device=/dev/disk/by-id/usb-15")
+      allow(Yast::Pkg).to receive(:SourceGeneralData).with(2).and_return("url" 
=> "dir:///mnt/path")
+      allow(Yast::Pkg).to receive(:SourceGeneralData).with(3).and_return({})
+    end
+
+    it "returns list of urls for registered repositories without trailing 
slash" do
+      expect(subject.RegisteredUrls).to eq [
+        "http://test.com";, "usb://device=/dev/disk/by-id/usb-15", 
"dir:///mnt/path"
+      ]
+    end
+
+    it "fills list of local_urls in update Mode" do
+      allow(Yast::Mode).to receive(:update).and_return(true)
+      subject.RegisteredUrls
+
+      expect(subject.instance_variable_get(:"@local_urls")).to eq(2 => 
"dir:///mnt/path")
+    end
+
+    it "fills list of usb sources" do
+      subject.RegisteredUrls
+
+      expect(subject.instance_variable_get(:"@usb_sources")).to eq(
+        1 => "usb://device=/dev/disk/by-id/usb-15"
+      )
+    end
+  end
+
+  describe "#GetURLsToRegister" do
+    it "returns extra_urls entries from product " \
+       "without already registered entries passed as argument" do
+      already_registered = "http://test.com";
+      allow(Yast::ProductFeatures).to receive(:GetFeature).with("software", 
"extra_urls")
+        .and_return([{ "baseurl" => "http://test.com/"; }, { "baseurl" => 
"http://test2.com"; }])
+
+      expect(subject.GetURLsToRegister(already_registered)).to eq(
+        [{ "baseurl" => "http://test2.com"; }]
+      )
+    end
+  end
+end


Reply via email to