Hello community,

here is the log from the commit of package yast2-packager for openSUSE:Factory 
checked in at 2017-02-08 11:02:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-packager (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-packager.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-packager"

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes    
2017-02-03 20:07:50.943207726 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-packager.new/yast2-packager.changes       
2017-02-08 11:02:13.553163702 +0100
@@ -1,0 +2,24 @@
+Wed Feb  1 16:03:24 UTC 2017 - [email protected]
+
+- Fix escaping spaces ( yast uses web form escaping to "+" but
+  libzypp expects percentage escaping to "%20" ) (bsc#954813)
+- Fix also valid showing valid libzypp formats of iso URL like
+  iso:/test?iso=test.iso&path=url%3A%2Finstall
+- Fix editing of iso:/ without triple slash that previously caused
+  lost of first element of path
+- 3.2.14
+
+-------------------------------------------------------------------
+Mon Jan 30 10:57:14 UTC 2017 - [email protected]
+
+- Packages module is able to perform a package selection proposal
+  during system upgrade (bsc#1009834)
+- 3.2.13
+
+-------------------------------------------------------------------
+Tue Jan 24 13:15:46 UTC 2017 - [email protected]
+
+- do not check content file on media if there is none in the
+  ramdisk (fate#322276)
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ yast2-packager.spec ++++++
--- /var/tmp/diff_new_pack.q3TQnl/_old  2017-02-08 11:02:14.209072262 +0100
+++ /var/tmp/diff_new_pack.q3TQnl/_new  2017-02-08 11:02:14.213071705 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-packager
-Version:        3.2.12
+Version:        3.2.14
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-packager-3.2.12.tar.bz2 -> yast2-packager-3.2.14.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.2.12/package/yast2-packager.changes 
new/yast2-packager-3.2.14/package/yast2-packager.changes
--- old/yast2-packager-3.2.12/package/yast2-packager.changes    2017-01-24 
13:27:16.628000000 +0100
+++ new/yast2-packager-3.2.14/package/yast2-packager.changes    2017-02-06 
10:52:35.561337791 +0100
@@ -1,4 +1,28 @@
 -------------------------------------------------------------------
+Wed Feb  1 16:03:24 UTC 2017 - [email protected]
+
+- Fix escaping spaces ( yast uses web form escaping to "+" but
+  libzypp expects percentage escaping to "%20" ) (bsc#954813)
+- Fix also valid showing valid libzypp formats of iso URL like
+  iso:/test?iso=test.iso&path=url%3A%2Finstall
+- Fix editing of iso:/ without triple slash that previously caused
+  lost of first element of path
+- 3.2.14
+
+-------------------------------------------------------------------
+Mon Jan 30 10:57:14 UTC 2017 - [email protected]
+
+- Packages module is able to perform a package selection proposal
+  during system upgrade (bsc#1009834)
+- 3.2.13
+
+-------------------------------------------------------------------
+Tue Jan 24 13:15:46 UTC 2017 - [email protected]
+
+- do not check content file on media if there is none in the
+  ramdisk (fate#322276)
+
+-------------------------------------------------------------------
 Thu Jan 19 15:11:48 UTC 2017 - [email protected]
 
 - Use information provided by libzypp to evaluate product
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.2.12/package/yast2-packager.spec 
new/yast2-packager-3.2.14/package/yast2-packager.spec
--- old/yast2-packager-3.2.12/package/yast2-packager.spec       2017-01-24 
13:27:16.628000000 +0100
+++ new/yast2-packager-3.2.14/package/yast2-packager.spec       2017-02-06 
10:52:35.561337791 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-packager
-Version:        3.2.12
+Version:        3.2.14
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.2.12/src/modules/Packages.rb 
new/yast2-packager-3.2.14/src/modules/Packages.rb
--- old/yast2-packager-3.2.12/src/modules/Packages.rb   2017-01-24 
13:27:17.528000000 +0100
+++ new/yast2-packager-3.2.14/src/modules/Packages.rb   2017-02-06 
10:52:35.569337791 +0100
@@ -1158,6 +1158,12 @@
         )
         return true
       end
+      if !File.exists?("/content")
+        Builtins.y2milestone(
+          "Ramdisk does not contain content file, not checking the file on 
media"
+        )
+        return true
+      end
       media_content = Pkg.SourceProvideSignedFile(source, 1, "/content", false)
       media = Convert.to_string(SCR.Read(path(".target.string"), 
media_content))
       ramdisk = Convert.to_string(SCR.Read(path(".target.string"), "/content"))
@@ -2277,6 +2283,17 @@
       deep_copy(ret)
     end
 
+    # Make a proposal for package selection during update
+    #
+    # As a side effect, it stores the current proposal.
+    #
+    # @see PackagesProposalChanged
+    def proposal_for_update
+      return unless PackagesProposalChanged()
+      @old_packages_proposal = PackagesProposal.GetAllResolvablesForAllTypes
+      Packages.SelectSystemPackages(false)
+    end
+
     # Initialize the repositories with popup feedback
     # Use Packages::Initialize (true) instead
     def InitializeCatalogs
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.2.12/src/modules/SourceDialogs.rb 
new/yast2-packager-3.2.14/src/modules/SourceDialogs.rb
--- old/yast2-packager-3.2.12/src/modules/SourceDialogs.rb      2017-01-24 
13:27:17.720000000 +0100
+++ new/yast2-packager-3.2.14/src/modules/SourceDialogs.rb      2017-02-06 
10:52:35.573337791 +0100
@@ -346,7 +346,9 @@
       params["url"] = URI.unescape(new_url.to_s)
 
       processed = URI("")
-      processed.query = URI.encode_www_form(params)
+      # libzypp do not use web encoding as in 
https://www.w3.org/TR/html5/forms.html#url-encoded-form-data
+      # but percentage enconding only. For more details see (bsc#954813#c20)
+      processed.query = URI.encode_www_form(params).gsub(/\+/, "%20")
 
       ret = "iso:///" + processed.to_s
       log.info "Updated URL: #{URL.HidePassword(ret)}"
@@ -376,12 +378,21 @@
     def PreprocessISOURL(url)
       log.info "Preprocessing ISO URL: #{URL.HidePassword(url)}"
 
-      uri = (url == "iso://") ? URI("iso:/") : URI(url)
+      # empty iso is used when we adding new url
+      return "" if url == "iso://"
+      uri = URI(url)
       query = uri.query || ""
-      params = URI.decode_www_form(query).to_h
 
-      processed = URI(params.delete("url") || "")
-      processed.path = File.join(processed.path || "", params.delete("iso") || 
"")
+      # libzypp do not use web encoding as in 
https://www.w3.org/TR/html5/forms.html#url-encoded-form-data
+      # but percentage enconding only. For more details see (bsc#954813#c20)
+      params = URI.decode_www_form(query.gsub(/%20/, "+")).to_h
+
+      param_url = params.delete("url") || ""
+      processed = URI(URI.encode(param_url))
+      processed.scheme = "iso" if processed.scheme.downcase == "dir"
+      # we need to construct path from more potential sources, as url can look 
like
+      # `iso:/subdir?iso=test.iso&path=dir%3A%2Finstall` resulting in path 
"/install/subdir/test.iso"
+      processed.path = File.join(processed.path || "", uri.path, 
params.delete("iso") || "")
       processed.query = URI.encode_www_form(params) unless params.empty?
 
       ret = processed.to_s
@@ -874,9 +885,10 @@
     # @param [String] key string widget key
     def IsoInit(key)
       @_url = PreprocessISOURL(@_url)
-      parsed = URL.Parse(@_url)
+      parsed = URI.parse(@_url)
+      path = URI.unescape(parsed.path)
 
-      UI.ChangeWidget(Id(:dir), :Value, Ops.get_string(parsed, "path", ""))
+      UI.ChangeWidget(Id(:dir), :Value, path)
       UI.SetFocus(:dir)
 
       nil
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.2.12/test/packages_test.rb 
new/yast2-packager-3.2.14/test/packages_test.rb
--- old/yast2-packager-3.2.12/test/packages_test.rb     2017-01-24 
13:27:18.248000000 +0100
+++ new/yast2-packager-3.2.14/test/packages_test.rb     2017-02-06 
10:52:35.577337791 +0100
@@ -1060,4 +1060,28 @@
       end
     end
   end
+
+  describe "#proposal_for_update" do
+    before do
+      allow(subject).to receive(:PackagesProposalChanged).and_return(changed)
+    end
+
+    context "when packages proposal was changed" do
+      let(:changed) { true }
+
+      it "selects system packages" do
+        expect(subject).to receive(:SelectSystemPackages).with(false)
+        subject.proposal_for_update
+      end
+    end
+
+    context "when packages proposal was not changed" do
+      let(:changed) { false }
+
+      it "does not select system packages" do
+        expect(subject).to_not receive(:SelectSystemPackages)
+        subject.proposal_for_update
+      end
+    end
+  end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.2.12/test/source_dialogs_test.rb 
new/yast2-packager-3.2.14/test/source_dialogs_test.rb
--- old/yast2-packager-3.2.12/test/source_dialogs_test.rb       2017-01-24 
13:27:18.364000000 +0100
+++ new/yast2-packager-3.2.14/test/source_dialogs_test.rb       2017-02-06 
10:52:35.577337791 +0100
@@ -12,7 +12,33 @@
 describe Yast::SourceDialogs do
   subject { Yast::SourceDialogs }
 
+  ZYPP_VALID_URLS = [
+    "cd:///",
+    "dvd:/subdir?devices=/dev/sr0,/dev/sr1",
+    "ftp://user:pass@server/path/to/media/dir";,
+    "ftp://user:pass@server/%2fhome/user/path/to/media/dir";,
+    "http://user:pass@server/path";,
+    "https://user:pass@server/path?proxy=foo&proxyuser=me&proxypass=pw";,
+    "hd:/subdir?device=/dev/sda1&filesystem=reiserfs",
+    "dir:/directory/name",
+    "iso:/?iso=CD1.iso&url=nfs://server/path/to/media",
+    "iso:/?iso=CD1.iso&url=hd:/?device=/dev/hda",
+    
"iso:/subdir?iso=DVD1.iso&url=nfs://nfs-server/directory&mnt=/nfs/attach/point&filesystem=udf",
+    "nfs://nfs-server/exported/path",
+    "nfs://nfs-server/exported/path?mountoptions=ro&type=nfs4",
+    "nfs4://nfs-server/exported/path?mountoptions=ro",
+    "smb://servername/share/path/on/the/share",
+    
"cifs://usern:passw@servername/share/path/on/the/share?mountoptions=ro,noguest",
+    "cifs://usern:passw@servername/share/path/on/the/share?workgroup=mygroup",
+    "cifs://servername/share/path/on/the/share?user=usern&pass=passw",
+  ]
+
   describe "#valid_scheme?" do
+    it "returns true for all known zypp uris" do
+      ZYPP_VALID_URLS.each do |uri|
+        expect(subject.valid_scheme?(uri)).to(eq(true), "Valid URI '#{uri}' is 
not recognized")
+      end
+    end
 
     it "returns true for 'https://' URL" do
       expect(subject.valid_scheme?("https://";)).to eq(true)
@@ -52,6 +78,28 @@
 
       expect(subject.PreprocessISOURL(url)).to eq(converted)
     end
+
+    it "handles iso with part in url and part in path" do
+      converted = 
"iso:/insta%20ll/Duomenys%20600%20GB/openSUSE-13.2-DVD-x86_64.iso"
+      url = 
"iso:/Duomenys%20600%20GB?iso=/openSUSE-13.2-DVD-x86_64.iso&url=dir%3A%2Finsta%20ll%2F"
+
+      expect(subject.PreprocessISOURL(url)).to eq(converted)
+    end
+
+    it "handles properly escaped spaces" do
+      converted = 
"iso:/install/Duomenys%20600%20GB/openSUSE-13.2-DVD-x86_64.iso"
+      url = 
"iso:///?iso=openSUSE-13.2-DVD-x86_64.iso&url=dir%3A%2Finstall%2FDuomenys%20600%20GB"
+
+      expect(subject.PreprocessISOURL(url)).to eq(converted)
+    end
+
+    # empty iso url is used when adding new iso repository
+    it "handles empty iso uri" do
+      converted = ""
+      url = "iso://"
+
+      expect(subject.PreprocessISOURL(url)).to eq(converted)
+    end
   end
 
   describe "#PostprocessISOURL" do
@@ -73,12 +121,20 @@
 
     it "prevents double escaping if get already escaped string" do
       converted = 
"iso:///install/Duomenys%20600%20GB/openSUSE-13.2-DVD-x86_64.iso"
-      url = 
"iso:///?iso=openSUSE-13.2-DVD-x86_64.iso&url=dir%3A%2Finstall%2FDuomenys+600+GB"
+      url = 
"iso:///?iso=openSUSE-13.2-DVD-x86_64.iso&url=dir%3A%2Finstall%2FDuomenys%20600%20GB"
 
       expect(subject.PostprocessISOURL(converted)).to eq(url)
     end
   end
 
+  describe ".IsISOURL" do
+    it "returns true for iso with spaces" do
+      url = 
"iso:///?iso=openSUSE-13.2-DVD-x86_64.iso&url=dir%3A%2Finstall%2FDuomenys%20600%20GB"
+
+      expect(subject.IsISOURL(url)).to eq true
+    end
+  end
+
   describe ".URLScheme" do
     it "returns scheme of url" do
       expect(subject.URLScheme("ftp://test.com";)).to eq "ftp"


Reply via email to