Hello community, here is the log from the commit of package yast2-packager for openSUSE:Factory checked in at 2020-07-15 11:15:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-packager (Old) and /work/SRC/openSUSE:Factory/.yast2-packager.new.3060 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-packager" Wed Jul 15 11:15:42 2020 rev:397 rq:820637 version:4.3.3 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes 2020-06-10 00:38:10.193358586 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-packager.new.3060/yast2-packager.changes 2020-07-15 11:18:24.273203699 +0200 @@ -1,0 +2,8 @@ +Mon Jul 13 07:59:58 UTC 2020 - Ladislav Slezák <lsle...@suse.cz> + +- Improve medium type detection, do not report Online medium + when the /media.1/products file is missing in the repository, + SMT does not mirror this file (bsc#1173336) +- 4.3.3 + +------------------------------------------------------------------- Old: ---- yast2-packager-4.3.2.tar.bz2 New: ---- yast2-packager-4.3.3.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-packager.spec ++++++ --- /var/tmp/diff_new_pack.26CpVU/_old 2020-07-15 11:18:29.417208791 +0200 +++ /var/tmp/diff_new_pack.26CpVU/_new 2020-07-15 11:18:29.421208794 +0200 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 4.3.2 +Version: 4.3.3 Release: 0 Summary: YaST2 - Package Library License: GPL-2.0-or-later ++++++ yast2-packager-4.3.2.tar.bz2 -> yast2-packager-4.3.3.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.3.2/package/yast2-packager.changes new/yast2-packager-4.3.3/package/yast2-packager.changes --- old/yast2-packager-4.3.2/package/yast2-packager.changes 2020-06-04 15:15:18.000000000 +0200 +++ new/yast2-packager-4.3.3/package/yast2-packager.changes 2020-07-13 10:59:45.000000000 +0200 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Mon Jul 13 07:59:58 UTC 2020 - Ladislav Slezák <lsle...@suse.cz> + +- Improve medium type detection, do not report Online medium + when the /media.1/products file is missing in the repository, + SMT does not mirror this file (bsc#1173336) +- 4.3.3 + +------------------------------------------------------------------- Thu Jun 4 11:45:45 UTC 2020 - Josef Reidinger <jreidin...@suse.com> - Replace anyxml agent with rubygem-nokogiri as yast2 already diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.3.2/package/yast2-packager.spec new/yast2-packager-4.3.3/package/yast2-packager.spec --- old/yast2-packager-4.3.2/package/yast2-packager.spec 2020-06-04 15:15:18.000000000 +0200 +++ new/yast2-packager-4.3.3/package/yast2-packager.spec 2020-07-13 10:59:45.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 4.3.2 +Version: 4.3.3 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.3.2/src/lib/y2packager/clients/inst_productsources.rb new/yast2-packager-4.3.3/src/lib/y2packager/clients/inst_productsources.rb --- old/yast2-packager-4.3.2/src/lib/y2packager/clients/inst_productsources.rb 2020-06-04 15:15:18.000000000 +0200 +++ new/yast2-packager-4.3.3/src/lib/y2packager/clients/inst_productsources.rb 2020-07-13 10:59:45.000000000 +0200 @@ -104,6 +104,14 @@ def main textdomain "packager" + # Set release version environment variable for zypp. + # + # Otherwise zypp might use the old version (update) resp. fail to find + # a product version at all (new installation). + # + # cf. bsc#1172870 + ENV[RELEASEVER_ENV] = Product.version + if AddOnProduct.skip_add_ons log.info("Skipping module (as requested before)") return :auto @@ -138,10 +146,6 @@ return :auto end - # Set the proper release version for newly added repositories - # we want to use new product and not old - ENV[RELEASEVER_ENV] = Product.version - # (Applicable only in inst-sys) @preselect_recommended = true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.3.2/src/lib/y2packager/medium_type.rb new/yast2-packager-4.3.3/src/lib/y2packager/medium_type.rb --- old/yast2-packager-4.3.2/src/lib/y2packager/medium_type.rb 2020-06-04 15:15:18.000000000 +0200 +++ new/yast2-packager-4.3.3/src/lib/y2packager/medium_type.rb 2020-07-13 10:59:45.000000000 +0200 @@ -105,13 +105,6 @@ downloader = Y2Packager::RepomdDownloader.new(url) product_repos = downloader.product_repos - # the online medium should not contain any repository - # TODO: how to detect an invalid installation URL or a broken medium?? - if product_repos.empty? - log.info("Detected medium type: online (no repository on the medium)") - return :online - end - # the offline medium contains several modules and extensions if product_repos.size > 1 log.info("Detected medium type: offline (found #{product_repos.size} product repos)") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.3.2/src/lib/y2packager/product_location.rb new/yast2-packager-4.3.3/src/lib/y2packager/product_location.rb --- old/yast2-packager-4.3.2/src/lib/y2packager/product_location.rb 2020-06-04 15:15:18.000000000 +0200 +++ new/yast2-packager-4.3.3/src/lib/y2packager/product_location.rb 2020-07-13 10:59:45.000000000 +0200 @@ -60,7 +60,7 @@ pool = Y2Packager::SolvablePool.new - repomd_files = downloader.primary_xmls + repomd_files = downloader.primary_xmls(force_scan) return [] if repomd_files.empty? repomd_files.each do |repomd| diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.3.2/src/lib/y2packager/repomd_downloader.rb new/yast2-packager-4.3.3/src/lib/y2packager/repomd_downloader.rb --- old/yast2-packager-4.3.2/src/lib/y2packager/repomd_downloader.rb 2020-06-04 15:15:18.000000000 +0200 +++ new/yast2-packager-4.3.3/src/lib/y2packager/repomd_downloader.rb 2020-07-13 10:59:45.000000000 +0200 @@ -48,6 +48,9 @@ # # Returns the downloaded primary.xml.gz file(s) from the repository. # + # @param force [Boolean] Force scanning the repositories even when + # the /media.1/products file is missing, default `false` + # # @note For remote repositories (http://, ftp://, ...) the files are downloaded # to a temporary directory (/var/tmp/...), but for the local repositories # or mountable repositories (dir://, dvd://) it directly points to the original files! @@ -61,12 +64,21 @@ # @return [Array<String>] List of paths pointing to the downloaded primary.xml.gz files, # returns an empty list if the URL or the repository is not valid. # - def primary_xmls - return [] if product_repos.empty? + def primary_xmls(force = false) + # first check if there are any products defined in /media.1/products + repos = product_repos + + if repos.empty? + return [] unless force + + # if `force` is true then scan the repository at the root anyway, + # the repository name is ignored later so it can be any string + repos = { "Root Repository" => "/" } + end # add a temporary repository for downloading the files via libzypp src = Yast::Pkg.RepositoryAdd("base_urls" => [url]) - product_repos.map do |(_name, dir)| + repos.map do |(_name, dir)| # download the repository index file (repomd.xml) repomd_file = Yast::Pkg.SourceProvideFile(src, 1, File.join(dir, "repodata/repomd.xml")) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.3.2/test/medium_type_test.rb new/yast2-packager-4.3.3/test/medium_type_test.rb --- old/yast2-packager-4.3.2/test/medium_type_test.rb 2020-06-04 15:15:18.000000000 +0200 +++ new/yast2-packager-4.3.3/test/medium_type_test.rb 2020-07-13 10:59:45.000000000 +0200 @@ -24,13 +24,6 @@ expect { described_class.type }.to raise_exception(/The installation URL is not set/) end - it "returns :online if no repository is found on the medium" do - expect_any_instance_of(Y2Packager::RepomdDownloader) - .to receive(:product_repos).and_return([]) - - expect(described_class.type).to eq(:online) - end - it "returns :offline if at least two repositories are found on the medium" do expect_any_instance_of(Y2Packager::RepomdDownloader) .to receive(:product_repos).and_return( @@ -43,6 +36,18 @@ expect(described_class.type).to eq(:offline) end + context "missing media.1/products on the installation medium" do + before do + expect_any_instance_of(Y2Packager::RepomdDownloader) + .to receive(:product_repos).and_return([]) + end + + it "returns :online if the repository does not contain any base product" do + expect(Y2Packager::ProductLocation).to receive(:scan).and_return([]) + expect(described_class.type).to eq(:online) + end + end + context "only one repository on the installation medium" do before do expect_any_instance_of(Y2Packager::RepomdDownloader)