Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package yast2-packager for openSUSE:Factory checked in at 2022-10-28 19:29:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-packager (Old) and /work/SRC/openSUSE:Factory/.yast2-packager.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-packager" Fri Oct 28 19:29:11 2022 rev:429 rq:1031497 version:4.5.6 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes 2022-05-30 12:42:55.600308783 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-packager.new.2275/yast2-packager.changes 2022-10-28 19:29:19.550569802 +0200 @@ -1,0 +2,6 @@ +Tue Oct 25 10:20:48 UTC 2022 - Steffen Winterfeldt <snw...@suse.com> + +- support 'repo' scheme for add-ons (jsc#SLE-22578, jsc#SLE-24584) +- 4.5.6 + +------------------------------------------------------------------- Old: ---- yast2-packager-4.5.5.tar.bz2 New: ---- yast2-packager-4.5.6.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-packager.spec ++++++ --- /var/tmp/diff_new_pack.eLrJYi/_old 2022-10-28 19:29:20.386573994 +0200 +++ /var/tmp/diff_new_pack.eLrJYi/_new 2022-10-28 19:29:20.390574014 +0200 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 4.5.5 +Version: 4.5.6 Release: 0 Summary: YaST2 - Package Library License: GPL-2.0-or-later ++++++ yast2-packager-4.5.5.tar.bz2 -> yast2-packager-4.5.6.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.5.5/package/yast2-packager.changes new/yast2-packager-4.5.6/package/yast2-packager.changes --- old/yast2-packager-4.5.5/package/yast2-packager.changes 2022-05-26 16:55:44.000000000 +0200 +++ new/yast2-packager-4.5.6/package/yast2-packager.changes 2022-10-27 10:54:44.000000000 +0200 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Tue Oct 25 10:20:48 UTC 2022 - Steffen Winterfeldt <snw...@suse.com> + +- support 'repo' scheme for add-ons (jsc#SLE-22578, jsc#SLE-24584) +- 4.5.6 + +------------------------------------------------------------------- Thu May 26 12:40:24 UTC 2022 - Ladislav Slez??k <lsle...@suse.cz> - Support managing system in a chroot (bsc#1199840) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.5.5/package/yast2-packager.spec new/yast2-packager-4.5.6/package/yast2-packager.spec --- old/yast2-packager-4.5.5/package/yast2-packager.spec 2022-05-26 16:55:44.000000000 +0200 +++ new/yast2-packager-4.5.6/package/yast2-packager.spec 2022-10-27 10:54:44.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 4.5.5 +Version: 4.5.6 Release: 0 Summary: YaST2 - Package Library License: GPL-2.0-or-later diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.5.5/src/modules/AddOnProduct.rb new/yast2-packager-4.5.6/src/modules/AddOnProduct.rb --- old/yast2-packager-4.5.5/src/modules/AddOnProduct.rb 2022-05-26 16:55:44.000000000 +0200 +++ new/yast2-packager-4.5.6/src/modules/AddOnProduct.rb 2022-10-27 10:54:44.000000000 +0200 @@ -5,6 +5,8 @@ require "packager/product_patterns" require "y2packager/resolvable" require "y2packager/repository" +require "uri" +require "yast2/rel_url" # Yast namespace module Yast @@ -388,23 +390,49 @@ end # Returns an absolute URL from base + relative url. - # Relative URL needs to start with 'reulrl://' othewise - # it is not considered being relative and it's returned - # as it is (just the relative_url parameter). + # + # Relative URL needs to start with 'relurl://' or 'repo:/', otherwise it + # is not considered being relative and it's returned as it is (just the + # relative_url parameter). + # + # 'repo' URLs are resolved relative to the installation medium, not base_url. # # @param [String] base_url - # @param [String] url URL relative to the base + # @param [String] url URL relative to base_url resp. installation medium # # @example # AddOnProduct::GetAbsoluteURL ( # "http://www.example.org/some%20dir/another%20dir", # "relurl://../AnotherProduct/" # ) -> "http://www.example.org/some%20dir/AnotherProduct/" + # # AddOnProduct::GetAbsoluteURL ( - # "username:password@ftp://www.example.org/dir/", + # "ftp://username:passw...@www.example.org/dir/", # "relurl://./Product_CD1/" - # ) -> "username:password@ftp://www.example.org/dir/Product_CD1/" + # ) -> "ftp://username:passw...@www.example.org/dir/Product_CD1/" + # + # with /etc/install.inf containing the line 'ZyppRepoURL: hd:/?device=/dev/sda' + # AddOnProduct::GetAbsoluteURL ( + # "ftp://username:passw...@www.example.org/dir/", + # "repo:/Product_CD1" + # ) -> "hd:/Product_CD1?device=/dev/sda" def GetAbsoluteURL(base_url, url) + url_parsed = URI(url) + + if url_parsed.scheme == "repo" + base_url = InstURL.installInf2Url("") + if base_url.empty? + log.error "no ZyppRepoURL in /etc/install.inf" + else + rel_url = "relurl:" + url_parsed.path + url = Yast2::RelURL.from_installation_repository(rel_url).absolute_url.to_s + log.info("base url + relative path: #{URL.HidePassword(base_url)} + #{url_parsed.path}") + log.info("absolute url: #{URL.HidePassword(url)}") + end + + return url + end + if !Builtins.regexpmatch(url, "^relurl://") Builtins.y2debug("Not a relative URL: %1", URL.HidePassword(url)) return url diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.5.5/test/addon_product_test.rb new/yast2-packager-4.5.6/test/addon_product_test.rb --- old/yast2-packager-4.5.5/test/addon_product_test.rb 2022-05-26 16:55:44.000000000 +0200 +++ new/yast2-packager-4.5.6/test/addon_product_test.rb 2022-10-27 10:54:44.000000000 +0200 @@ -793,4 +793,46 @@ end end end + + describe "#GetAbsoluteURL" do + it "resolves a relurl with .." do + base = "http://www.example.org/some%20dir/another%20dir" + rel = "relurl://../AnotherProduct/" + expect(subject.GetAbsoluteURL(base, rel)) + .to eq "http://www.example.org/some%20dir/AnotherProduct/" + end + + it "resolves a relurl, with a misleading non-ftp base" do + # scheme: username + # opaque: password@ftp://www.example.org/dir/ + base = "username:password@ftp://www.example.org/dir/" + rel = "relurl://./Product_CD1/" + expect(subject.GetAbsoluteURL(base, rel)) + .to eq "username:password@ftp://www.example.org/dir/Product_CD1/" + end + + it "resolves a relurl, preserving user:pass" do + base = "ftp://username:passw...@www.example.org/dir/" + rel = "relurl://./Product_CD1/" + expect(subject.GetAbsoluteURL(base, rel)) + .to eq "ftp://username:passw...@www.example.org/dir/Product_CD1/" + end + + it "resolves a repo:, ignoring base_url, using InstURL, masking password" do + base = "urn:whatever" + rel = "repo:/foo.xml" + inst_url = "ftp://username:passw...@www.example.org/dir/" + expected = "ftp://username:passw...@www.example.org/dir/foo.xml" + + expect(Yast::InstURL).to receive(:installInf2Url).with("").and_return(inst_url) + + expect(Yast2::RelURL).to receive(:from_installation_repository) + .with("relurl:/foo.xml") + .and_return(double(absolute_url: expected)) + expect(subject.log).to receive(:info).with(/base url.*PASSWORD/) + expect(subject.log).to receive(:info).with(/absolute url.*PASSWORD/) + expect(subject.GetAbsoluteURL(base, rel)) + .to eq expected + end + end end