Hello community,

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

Package is "yast2-packager"

Sat May  6 20:46:00 2017 rev:335 rq:492871 version:3.2.23

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes    
2017-04-12 17:09:58.748236865 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-packager.new/yast2-packager.changes       
2017-05-06 20:46:01.873337154 +0200
@@ -1,0 +2,6 @@
+Fri Apr 28 08:45:31 UTC 2017 - jreidin...@suse.com
+
+- Escape backslashes in installation repo URL (bsc#1032506)
+- 3.2.23
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ yast2-packager.spec ++++++
--- /var/tmp/diff_new_pack.8WOIFk/_old  2017-05-06 20:46:02.681223187 +0200
+++ /var/tmp/diff_new_pack.8WOIFk/_new  2017-05-06 20:46:02.697220931 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-packager
-Version:        3.2.22
+Version:        3.2.23
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-packager-3.2.22.tar.bz2 -> yast2-packager-3.2.23.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.2.22/package/yast2-packager.changes 
new/yast2-packager-3.2.23/package/yast2-packager.changes
--- old/yast2-packager-3.2.22/package/yast2-packager.changes    2017-04-07 
16:03:44.857887102 +0200
+++ new/yast2-packager-3.2.23/package/yast2-packager.changes    2017-05-04 
16:09:30.817375667 +0200
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Fri Apr 28 08:45:31 UTC 2017 - jreidin...@suse.com
+
+- Escape backslashes in installation repo URL (bsc#1032506)
+- 3.2.23
+
+-------------------------------------------------------------------
 Fri Apr  7 13:40:59 UTC 2017 - lsle...@suse.cz
 
 - Create the /etc/products.d/baseproduct symlink in inst-sys when
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.2.22/package/yast2-packager.spec 
new/yast2-packager-3.2.23/package/yast2-packager.spec
--- old/yast2-packager-3.2.22/package/yast2-packager.spec       2017-04-07 
16:03:44.857887102 +0200
+++ new/yast2-packager-3.2.23/package/yast2-packager.spec       2017-05-04 
16:09:30.817375667 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-packager
-Version:        3.2.22
+Version:        3.2.23
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.2.22/src/modules/Packages.rb 
new/yast2-packager-3.2.23/src/modules/Packages.rb
--- old/yast2-packager-3.2.22/src/modules/Packages.rb   2017-04-07 
16:03:45.005887102 +0200
+++ new/yast2-packager-3.2.23/src/modules/Packages.rb   2017-05-04 
16:09:30.953375667 +0200
@@ -1600,6 +1600,10 @@
         base_url.value = InstURL.installInf2Url("")
       end
 
+      # '\' is not reserved nor unreserved according to rfc 
https://tools.ietf.org/html/rfc3986#section-2.1
+      # but ruby URI does not handle it. So to make life easier encode it 
(bsc#1032506)
+      base_url.value.gsub!("\\", "%5C")
+
       # hide password from URL if present
       log_url.value = URL.HidePassword(base_url.value)
       Builtins.y2milestone("Initialize Package Manager: %1", log_url.value)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.2.22/test/packages_test.rb 
new/yast2-packager-3.2.23/test/packages_test.rb
--- old/yast2-packager-3.2.22/test/packages_test.rb     2017-04-07 
16:03:45.161887102 +0200
+++ new/yast2-packager-3.2.23/test/packages_test.rb     2017-05-04 
16:09:31.109375667 +0200
@@ -3,6 +3,7 @@
 require_relative "./test_helper"
 
 require "yaml"
+require "uri"
 
 include Yast::Logger
 
@@ -1165,4 +1166,48 @@
       end
     end
   end
+
+  describe "#Initialize_BaseInit" do
+    before do
+      allow(Yast::PackageCallbacks).to receive(:InitPackageCallbacks)
+      allow(Yast::Language).to receive(:language).and_return("en_US")
+      allow(Yast::Pkg).to receive(:SetTextLocale)
+      @base_url = Yast::ArgRef.new("")
+      @log_url = Yast::ArgRef.new("")
+    end
+
+    it "inits package callbacks" do
+      expect(Yast::PackageCallbacks).to receive(:InitPackageCallbacks)
+
+      subject.Initialize_BaseInit(false, @base_url, @log_url)
+    end
+
+    it "sets text locale" do
+      expect(Yast::Pkg).to receive(:SetTextLocale).with("en_US")
+
+      subject.Initialize_BaseInit(false, @base_url, @log_url)
+    end
+
+    it "fills base_url param from install.inf" do
+      allow(Yast::InstURL).to 
receive("installInf2Url").and_return("cd:/?device=/dev/sr0")
+
+      subject.Initialize_BaseInit(false, @base_url, @log_url)
+      expect(@base_url.value).to eq "cd:/?device=/dev/sr0"
+    end
+
+    it "fills log_url param from install.inf with hidden password" do
+      allow(Yast::InstURL).to 
receive("installInf2Url").and_return("ftp://chuck:nor...@hell.com";)
+
+      subject.Initialize_BaseInit(false, @base_url, @log_url)
+      expect(@log_url.value).to eq "ftp://chuck:passw...@hell.com";
+    end
+
+    it "escaped backslashes in base_url (bsc#1032506)" do
+      allow(Yast::InstURL).to 
receive("installInf2Url").and_return("cd:/?device=/dev/disk/by-id/scsi-S__\\x5b")
+
+      subject.Initialize_BaseInit(false, @base_url, @log_url)
+      expect(@base_url.value).to eq 
"cd:/?device=/dev/disk/by-id/scsi-S__%5Cx5b"
+      expect{URI.parse(@base_url.value)}.to_not raise_error
+    end
+  end
 end


Reply via email to