Hello community, here is the log from the commit of package yast2-packager for openSUSE:Factory checked in at 2018-03-04 11:50:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-packager (Old) and /work/SRC/openSUSE:Factory/.yast2-packager.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-packager" Sun Mar 4 11:50:53 2018 rev:345 rq:581996 version:4.0.45 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes 2018-02-24 16:36:01.024710454 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-packager.new/yast2-packager.changes 2018-03-04 11:50:55.685764520 +0100 @@ -1,0 +2,31 @@ +Fri Mar 2 13:38:40 UTC 2018 - [email protected] + +- Updated repository selection label to be more understandable + (bsc#1081508) +- 4.0.45 + +------------------------------------------------------------------- +Tue Feb 27 10:37:41 UTC 2018 - [email protected] + +- Added product merge: SLE11/12 HA GEO has been merged to SLE15 HA + (bsc#1069705) +- Added a missing textdomain in a file (bsc#1083015) +- Unified text domains to "packager" +- 4.0.44 + +------------------------------------------------------------------- +Tue Feb 27 08:36:20 UTC 2018 - [email protected] + +- Added Live Patching product rename (bsc#1074154) +- 4.0.43 + +------------------------------------------------------------------- +Mon Feb 26 12:05:46 UTC 2018 - [email protected] + +- Fixed installing packages needed for accessing the installation + repositories (e.g. "nfs-client" for "nfs://" repositories), + additionally evaluate also the add-on repositories, not just the + base product repository (bsc#1063980) +- 4.0.42 + +------------------------------------------------------------------- Old: ---- yast2-packager-4.0.41.tar.bz2 New: ---- yast2-packager-4.0.45.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-packager.spec ++++++ --- /var/tmp/diff_new_pack.U2l4GT/_old 2018-03-04 11:50:56.177746698 +0100 +++ /var/tmp/diff_new_pack.U2l4GT/_new 2018-03-04 11:50:56.177746698 +0100 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 4.0.41 +Version: 4.0.45 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-packager-4.0.41.tar.bz2 -> yast2-packager-4.0.45.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.0.41/package/yast2-packager.changes new/yast2-packager-4.0.45/package/yast2-packager.changes --- old/yast2-packager-4.0.41/package/yast2-packager.changes 2018-02-23 07:55:07.000000000 +0100 +++ new/yast2-packager-4.0.45/package/yast2-packager.changes 2018-03-02 14:45:57.000000000 +0100 @@ -1,4 +1,35 @@ ------------------------------------------------------------------- +Fri Mar 2 13:38:40 UTC 2018 - [email protected] + +- Updated repository selection label to be more understandable + (bsc#1081508) +- 4.0.45 + +------------------------------------------------------------------- +Tue Feb 27 10:37:41 UTC 2018 - [email protected] + +- Added product merge: SLE11/12 HA GEO has been merged to SLE15 HA + (bsc#1069705) +- Added a missing textdomain in a file (bsc#1083015) +- Unified text domains to "packager" +- 4.0.44 + +------------------------------------------------------------------- +Tue Feb 27 08:36:20 UTC 2018 - [email protected] + +- Added Live Patching product rename (bsc#1074154) +- 4.0.43 + +------------------------------------------------------------------- +Mon Feb 26 12:05:46 UTC 2018 - [email protected] + +- Fixed installing packages needed for accessing the installation + repositories (e.g. "nfs-client" for "nfs://" repositories), + additionally evaluate also the add-on repositories, not just the + base product repository (bsc#1063980) +- 4.0.42 + +------------------------------------------------------------------- Thu Feb 22 17:17:31 CET 2018 - [email protected] - Added textdomain in order to activate translation (bnc#1081365). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.0.41/package/yast2-packager.spec new/yast2-packager-4.0.45/package/yast2-packager.spec --- old/yast2-packager-4.0.41/package/yast2-packager.spec 2018-02-23 07:55:07.000000000 +0100 +++ new/yast2-packager-4.0.45/package/yast2-packager.spec 2018-03-02 14:45:57.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 4.0.41 +Version: 4.0.45 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.0.41/src/clients/inst_productsources.rb new/yast2-packager-4.0.45/src/clients/inst_productsources.rb --- old/yast2-packager-4.0.41/src/clients/inst_productsources.rb 2018-02-23 07:55:07.000000000 +0100 +++ new/yast2-packager-4.0.45/src/clients/inst_productsources.rb 2018-03-02 14:45:57.000000000 +0100 @@ -1231,8 +1231,8 @@ MultiSelectionBox( Id("addon_repos"), Opt(:notify, :hstretch), - # TRANSLATORS: multi-selection box - _("&List of Repositories"), + # TRANSLATORS: multi-selection box, contains a list of online repositories + _("&Use Additional Online Repositories"), [] ) ), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.0.41/src/lib/y2packager/clients/inst_product_upgrade_license.rb new/yast2-packager-4.0.45/src/lib/y2packager/clients/inst_product_upgrade_license.rb --- old/yast2-packager-4.0.41/src/lib/y2packager/clients/inst_product_upgrade_license.rb 2018-02-23 07:55:07.000000000 +0100 +++ new/yast2-packager-4.0.45/src/lib/y2packager/clients/inst_product_upgrade_license.rb 2018-03-02 14:45:57.000000000 +0100 @@ -29,7 +29,7 @@ # @see Y2Packager::Clients::InstProductLicense class InstProductUpgradeLicense < InstProductLicense def main - textdomain "installation" + textdomain "packager" # do not display the license when going back, skip the dialog return :back if Yast::GetInstArgs.going_back diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.0.41/src/lib/y2packager/clients/inst_repositories_initialization.rb new/yast2-packager-4.0.45/src/lib/y2packager/clients/inst_repositories_initialization.rb --- old/yast2-packager-4.0.41/src/lib/y2packager/clients/inst_repositories_initialization.rb 2018-02-23 07:55:07.000000000 +0100 +++ new/yast2-packager-4.0.45/src/lib/y2packager/clients/inst_repositories_initialization.rb 2018-03-02 14:45:57.000000000 +0100 @@ -35,7 +35,7 @@ # Client main method def main - textdomain "installation" + textdomain "packager" if !init_installation_repositories Yast::Popup.Error( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.0.41/src/lib/y2packager/widgets/license_translations_button.rb new/yast2-packager-4.0.45/src/lib/y2packager/widgets/license_translations_button.rb --- old/yast2-packager-4.0.41/src/lib/y2packager/widgets/license_translations_button.rb 2018-02-23 07:55:07.000000000 +0100 +++ new/yast2-packager-4.0.45/src/lib/y2packager/widgets/license_translations_button.rb 2018-03-02 14:45:57.000000000 +0100 @@ -24,6 +24,8 @@ def initialize(product, language = nil) super() + textdomain "packager" + @product = product @language = language || Yast::Language.language end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.0.41/src/lib/y2packager/widgets/simple_language_selection.rb new/yast2-packager-4.0.45/src/lib/y2packager/widgets/simple_language_selection.rb --- old/yast2-packager-4.0.41/src/lib/y2packager/widgets/simple_language_selection.rb 2018-02-23 07:55:07.000000000 +0100 +++ new/yast2-packager-4.0.45/src/lib/y2packager/widgets/simple_language_selection.rb 2018-03-02 14:45:57.000000000 +0100 @@ -37,7 +37,7 @@ # @param languages [Array<String>] List of languages to display (en_US, de_DE, etc.) # @param default [String] Default language code def initialize(languages, default) - textdomain "y2packager" + textdomain "packager" @languages = languages @default = default self.widget_id = "simple_language_selection" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.0.41/src/modules/AddOnProduct.rb new/yast2-packager-4.0.45/src/modules/AddOnProduct.rb --- old/yast2-packager-4.0.41/src/modules/AddOnProduct.rb 2018-02-23 07:55:07.000000000 +0100 +++ new/yast2-packager-4.0.45/src/modules/AddOnProduct.rb 2018-03-02 14:45:57.000000000 +0100 @@ -15,11 +15,17 @@ "SUSE_SLES" => ["SLES"], # SLED or Workstation extension "SUSE_SLED" => ["SLED", "sle-we"], - "sle-haegeo" => ["sle-ha-geo"], + # SLE11 HA has been renamed since SLE12 "sle-hae" => ["sle-ha"], + # SLE11 HA GEO is now included in SLE15 HA + "sle-haegeo" => ["sle-ha"], + # SLE12 HA GEO is now included in SLE15 HA + "sle-ha-geo" => ["sle-ha"], "SUSE_SLES_SAP" => ["SLES_SAP"], # SMT is now integrated into the base SLES "sle-smt" => ["SLES"], + # Live patching is a module now (bsc#1074154) + "sle-live-patching" => ["sle-module-live-patching"], # Toolchain and SDK are now included in the Development Tools SLE15 module "sle-module-toolchain" => ["sle-module-development-tools"], "sle-sdk" => ["sle-module-development-tools"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.0.41/src/modules/Packages.rb new/yast2-packager-4.0.45/src/modules/Packages.rb --- old/yast2-packager-4.0.41/src/modules/Packages.rb 2018-02-23 07:55:07.000000000 +0100 +++ new/yast2-packager-4.0.45/src/modules/Packages.rb 2018-03-02 14:45:57.000000000 +0100 @@ -5,6 +5,7 @@ require "erb" require "fileutils" require "uri" +require "cgi" # Yast namespace module Yast @@ -1047,26 +1048,57 @@ packages end - # Compute packages required to access the repository + # Compute packages required to access the repositories # @return [Array](string) list of the required packages def sourceAccessPackages - # TODO: rather check all registered repositories... - ret = [] + packages = [] + schemes = repo_schemes - instmode = Linuxrc.InstallInf("InstMode") - Builtins.y2milestone("Installation mode: %1", instmode) + # /sbin/mount.cifs is required to mount a SMB/CIFS share + packages << "cifs-mount" if schemes.include?("smb") || schemes.include?("cifs") - if instmode == "smb" || instmode == "cifs" - # /sbin/mount.cifs is required to mount a SMB/CIFS share - ret = ["cifs-mount"] - elsif instmode == "nfs" - # portmap is required to mount an NFS export - ret = ["nfs-client"] - end + # portmap is required to mount an NFS export + packages << "nfs-client" if schemes.include?("nfs") - Builtins.y2milestone("Packages for accessing the repository: %1", ret) + log.info("Packages for accessing the repositories: #{packages.inspect}") + packages + end - deep_copy(ret) + # Return the URL schemes for the currently defined repositories (only enabled + # repositories are evaluated). For ISO repositories the base URL schema + # is returned (i.e. the location of the ISO), invalid URLs are ignored. + # @return [Array<String>] the list of the URL schemes, empty if + # no repository is defined + def repo_schemes + schemes = [] + + # all enabled repositories + Pkg.SourceGetCurrent(true).each do |repo| + url = Pkg.SourceURL(repo) + + begin + uri = URI(url) + + # handle the ISO scheme specifically + # Note: scheme is converted to lowercase by Ruby + if uri.scheme == "iso" && uri.query + # parse the query string into a hash, extract the base URL from the query + # CGI.parse output is a hash: key => [val1, val2, ...] + params = CGI.parse(uri.query) + # expect only one "url" parameter + scheme = URI(params["url"].first).scheme if params["url"] && !params["url"].empty? + else + scheme = uri.scheme + end + + schemes << scheme if scheme && !schemes.include?(scheme) + # normally should not happen, the URLs from libzypp should be always valid + rescue URI::InvalidURIError => e + log.error(e.message) + end + end + + schemes end # Additional kernel packages from control file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.0.41/test/packages_test.rb new/yast2-packager-4.0.45/test/packages_test.rb --- old/yast2-packager-4.0.41/test/packages_test.rb 2018-02-23 07:55:07.000000000 +0100 +++ new/yast2-packager-4.0.45/test/packages_test.rb 2018-03-02 14:45:57.000000000 +0100 @@ -36,7 +36,8 @@ PRODUCTS_FROM_ZYPP = load_zypp("products.yml").freeze -describe Yast::Packages do +describe "Yast::Packages" do + subject { Yast::Packages } before(:each) do log.info "--- test ---" end @@ -368,17 +369,35 @@ end it "returns updated product which has been renamed" do - products = [ - { "name" => "sle-haegeo", "status" => :removed }, - { "name" => "sle-ha-geo", "status" => :selected } - ] + hae = { "name" => "sle-hae", "status" => :removed } + ha = { "name" => "sle-ha", "status" => :selected } + products = [hae, ha] status = Yast::Packages.group_products_by_status(products) - expect(status[:updated].size).to eq(1) - old_product, new_product = status[:updated].first - expect(old_product["name"]).to eq("sle-haegeo") - expect(new_product["name"]).to eq("sle-ha-geo") + updates = status[:updated] + expect(updates.size).to eq(1) + + # check the HAE => HA rename + expect(updates[hae]).to eq(ha) + end + + it "returns updated products which have been merged" do + hae = { "name" => "sle-hae", "status" => :removed } + haegeo = { "name" => "sle-haegeo", "status" => :removed } + ha = { "name" => "sle-ha", "status" => :selected } + products = [hae, haegeo, ha] + + status = Yast::Packages.group_products_by_status(products) + + # product updates + updates = status[:updated] + expect(updates.size).to eq(2) + + # check the HAE => HA rename + expect(updates[hae]).to eq(ha) + # check the HAE GEO => HA merge + expect(updates[haegeo]).to eq(ha) end it "handles mixed renamed and unchanged products" do @@ -1496,4 +1515,118 @@ it_behaves_like "sets priority", 0, 100 end end + + # helper for the #repo_schemes tests to mock the repository configuration + def expect_source_urls(mapping) + expect(Yast::Pkg).to receive(:SourceGetCurrent).with(true).and_return(mapping.keys) + + mapping.each do |id, url| + expect(Yast::Pkg).to receive(:SourceURL).with(id).and_return(url) + end + end + + describe "#repo_schemes" do + it "returns empty list if no repository is defined" do + expect_source_urls({}) + expect(subject.repo_schemes).to eq([]) + end + + it "returns all used schemes" do + expect_source_urls( + 0 => "http://example.com", + 1 => "https://example.com", + 2 => "ftp://example.com", + 3 => "dir:///packages", + 4 => "dvd:///" + ) + expect(subject.repo_schemes).to eq(["http", "https", "ftp", "dir", "dvd"]) + end + + it "returns unique list" do + expect_source_urls( + 0 => "http://example.com", + 1 => "http://example2.com", + 7 => "ftp://example.com", + 8 => "ftp://example2.com" + ) + expect(subject.repo_schemes).to eq(["http", "ftp"]) + end + + it "returns the scheme of the base URL for ISO scheme" do + expect_source_urls( + # ISO over NFS, see "man zypper" + 0 => "iso:/subdir?iso=DVD1.iso&url=nfs://server/dir&mnt=/nfs&filesystem=udf" + ) + expect(subject.repo_schemes).to eq(["nfs"]) + end + + it "converts the scheme names to lower case" do + expect_source_urls( + 0 => "HTTP://example.com", + 8 => "FTP://example2.com" + ) + expect(subject.repo_schemes).to eq(["http", "ftp"]) + end + + it "ignores invalid URL" do + expect_source_urls(0 => ":") + expect(subject.repo_schemes).to eq([]) + end + + it "ignores incomplete ISO URL (missing 'url' parameter)" do + expect_source_urls(0 => "iso:/subdir?iso=DVD1.iso&mnt=/nfs&filesystem=udf") + expect(subject.repo_schemes).to eq([]) + end + + it "ignores incomplete ISO URL (empty 'url' parameter)" do + expect_source_urls(0 => "iso:/subdir?iso=DVD1.iso&url=&mnt=/nfs&filesystem=udf") + expect(subject.repo_schemes).to eq([]) + end + + it "ignores invalid ISO URL (invalid 'url' parameter)" do + expect_source_urls( + 0 => "iso:/subdir?iso=DVD1.iso&url=:&filesystem=udf" + ) + expect(subject.repo_schemes).to eq([]) + end + end + + describe "#sourceAccessPackages" do + it "returns empty list if no repository is defined" do + expect(subject).to receive(:repo_schemes).and_return([]) + expect(subject.sourceAccessPackages).to eq([]) + end + + # these do not need any extra package to access them + it "returns empty list for http(s), ftp, hd, cd, dvd and dir schemes" do + schemes = ["http", "https", "ftp", "hd", "cd", "dvd", "dir"] + expect(subject).to receive(:repo_schemes).and_return(schemes) + expect(subject.sourceAccessPackages).to eq([]) + end + + it "returns 'nfs-client' for nfs scheme" do + schemes = ["nfs"] + expect(subject).to receive(:repo_schemes).and_return(schemes) + expect(subject.sourceAccessPackages).to eq(["nfs-client"]) + end + + it "returns 'cifs-mount' for smb scheme" do + schemes = ["smb"] + expect(subject).to receive(:repo_schemes).and_return(schemes) + expect(subject.sourceAccessPackages).to eq(["cifs-mount"]) + end + + it "returns 'cifs-mount' for cifs scheme" do + schemes = ["cifs"] + expect(subject).to receive(:repo_schemes).and_return(schemes) + expect(subject.sourceAccessPackages).to eq(["cifs-mount"]) + end + + it "returns 'cifs-mount' and 'nfs-client' for smb and nfs schemes" do + schemes = ["cifs", "nfs"] + expect(subject).to receive(:repo_schemes).and_return(schemes) + # sort the result to make it order independent + expect(subject.sourceAccessPackages.sort).to eq(["cifs-mount", "nfs-client"]) + end + end end
