Hello community,

here is the log from the commit of package yast2-packager for openSUSE:Factory 
checked in at 2019-05-15 12:23:52
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-packager (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-packager.new.5148 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-packager"

Wed May 15 12:23:52 2019 rev:374 rq:702865 version:4.2.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes    
2019-05-10 09:12:00.235412834 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-packager.new.5148/yast2-packager.changes  
2019-05-15 12:23:55.142165895 +0200
@@ -1,0 +2,27 @@
+Tue May 14 09:16:22 CEST 2019 - [email protected]
+
+- List of Online Repositories: Do not show already added repos.
+  Replace $releasever by the current product version.
+  (bsc#1132622)
+- 4.2.6
+
+-------------------------------------------------------------------
+Fri May 10 12:12:50 UTC 2019 - Ladislav Slezák <[email protected]>
+
+- Increase the memory limit warning for the online repositories to
+  1.5GiB to avoid freezing the installer (bsc#1132650)
+
+-------------------------------------------------------------------
+Tue May  7 11:15:29 UTC 2019 - Ladislav Slezák <[email protected]>
+
+- Properly handle going back when selecting the modules from the
+  Packages DVD medium (bsc#1131968)
+
+-------------------------------------------------------------------
+Thu May  2 12:10:07 UTC 2019 - [email protected]
+
+- Prefer control.xml to ProductFeatures for Community Repositories
+  (bsc#1132613)
+- 4.2.5
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ yast2-packager.spec ++++++
--- /var/tmp/diff_new_pack.vC6fz5/_old  2019-05-15 12:23:55.794164469 +0200
+++ /var/tmp/diff_new_pack.vC6fz5/_new  2019-05-15 12:23:55.814164425 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-packager
-Version:        4.2.4
+Version:        4.2.6
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-packager-4.2.4.tar.bz2 -> yast2-packager-4.2.6.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-4.2.4/.cirrus.yml 
new/yast2-packager-4.2.6/.cirrus.yml
--- old/yast2-packager-4.2.4/.cirrus.yml        1970-01-01 01:00:00.000000000 
+0100
+++ new/yast2-packager-4.2.6/.cirrus.yml        2019-05-14 16:57:19.000000000 
+0200
@@ -0,0 +1,29 @@
+container:
+  image: registry.opensuse.org/yast/head/containers/yast-ruby:latest
+
+Rubocop_task:
+  container:
+    cpu: 8
+  test_script: rake check:rubocop
+  only_if: "changesInclude('.cirrus.yml', '.rubocop.yml', 'Rakefile', 
'**/*.rake', '*.rb', '**/*.rb')"
+
+Unit Tests_task:
+  environment:
+    COVERAGE: 1
+    COVERALLS_REPO_TOKEN: 
ENCRYPTED[07f77b1412f23d9201d0255c60b61781b308a2db9af24f07e48f1331ee80460c2e3b858f39f737294de04f94e55cc52d]
+    # Fake a Travis build to send the code coverage to coveralls.io
+    TRAVIS: 1
+  test_script: rake test:unit && shellcheck src/bin/sw_single_wrapper
+
+yardoc_task:
+  yardoc_cache_cache:
+    folder: .yardoc
+  test_script: rake check:doc
+  only_if: "changesInclude('.cirrus.yml', 'Rakefile', '**/*.rake', '*.rb', 
'**/*.rb')"
+
+Package Build_task:
+  # run the other steps
+  test_script: yast-travis-ruby -x tests -x rubocop -x yardoc
+
+Debug_task:
+  test_script: "uname -a; echo '---------'; rpm -qa | sort; echo '---------'; 
df -h; echo '---------'; free -h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-4.2.4/.travis.yml 
new/yast2-packager-4.2.6/.travis.yml
--- old/yast2-packager-4.2.4/.travis.yml        2019-05-07 09:56:05.000000000 
+0200
+++ new/yast2-packager-4.2.6/.travis.yml        2019-05-14 16:57:19.000000000 
+0200
@@ -12,6 +12,6 @@
   # the "yast-travis-ruby" script is included in the base yastdevel/ruby image
   # see https://github.com/yast/docker-yast-ruby/blob/master/yast-travis-ruby
   # exclude the yardoc step, we run the more strict check:doc later
-  - docker run -it -e TRAVIS=1 -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" 
yast-packager-image yast-travis-ruby -x yardoc
-  - docker run -it -e TRAVIS=1 -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" 
yast-packager-image rake check:doc
-  - docker run -it -e TRAVIS=1 -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" 
yast-packager-image shellcheck src/bin/sw_single_wrapper
+  - docker run --rm -it yast-packager-image yast-travis-ruby -x yardoc
+  - docker run --rm -it yast-packager-image rake check:doc
+  - docker run --rm -it yast-packager-image shellcheck 
src/bin/sw_single_wrapper
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-4.2.4/.yardopts 
new/yast2-packager-4.2.6/.yardopts
--- old/yast2-packager-4.2.4/.yardopts  2019-05-07 09:56:05.000000000 +0200
+++ new/yast2-packager-4.2.6/.yardopts  2019-05-14 16:57:19.000000000 +0200
@@ -1,4 +1,5 @@
 --no-private
+--use-cache
 --markup markdown
 --protected
 src/**/*.rb
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-4.2.4/README.md 
new/yast2-packager-4.2.6/README.md
--- old/yast2-packager-4.2.4/README.md  2019-05-07 09:56:05.000000000 +0200
+++ new/yast2-packager-4.2.6/README.md  2019-05-14 16:57:19.000000000 +0200
@@ -1,6 +1,6 @@
 # YaST - The Package Management Libraries #
 
 [![Travis 
Build](https://travis-ci.org/yast/yast-packager.svg?branch=master)](https://travis-ci.org/yast/yast-packager)
-[![Jenkins 
Build](http://img.shields.io/jenkins/s/https/ci.opensuse.org/yast-packager-master.svg)](https://ci.opensuse.org/view/Yast/job/yast-packager-master/)
-[![Coverage 
Status](https://coveralls.io/repos/yast/yast-packager/badge.png)](https://coveralls.io/r/yast/yast-packager)
-
+[![Build 
Status](https://api.cirrus-ci.com/github/yast/yast-packager.svg?branch=master)](https://cirrus-ci.com/github/yast/yast-packager?branch=master)
+[![Jenkins 
Build](http://img.shields.io/jenkins/s/https/ci.opensuse.org/yast-yast-packager-master.svg)](https://ci.opensuse.org/view/Yast/job/yast-yast-packager-master/)
+[![Coverage 
Status](https://coveralls.io/repos/github/yast/yast-packager/badge.svg?branch=master)](https://coveralls.io/github/yast/yast-packager?branch=master)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-4.2.4/package/yast2-packager.changes 
new/yast2-packager-4.2.6/package/yast2-packager.changes
--- old/yast2-packager-4.2.4/package/yast2-packager.changes     2019-05-07 
09:56:05.000000000 +0200
+++ new/yast2-packager-4.2.6/package/yast2-packager.changes     2019-05-14 
16:57:19.000000000 +0200
@@ -1,4 +1,31 @@
 -------------------------------------------------------------------
+Tue May 14 09:16:22 CEST 2019 - [email protected]
+
+- List of Online Repositories: Do not show already added repos.
+  Replace $releasever by the current product version.
+  (bsc#1132622)
+- 4.2.6
+
+-------------------------------------------------------------------
+Fri May 10 12:12:50 UTC 2019 - Ladislav Slezák <[email protected]>
+
+- Increase the memory limit warning for the online repositories to
+  1.5GiB to avoid freezing the installer (bsc#1132650)
+
+-------------------------------------------------------------------
+Tue May  7 11:15:29 UTC 2019 - Ladislav Slezák <[email protected]>
+
+- Properly handle going back when selecting the modules from the
+  Packages DVD medium (bsc#1131968)
+
+-------------------------------------------------------------------
+Thu May  2 12:10:07 UTC 2019 - [email protected]
+
+- Prefer control.xml to ProductFeatures for Community Repositories
+  (bsc#1132613)
+- 4.2.5
+
+-------------------------------------------------------------------
 Fri Apr 26 08:44:25 UTC 2019 - Ladislav Slezák <[email protected]>
 
 - Display human readable product names instead of the internal IDs
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-4.2.4/package/yast2-packager.spec 
new/yast2-packager-4.2.6/package/yast2-packager.spec
--- old/yast2-packager-4.2.4/package/yast2-packager.spec        2019-05-07 
09:56:05.000000000 +0200
+++ new/yast2-packager-4.2.6/package/yast2-packager.spec        2019-05-14 
16:57:19.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-packager
-Version:        4.2.4
+Version:        4.2.6
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-packager-4.2.4/src/include/packager/repositories_include.rb 
new/yast2-packager-4.2.6/src/include/packager/repositories_include.rb
--- old/yast2-packager-4.2.4/src/include/packager/repositories_include.rb       
2019-05-07 09:56:05.000000000 +0200
+++ new/yast2-packager-4.2.6/src/include/packager/repositories_include.rb       
2019-05-14 16:57:19.000000000 +0200
@@ -293,14 +293,14 @@
       ret = createSource(url, plaindir, @download_meta, name)
 
       case ret
-      when :again
+      when :again, :back
         :back
       when :abort, :cancel
         :abort
       when :next
         :next
       else
-        log.warn "Received unknown result: #{ret}, using :next instead"
+        log.warn "Received unknown result: #{ret.inspect}, using :next instead"
         :next
       end
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-packager-4.2.4/src/lib/y2packager/clients/inst_productsources.rb 
new/yast2-packager-4.2.6/src/lib/y2packager/clients/inst_productsources.rb
--- old/yast2-packager-4.2.4/src/lib/y2packager/clients/inst_productsources.rb  
2019-05-07 09:56:05.000000000 +0200
+++ new/yast2-packager-4.2.6/src/lib/y2packager/clients/inst_productsources.rb  
2019-05-14 16:57:19.000000000 +0200
@@ -4,6 +4,7 @@
 require "yast2/hw_detection"
 
 require "shellwords"
+require "uri"
 
 Yast.import "UI"
 Yast.import "Pkg"
@@ -93,8 +94,8 @@
     include Yast::Logger
 
     # too low memory for using online repositories (in MiB),
-    # at least 1GiB is recommended
-    LOW_MEMORY_MIB = 1024
+    # at least 1.5GiB is recommended
+    LOW_MEMORY_MIB = 1536
     # variable to set target release version ( useful during upgrade when
     # we want new target in releaseversion and not old one )
     RELEASEVER_ENV = "ZYPP_REPO_RELEASEVER".freeze
@@ -358,17 +359,11 @@
     def NormalizeURL(url_string)
       return url_string if url_string.nil? || url_string == ""
 
-      if Builtins.regexpmatch(url_string, "/+$")
-        url_string = Builtins.regexpsub(url_string, "(.*)/+$", "\\1")
-      end
-
-      # URL is escaped
-      if Builtins.regexpmatch(url_string, "%")
-        # unescape it
-        url_string = URL.UnEscapeString(url_string, URL.transform_map_filename)
-      end
+      # unescape it
+      url_string = URI.unescape(url_string)
 
-      url_string
+      # removing all slashes at the end of the url
+      url_string.sub(/(\/)+$/, "")
     end
 
     # Returns whether this URL/Path is already added as a source
@@ -377,23 +372,16 @@
     def IsAddOnAlreadySelected(s_url, s_path)
       ret = -1
 
-      s_url = NormalizeURL(s_url)
-
-      Builtins.foreach(AddOnProduct.add_on_products) do |one_add_on|
-        Ops.set(
-          one_add_on,
-          "media_url",
-          NormalizeURL(Ops.get_string(one_add_on, "media_url", ""))
-        )
-        if Ops.get(one_add_on, "media_url") == s_url &&
-            Ops.get(one_add_on, "product_dir") == s_path
-          ret = Ops.get_integer(one_add_on, "media", -1)
-          raise Break
-        end
+      search_url = NormalizeURL((s_url || "") + (s_path || ""))
+      # replace e.g. $releasever by the real version
+      search_url = Pkg.ExpandedUrl(search_url)
+      found_product = AddOnProduct.add_on_products.find do |add_on|
+        NormalizeURL(add_on["media_url"] + add_on["product_dir"]) == search_url
       end
+      ret = found_product["media"] || -1 if found_product
 
-      if Builtins.contains(SourceManager.just_removed_sources, ret)
-        Builtins.y2milestone("Just deleted: %1", ret)
+      if SourceManager.just_removed_sources.include?(ret)
+        log.info("Just deleted: #{ret}")
         ret = -1
       end
 
@@ -412,10 +400,9 @@
       Pkg.TargetInitialize(Installation.destdir)
       # the fastest way
       Pkg.SourceRestore
-
       if !Mode.installation
         # repos_already_used
-        Builtins.foreach(Pkg.SourceGetCurrent(true)) do |one_id|
+        Builtins.foreach(Pkg.SourceGetCurrent(false)) do |one_id|
           source_data = Pkg.SourceGeneralData(one_id)
           if Ops.greater_or_equal(
             IsAddOnAlreadySelected(
@@ -444,27 +431,24 @@
     end
 
     def ReadControlFile
+      # Prefer control.xml to /etc/YaST2/ProductFeatures (bsc#1132613)
+      # (The latter file does not exist during the installation)
+      ProductControl.Init unless Stage.initial
+      # Notably GetSection does not call ProductFeatures.Restore
+      # which would overwrite the ProductControl data we've just read
       software_features = ProductFeatures.GetSection("software")
       if !software_features.nil?
-        @main_link = Ops.get_string(
-          software_features,
-          "external_sources_link",
-          ""
-        )
-      else
-        @main_link = ""
+        @main_link = software_features["external_sources_link"]
       end
-      Builtins.y2milestone("Got link: %1", @main_link)
+      @main_link ||= ""
 
-      if @main_link.nil? || @main_link == ""
-        @main_link = ""
+      if @main_link == ""
         Builtins.y2warning("No link")
         return false
       end
 
       Builtins.y2milestone("Using link: %1", @main_link)
-
-      !@main_link.nil? && @main_link != ""
+      true
     end
 
     def UseDownloadFile
@@ -927,6 +911,10 @@
         ""
       end
 
+      # replace e.g. $releasever by the real version
+      url_string = @list_of_repos[current_id]["url"] || ""
+      url_string = Pkg.ExpandedUrl(url_string)
+
       description = Builtins.sformat(
         # TRANSLATORS: This is a complex HTML-formatted information about
         # selected external repository
@@ -945,7 +933,7 @@
             "%5\n" \
             "</p>"
         ),
-        Ops.get_string(@list_of_repos, [current_id, "url"], ""),
+        url_string,
         Ops.get_string(@list_of_repos, [current_id, "url_from"], ""),
         GetLocalizedString(current_id, ["summary", "name"]),
         GetLocalizedString(current_id, ["description"]),
@@ -1063,7 +1051,7 @@
         )
       end
 
-      # Preselect the recommended repositories when ne repository has been 
selected yet
+      # Preselect the recommended repositories when no repository has been 
selected yet
       if @preselect_recommended
         tmp_items = deep_copy(items)
         counter2 = -1
@@ -1500,7 +1488,10 @@
         Builtins.y2milestone("Product Data: %1", prod)
 
         repo_id = CreateRepoId(url, pth)
-        Builtins.y2milestone("Addind repository with ID: %1", repo_id)
+        Builtins.y2milestone("Adding repository with ID: %1", repo_id)
+
+        # replace e.g. $releasever by the real version
+        url = Pkg.ExpandedUrl(url)
 
         AddOnProduct.add_on_products = Builtins.add(
           AddOnProduct.add_on_products,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-packager-4.2.4/test/lib/clients/inst_productsources_test.rb 
new/yast2-packager-4.2.6/test/lib/clients/inst_productsources_test.rb
--- old/yast2-packager-4.2.4/test/lib/clients/inst_productsources_test.rb       
2019-05-07 09:56:05.000000000 +0200
+++ new/yast2-packager-4.2.6/test/lib/clients/inst_productsources_test.rb       
2019-05-14 16:57:19.000000000 +0200
@@ -2,6 +2,7 @@
 
 require_relative "../../test_helper"
 require "y2packager/clients/inst_productsources"
+Yast.import "SourceManager"
 
 describe Yast::InstProductsourcesClient do
   subject(:client) { described_class.new }
@@ -110,4 +111,96 @@
       client.CreateSource("http://yast.rulezz.com";, "/prod1", "main", nil)
     end
   end
+
+  describe "#NormalizeURL" do
+    it "removes all slashes at the end of the url" do
+      expect(client.NormalizeURL("http://test.suse.de/test_dir///";)).to eq(
+        "http://test.suse.de/test_dir";
+      )
+    end
+
+    it "unescape URL" do
+      expect(client.NormalizeURL(
+               
"http%3a%2f%2fsome.nice.url%2f%3awith%3a%2f%24p#ci%26l%2fch%40rs%2f"
+      ))
+        .to eq("http://some.nice.url/:with:/$p#ci&l/ch@rs";)
+    end
+  end
+
+  describe "#IsAddOnAlreadySelected" do
+    let(:add_on_products) do
+      [
+        {
+          "media"       => 0,
+          "media_url"   => 
"cd:/?devices=/dev/disk/by-id/ata-QEMU_DVD-ROM_QM00003",
+          "product_dir" => "/"
+        },
+        {
+          "media"       => 1,
+          "media_url"   => 
"http://download.opensuse.org/debug/distribution/leap/15.1/repo/oss/";,
+          "product_dir" => ""
+        },
+        {
+          "media"       => 3,
+          "media_url"   => 
"http://download.opensuse.org/debug/update/leap/15.1/oss/";,
+          "product_dir" => ""
+        },
+        {
+          "media"       => 4,
+          "media_url"   => 
"http://download.opensuse.org/debug/update/leap/15.1/non-oss/";,
+          "product_dir" => ""
+        }
+      ]
+    end
+
+    before do
+      allow(Yast::AddOnProduct).to 
receive(:add_on_products).and_return(add_on_products)
+    end
+
+    context "is already added" do
+      it "handles the default and empty product directory correctly" do
+        expect(client.IsAddOnAlreadySelected("http://download.opensuse.org"; \
+          "/debug/update/leap/15.1/non-oss/",
+          "/")).to eq(4)
+        expect(client.IsAddOnAlreadySelected("http://download.opensuse.org"; \
+          "/debug/update/leap/15.1/non-oss/",
+          "")).to eq(4)
+        expect(client.IsAddOnAlreadySelected("http://download.opensuse.org"; \
+          "/debug/update/leap/15.1/non-oss/",
+          nil)).to eq(4)
+      end
+    end
+
+    context "is not added" do
+      it "returns -1" do
+        
expect(client.IsAddOnAlreadySelected("http://download.opensuse.org/debug/non-found/";,
+          "/")).to eq(-1)
+      end
+    end
+
+    context "url contains $releasever" do
+      it "replaces $releasever and returns source id" do
+        expect(Yast::Pkg).to receive(:ExpandedUrl)
+          .with("http://download.opensuse.org/"; \
+          "debug/update/leap/$releasever/non-oss")
+          .and_return("http://download.opensuse.org/"; \
+          "debug/update/leap/15.1/non-oss")
+        expect(client.IsAddOnAlreadySelected("http://download.opensuse.org/"; \
+          "debug/update/leap/$releasever/non-oss/",
+          "/")).to eq(4)
+      end
+    end
+
+    context "is added but will be removed" do
+      before do
+        allow(Yast::SourceManager).to 
receive(:just_removed_sources).and_return([1, 2, 3])
+      end
+
+      it "returns -1" do
+        expect(client.IsAddOnAlreadySelected("http://download.opensuse.org/"; \
+          "debug/distribution/leap/15.1/repo/non-oss/",
+          "/")).to eq(-1)
+      end
+    end
+  end
 end


Reply via email to