Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package yast2-add-on for openSUSE:Factory checked in at 2022-12-16 17:51:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-add-on (Old) and /work/SRC/openSUSE:Factory/.yast2-add-on.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-add-on" Fri Dec 16 17:51:09 2022 rev:122 rq:1043163 version:4.5.3 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-add-on/yast2-add-on.changes 2022-10-27 13:54:05.520542919 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-add-on.new.1835/yast2-add-on.changes 2022-12-16 17:51:13.571877139 +0100 @@ -1,0 +2,7 @@ +Thu Dec 15 12:50:41 UTC 2022 - Ladislav Slezák <[email protected]> + +- Fixed failure with the "media_url" element in AutoYaST profile + containing CDATA block with spaces (bsc#1205928) +- 4.5.3 + +------------------------------------------------------------------- Old: ---- yast2-add-on-4.5.2.tar.bz2 New: ---- yast2-add-on-4.5.3.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-add-on.spec ++++++ --- /var/tmp/diff_new_pack.xiur50/_old 2022-12-16 17:51:13.963879297 +0100 +++ /var/tmp/diff_new_pack.xiur50/_new 2022-12-16 17:51:13.971879341 +0100 @@ -17,7 +17,7 @@ Name: yast2-add-on -Version: 4.5.2 +Version: 4.5.3 Release: 0 Summary: YaST2 - Add-On media installation code License: GPL-2.0-only ++++++ yast2-add-on-4.5.2.tar.bz2 -> yast2-add-on-4.5.3.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-add-on-4.5.2/package/yast2-add-on.changes new/yast2-add-on-4.5.3/package/yast2-add-on.changes --- old/yast2-add-on-4.5.2/package/yast2-add-on.changes 2022-10-25 10:54:39.000000000 +0200 +++ new/yast2-add-on-4.5.3/package/yast2-add-on.changes 2022-12-15 16:10:25.000000000 +0100 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Thu Dec 15 12:50:41 UTC 2022 - Ladislav Slezák <[email protected]> + +- Fixed failure with the "media_url" element in AutoYaST profile + containing CDATA block with spaces (bsc#1205928) +- 4.5.3 + +------------------------------------------------------------------- Tue Oct 25 08:37:56 UTC 2022 - Steffen Winterfeldt <[email protected]> - support 'repo' scheme for add-ons (jsc#SLE-22578, jsc#SLE-24584) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-add-on-4.5.2/package/yast2-add-on.spec new/yast2-add-on-4.5.3/package/yast2-add-on.spec --- old/yast2-add-on-4.5.2/package/yast2-add-on.spec 2022-10-25 10:54:39.000000000 +0200 +++ new/yast2-add-on-4.5.3/package/yast2-add-on.spec 2022-12-15 16:10:25.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-add-on -Version: 4.5.2 +Version: 4.5.3 Release: 0 Summary: YaST2 - Add-On media installation code License: GPL-2.0-only diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-add-on-4.5.2/src/lib/add-on/clients/add-on_auto.rb new/yast2-add-on-4.5.3/src/lib/add-on/clients/add-on_auto.rb --- old/yast2-add-on-4.5.2/src/lib/add-on/clients/add-on_auto.rb 2022-10-25 10:54:39.000000000 +0200 +++ new/yast2-add-on-4.5.3/src/lib/add-on/clients/add-on_auto.rb 2022-12-15 16:10:25.000000000 +0100 @@ -56,7 +56,7 @@ add_ons += data.fetch("add_on_others", []) valid_add_ons = add_ons.reject.with_index(1) do |add_on, index| - next false unless add_on.fetch("media_url", "").empty? + next false unless stripped_media_url(add_on).empty? log.error("Missing <media_url> value in the #{index}. add-on definition") @@ -92,7 +92,7 @@ add_on_summary = [] # TRANSLATORS: %s is an add-on URL - add_on_summary << _("URL: %s") % CGI.escapeHTML(add_on["media_url"]) + add_on_summary << _("URL: %s") % CGI.escapeHTML(stripped_media_url(add_on)) if [nil, "", "/"].none?(product_dir) # TRANSLATORS: %s is a product path @@ -165,7 +165,7 @@ def write AddOnProduct.add_on_products.each do |add_on| product = add_on.fetch("product", "") - media_url = media_url_for(add_on) + media_url = absolute_media_url(add_on) action = create_source(add_on, product, media_url) case action @@ -206,6 +206,13 @@ private + # Get URL for the addon + # @param add_on [Hash] the add on data + # @return [String] Addon URL or empty string if not set + def stripped_media_url(add_on) + add_on.fetch("media_url", "").strip + end + # Create repo and install product (if given) # # @param [Hash] add_on @@ -260,8 +267,8 @@ # @param [Hash] add_on # # @return [String] absolute media url or empty string - def media_url_for(add_on) - media_url = add_on.fetch("media_url", "") + def absolute_media_url(add_on) + media_url = stripped_media_url(add_on) if ["relurl", "repo"].include?(URI(media_url).scheme) media_url = AddOnProduct.GetAbsoluteURL(AddOnProduct.GetBaseProductURL, media_url) @@ -293,9 +300,11 @@ # # @return [Boolean] def retry_again?(product, media_url) - Popup.ContinueCancel( - # TRANSLATORS: The placeholders are for the product name and the URL. - format(_("Make the add-on \"%{name}\" available via \"%{url}\"."), name: product, url: media_url) + Popup.YesNo( + # TRANSLATORS: Popup with Yes/No buttons, adding the repository failed. + # The placeholders are for the product name and the URL. + format(_("Failed to add product \"%{name}\" from \n%{url}\nTry again?"), + name: product, url: media_url) ) end @@ -369,7 +378,7 @@ # name in control file, bnc#433981 return add_on_name unless add_on_name.to_s.empty? - media_url = add_on.fetch("media_url", "") + media_url = stripped_media_url(add_on) product_dir = add_on.fetch("product_dir", "/") expanded_url = Pkg.ExpandedUrl(media_url) repos_at_url = Pkg.RepositoryScan(expanded_url) || [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-add-on-4.5.2/test/y2add_on/clients/add-on_auto_test.rb new/yast2-add-on-4.5.3/test/y2add_on/clients/add-on_auto_test.rb --- old/yast2-add-on-4.5.2/test/y2add_on/clients/add-on_auto_test.rb 2022-10-25 10:54:39.000000000 +0200 +++ new/yast2-add-on-4.5.3/test/y2add_on/clients/add-on_auto_test.rb 2022-12-15 16:10:25.000000000 +0100 @@ -386,18 +386,30 @@ client.write end + context "URL contains spaces" do + # simulate CDATA with spaces: + # <media_url><![CDATA[ relurl:// ]]></media_url> + let(:unexpanded_url) { " RELURL://product-$releasever.url " } + + # test regression with CDATA (bsc#1205928) + it "strips the spaces from URL" do + expect(Yast::Pkg).to receive(:ExpandedUrl).with(unexpanded_url.strip) + client.write + end + end + context "and product creation fails" do before do allow(Yast::Report).to receive(:Error) allow(Yast::Pkg).to receive(:SourceCreate).and_return(-1) - allow(Yast::Popup).to receive(:ContinueCancel).and_return(retry_on_error, false) + allow(Yast::Popup).to receive(:YesNo).and_return(retry_on_error, false) end let(:retry_on_error) { true } context "ask_on_error=true" do it "ask the user to make it available" do - expect(Yast::Popup).to receive(:ContinueCancel) + expect(Yast::Popup).to receive(:YesNo) client.write end @@ -439,7 +451,7 @@ let(:ask_on_error) { false } it "does not ask to make it available" do - expect(Yast::Popup).to_not receive(:ContinueCancel) + expect(Yast::Popup).to_not receive(:YesNo) client.write end
