Hello community, here is the log from the commit of package yast2-installation for openSUSE:Factory checked in at 2019-12-14 12:02:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-installation (Old) and /work/SRC/openSUSE:Factory/.yast2-installation.new.4691 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-installation" Sat Dec 14 12:02:28 2019 rev:438 rq:751336 version:4.2.25 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-installation/yast2-installation.changes 2019-11-20 10:26:52.086557868 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-installation.new.4691/yast2-installation.changes 2019-12-14 12:02:41.819409747 +0100 @@ -1,0 +2,15 @@ +Thu Nov 21 14:33:50 UTC 2019 - [email protected] + +- Using Y2Packager::Resolvable.any? and Y2Packager::Resolvable.find + in order to decrease the required memory (bsc#1132650, + bsc#1140037). +- 4.2.25 + +------------------------------------------------------------------- +Thu Nov 21 14:32:50 UTC 2019 - Knut Anderssen <[email protected]> + +- Do not remove /etc/install.inf from inst-sys (bsc#1122493, + bsc#1157476). +- 4.2.24 + +------------------------------------------------------------------- Old: ---- yast2-installation-4.2.23.tar.bz2 New: ---- yast2-installation-4.2.25.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-installation.spec ++++++ --- /var/tmp/diff_new_pack.ZelCiR/_old 2019-12-14 12:02:42.415409659 +0100 +++ /var/tmp/diff_new_pack.ZelCiR/_new 2019-12-14 12:02:42.427409657 +0100 @@ -17,7 +17,7 @@ Name: yast2-installation -Version: 4.2.23 +Version: 4.2.25 Release: 0 Summary: YaST2 - Installation Parts License: GPL-2.0-only ++++++ yast2-installation-4.2.23.tar.bz2 -> yast2-installation-4.2.25.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-4.2.23/package/yast2-installation.changes new/yast2-installation-4.2.25/package/yast2-installation.changes --- old/yast2-installation-4.2.23/package/yast2-installation.changes 2019-11-15 11:43:06.000000000 +0100 +++ new/yast2-installation-4.2.25/package/yast2-installation.changes 2019-11-27 15:10:40.000000000 +0100 @@ -1,4 +1,19 @@ ------------------------------------------------------------------- +Thu Nov 21 14:33:50 UTC 2019 - [email protected] + +- Using Y2Packager::Resolvable.any? and Y2Packager::Resolvable.find + in order to decrease the required memory (bsc#1132650, + bsc#1140037). +- 4.2.25 + +------------------------------------------------------------------- +Thu Nov 21 14:32:50 UTC 2019 - Knut Anderssen <[email protected]> + +- Do not remove /etc/install.inf from inst-sys (bsc#1122493, + bsc#1157476). +- 4.2.24 + +------------------------------------------------------------------- Fri Nov 15 08:58:40 UTC 2019 - Oliver Kurz <[email protected]> - Use linuxrc option "reboot_timeout" to configure the timeout diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-4.2.23/package/yast2-installation.spec new/yast2-installation-4.2.25/package/yast2-installation.spec --- old/yast2-installation-4.2.23/package/yast2-installation.spec 2019-11-15 11:43:06.000000000 +0100 +++ new/yast2-installation-4.2.25/package/yast2-installation.spec 2019-11-27 15:10:40.000000000 +0100 @@ -16,7 +16,7 @@ # Name: yast2-installation -Version: 4.2.23 +Version: 4.2.25 Release: 0 Group: System/YaST License: GPL-2.0-only diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-4.2.23/src/include/installation/misc.rb new/yast2-installation-4.2.25/src/include/installation/misc.rb --- old/yast2-installation-4.2.23/src/include/installation/misc.rb 2019-11-15 11:43:06.000000000 +0100 +++ new/yast2-installation-4.2.25/src/include/installation/misc.rb 2019-11-27 15:10:40.000000000 +0100 @@ -296,6 +296,8 @@ scst_required == false ? "0" : "1" ) ) + # Is it really needed? It will enforce a read of /etc/install.inf from + # any step after resetting it. Linuxrc.ResetInstallInf nil diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-4.2.23/src/lib/installation/clients/copy_files_finish.rb new/yast2-installation-4.2.25/src/lib/installation/clients/copy_files_finish.rb --- old/yast2-installation-4.2.23/src/lib/installation/clients/copy_files_finish.rb 2019-11-15 11:43:06.000000000 +0100 +++ new/yast2-installation-4.2.25/src/lib/installation/clients/copy_files_finish.rb 2019-11-27 15:10:40.000000000 +0100 @@ -293,12 +293,7 @@ def handle_second_stage # Copy /etc/install.inf into built system so that the # second phase of the installation can find it. - if InstFunctions.second_stage_required? - Linuxrc.SaveInstallInf(Installation.destdir) - else - # TODO: write why it is needed - ::FileUtils.rm "/etc/install.inf" - end + Linuxrc.SaveInstallInf(Installation.destdir) if InstFunctions.second_stage_required? end def copy_control_file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-4.2.23/src/lib/installation/clients/inst_addon_update_sources.rb new/yast2-installation-4.2.25/src/lib/installation/clients/inst_addon_update_sources.rb --- old/yast2-installation-4.2.23/src/lib/installation/clients/inst_addon_update_sources.rb 2019-11-15 11:43:06.000000000 +0100 +++ new/yast2-installation-4.2.25/src/lib/installation/clients/inst_addon_update_sources.rb 2019-11-27 15:10:40.000000000 +0100 @@ -27,6 +27,9 @@ # Assumptions: # - the sources will be saved afterwards # (this means that running this client alone will not work) + +require "y2packager/resolvable" + module Yast class InstAddonUpdateSourcesClient < Client def main @@ -152,41 +155,32 @@ # @return the installation sources to be added def UpdateUrls urls = {} - products = Pkg.ResolvableProperties("", :product, "") + products = Y2Packager::Resolvable.find(kind: :product) Builtins.foreach(products) do |p| - Builtins.foreach(Ops.get_list(p, "update_urls", [])) do |u| + Builtins.foreach(p.update_urls) do |u| # bnc #542792 # Repository name must be generated from product details + p_name = + [p.display_name, p.name, p.summary, _("Unknown Product")].reject(&:empty?).first Ops.set( urls, u, Builtins.sformat( _("Updates for %1 %2"), - Ops.get_locale( - p, - "display_name", - Ops.get_locale( - p, - "name", - Ops.get_locale(p, "summary", _("Unknown Product")) - ) - ), - Ops.get_string(p, "version", "") + p_name, + p.version ) ) # alias should be simple (bnc#768624) + p_alias = [p.display_name, p.name, "repo"].reject(&:empty?).first Ops.set( @aliases, u, String.Replace( Ops.add( "update-", - Ops.get_string( - p, - "display_name", - Ops.get_string(p, "name", "repo") - ) + p_alias ), " ", "-" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-4.2.23/src/lib/installation/clients/inst_extrasources.rb new/yast2-installation-4.2.25/src/lib/installation/clients/inst_extrasources.rb --- old/yast2-installation-4.2.23/src/lib/installation/clients/inst_extrasources.rb 2019-11-15 11:43:06.000000000 +0100 +++ new/yast2-installation-4.2.25/src/lib/installation/clients/inst_extrasources.rb 2019-11-27 15:10:40.000000000 +0100 @@ -20,6 +20,7 @@ # ------------------------------------------------------------------------------ require "y2packager/known_repositories" +require "y2packager/resolvable" Yast.import "UI" Yast.import "Pkg" @@ -407,19 +408,9 @@ "Checking whether repository %1 is an update repo...", repo ) - ret = false # check if there is a patch available in the repository - Builtins.foreach(Pkg.ResolvableProperties("", :patch, "")) do |patch| - if Ops.get_integer(patch, "source", -1) == repo - Builtins.y2milestone( - "Found patch %1 in the repository", - Ops.get_string(patch, "name", "") - ) - ret = true - raise Break - end - end + ret = Y2Packager::Resolvable.any?(kind: :patch, source: repo) Builtins.y2milestone("Repository %1 is update repo: %2", repo, ret) @@ -462,11 +453,13 @@ # only package names (without version) names_only = true Pkg.GetPackages(:selected, names_only).each do |pkg| - Pkg.ResolvableProperties(pkg, :package, "").each do |p| - source = p["source"] - next unless p["status"] == :selected && repos.include?(source) + Y2Packager::Resolvable.find(kind: :package, + name: pkg, + status: :selected).each do |p| + source = p.source + next unless repos.include?(source) - package = "#{p["name"]}-#{p["version"]}.#{p["arch"]}" + package = "#{p.name}-#{p.version}.#{p.arch}" log.info("Found upgrade to install: #{package}") packages << package ret << source unless ret.include?(source) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-4.2.23/src/lib/installation/clients/inst_modules_extensions.rb new/yast2-installation-4.2.25/src/lib/installation/clients/inst_modules_extensions.rb --- old/yast2-installation-4.2.23/src/lib/installation/clients/inst_modules_extensions.rb 2019-11-15 11:43:06.000000000 +0100 +++ new/yast2-installation-4.2.25/src/lib/installation/clients/inst_modules_extensions.rb 2019-11-27 15:10:40.000000000 +0100 @@ -1,5 +1,6 @@ require "yast" require "y2packager/product" +require "y2packager/resolvable" Yast.import "GetInstArgs" Yast.import "Pkg" @@ -32,7 +33,8 @@ extension_packages.select! do |list| pkg_name = list.first - dependencies[pkg_name] = Yast::Pkg.ResolvableDependencies(pkg_name, :package, "").first["deps"] + packages = Y2Packager::Resolvable.find(kind: :package, name: pkg_name) + dependencies[pkg_name] = packages.empty? ? [] : packages.first.deps product_provides = dependencies[pkg_name].find_all do |d| d["provides"] && d["provides"].match(/#{Regexp.escape(PROVIDES_PRODUCT)}/) @@ -52,9 +54,10 @@ extension_provide = dependencies[pkg_name].find do |d| d["provides"] && d["provides"].match(/#{Regexp.escape(PROVIDES_KEY)}/) end - - module_name = extension_provide["provides"][/#{Regexp.escape(PROVIDES_KEY)}\s*=\s*(\S+)/, 1] - log.info "extension for module #{module_name} in package #{pkg_name}" + if extension_provide && extension_provide["provides"] && !extension_provide["provides"].empty? + module_name = extension_provide["provides"][/#{Regexp.escape(PROVIDES_KEY)}\s*=\s*(\S+)/, 1] + log.info "extension for module #{module_name} in package #{pkg_name}" + end pkg_name end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-4.2.23/src/lib/installation/clients/inst_prepare_image.rb new/yast2-installation-4.2.25/src/lib/installation/clients/inst_prepare_image.rb --- old/yast2-installation-4.2.23/src/lib/installation/clients/inst_prepare_image.rb 2019-11-15 11:43:06.000000000 +0100 +++ new/yast2-installation-4.2.25/src/lib/installation/clients/inst_prepare_image.rb 2019-11-27 15:10:40.000000000 +0100 @@ -26,6 +26,9 @@ # Lukas Ocilka <[email protected]> # # $Id$ + +require "y2packager/resolvable" + module Yast class InstPrepareImageClient < Client def main @@ -45,12 +48,12 @@ # set repo to get images from ImageInstallation.SetRepo(Ops.get(Packages.theSources, 0, 0)) - @all_patterns = Pkg.ResolvableProperties("", :pattern, "") + @all_patterns = Y2Packager::Resolvable.find(kind: :pattern) @patterns_to_install = Builtins.maplist(@all_patterns) do |one_patern| - if Ops.get_symbol(one_patern, "status", :unknown) == :selected || - Ops.get_symbol(one_patern, "status", :unknown) == :installed - next Ops.get_string(one_patern, "name", "") + if one_patern.status == :selected || + one_patern.status == :installed + next one_patern.name else next "" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-4.2.23/src/lib/installation/update_repository.rb new/yast2-installation-4.2.25/src/lib/installation/update_repository.rb --- old/yast2-installation-4.2.23/src/lib/installation/update_repository.rb 2019-11-15 11:43:06.000000000 +0100 +++ new/yast2-installation-4.2.25/src/lib/installation/update_repository.rb 2019-11-27 15:10:40.000000000 +0100 @@ -19,6 +19,7 @@ require "packages/package_downloader" require "packages/package_extractor" require "y2packager/self_update_addon_filter" +require "y2packager/resolvable" Yast.import "Pkg" Yast.import "Progress" @@ -143,19 +144,18 @@ # which should be used in an add-on and not applied to the inst-sys are ignored. # The packages are sorted by name (alphabetical order). # - # @return [Array<Hash>] List of packages to install + # @return [Array<Y2Packager::Resolvable>] List of packages to install # - # @see Yast::Pkg.ResolvableProperties + # @see Y2Packager::Resolvable def packages return @packages unless @packages.nil? add_repo - candidates = Yast::Pkg.ResolvableProperties("", :package, "") - @packages = candidates.select { |p| p["source"] == repo_id }.sort_by! { |a| a["name"] } - log.info "Found #{@packages.size} packages: #{@packages}" + @packages = Y2Packager::Resolvable.find(kind: :package, source: repo_id).sort_by!(&:name) + log.info "Found #{@packages.size} packages: #{@packages.map(&:name)}" # remove packages which are used as addons, these should not be applied to the inst-sys addon_pkgs = Y2Packager::SelfUpdateAddonFilter.packages(repo_id) - @packages.reject! { |p| addon_pkgs.include?(p["name"]) } - log.info "Using #{@packages.size} packages: #{@packages}" + @packages.reject! { |p| addon_pkgs.include?(p.name) } + log.info "Using #{@packages.size} packages: #{@packages.map(&:name)}" @packages end @@ -252,8 +252,7 @@ # # @return [Boolean] true if the repository is empty; false otherwise. def empty? - candidates = Yast::Pkg.ResolvableProperties("", :package, "") - candidates.none? { |p| p["source"] == repo_id } + !Y2Packager::Resolvable.any?(kind: :package, source: repo_id) end # Returns whether is a user defined repository @@ -285,7 +284,7 @@ # Fetch and build a squashfs filesytem for a given package # - # @param package [Hash] Package to retrieve + # @param package [Y2Packager::Resolvable] Package to retrieve # @param dir [Pathname] Path to store the squashed filesystems # @return [Pathname] Path where the file is stored # @@ -294,10 +293,10 @@ # # @raise PackageNotFound def fetch_package(package, dir) - tempfile = Tempfile.new(package["name"]) + tempfile = Tempfile.new(package.name) tempfile.close Dir.mktmpdir do |workdir| - downloader = Packages::PackageDownloader.new(repo_id, package["name"]) + downloader = Packages::PackageDownloader.new(repo_id, package.name) downloader.download(tempfile.path.to_s) extractor = Packages::PackageExtractor.new(tempfile.path.to_s) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-4.2.23/src/modules/ImageInstallation.rb new/yast2-installation-4.2.25/src/modules/ImageInstallation.rb --- old/yast2-installation-4.2.23/src/modules/ImageInstallation.rb 2019-11-15 11:43:06.000000000 +0100 +++ new/yast2-installation-4.2.25/src/modules/ImageInstallation.rb 2019-11-27 15:10:40.000000000 +0100 @@ -20,7 +20,7 @@ # ------------------------------------------------------------------------------ # File: -# ImageInstallation.ycp +# ImageInstallation.rb # # Module: # ImageInstallation @@ -33,6 +33,7 @@ # Lukas Ocilka <[email protected]> # require "yast" +require "y2packager/resolvable" module Yast class ImageInstallationClass < Module @@ -108,8 +109,6 @@ # Defines whether some installation images are available @image_installation_available = nil - @debug_mode = nil - @tar_image_progress = nil @download_image_progress = nil @@ -167,18 +166,6 @@ nil end - def ThisIsADebugMode - if @debug_mode.nil? - @debug_mode = ProductFeatures.GetBooleanFeature( - "globals", - "debug_deploying" - ) == true - Builtins.y2milestone("ImageInstallation debug mode: %1", @debug_mode) - end - - @debug_mode - end - # Order of images to be deployed # @return a list of images definint the order def ImageOrder @@ -1223,44 +1210,39 @@ # status is `installed, `removed, `selected or `available, source is source ID or -1 if the resolvable is installed in the target # if status is `available and locked is true then the object is set to taboo # if status is `installed and locked is true then the object locked - resolvable_properties = Pkg.ResolvableProperties("", one_type, "") - # FIXME: Store only those keys we need (arch, name, version?) + resolvable_properties = Y2Packager::Resolvable.find(kind: one_type) Ops.set(@objects_state, one_type, {}) remove_resolvables = Builtins.filter(resolvable_properties) do |one_object| - Ops.get_symbol(one_object, "status", :unknown) == :removed + one_object.status == :removed end Ops.set(@objects_state, [one_type, "remove"], remove_resolvables) @generic_set_progress.call(id, nil) if !@generic_set_progress.nil? install_resolvables = Builtins.filter(resolvable_properties) do |one_object| - Ops.get_symbol(one_object, "status", :unknown) == :selected + one_object.status == :selected end Ops.set(@objects_state, [one_type, "install"], install_resolvables) @generic_set_progress.call(id, nil) if !@generic_set_progress.nil? taboo_resolvables = Builtins.filter(resolvable_properties) do |one_object| - Ops.get_symbol(one_object, "status", :unknown) == :available && - Ops.get_boolean(one_object, "locked", false) == true + one_object.status == :available && + one_object.locked end Ops.set(@objects_state, [one_type, "taboo"], taboo_resolvables) @generic_set_progress.call(id, nil) if !@generic_set_progress.nil? lock_resolvables = Builtins.filter(resolvable_properties) do |one_object| - Ops.get_symbol(one_object, "status", :unknown) == :installed && - Ops.get_boolean(one_object, "locked", false) == true + one_object.status == :installed && + one_object.locked end Ops.set(@objects_state, [one_type, "lock"], lock_resolvables) @generic_set_progress.call(id, nil) if !@generic_set_progress.nil? end - if ThisIsADebugMode() - # map <symbol, map <string, list <map> > > objects_state = $[]; - Builtins.foreach(@objects_state) do |object_type, objects_status| - Builtins.foreach(objects_status) do |one_status, list_of_objects| - Builtins.y2milestone( - "Object type: %1, New status: %2, List of objects: %3", - object_type, - one_status, - list_of_objects - ) - end + # map <symbol, map <string, list <map> > > objects_state = $[]; + Builtins.foreach(@objects_state) do |object_type, objects_status| + Builtins.foreach(objects_status) do |one_status, list_of_objects| + log.debug( + "Object type: #{object_type}, New status: #{one_status},"\ + "List of objects: #{list_of_objects}" + ) end end @@ -1273,29 +1255,15 @@ arch = Ops.get_string(one_object.value, "arch", "") # Query for all packages of the same version - resolvable_properties = Pkg.ResolvableProperties( - Ops.get_string(one_object.value, "name", "-x-"), - one_type.value, - Ops.get_string(one_object.value, "version", "-x-") + resolvable_properties = Y2Packager::Resolvable.find( + kind: one_type.value, + name: one_object.value.name, + version: one_object.value.version, + status: :installed, + arch: arch ) - if ThisIsADebugMode() - Builtins.y2milestone( - "Looking for %1 returned %2", - one_object.value, - resolvable_properties - ) - end - - # Leave only already installed (and matching the same architecture) - resolvable_properties = Builtins.filter(resolvable_properties) do |one_resolvable| - Ops.get_symbol(one_resolvable, "status", :unknown) == :installed && - Ops.get_string(one_resolvable, "arch", "") == arch - end - - if ThisIsADebugMode() - Builtins.y2milestone("Resolvables installed: %1", resolvable_properties) - end + log.debug("Resolvables installed: #{resolvable_properties.map(&:name)}") ret = nil @@ -1349,28 +1317,26 @@ @generic_set_progress.call(id, 0) if !@generic_set_progress.nil? Builtins.foreach(@all_supported_types) do |one_type| - resolvable_properties = Pkg.ResolvableProperties("", one_type, "") + resolvable_properties = Y2Packager::Resolvable.find(kind: one_type) # All packages selected for installation # both `to-install and `to-upgrade (already) installed to_install = Builtins.filter(resolvable_properties) do |one_resolvable| - Ops.get_symbol(one_resolvable, "status", :unknown) == :selected + one_resolvable.status == :selected end @generic_set_progress.call(id, nil) if !@generic_set_progress.nil? # List of all packages selected for installation (just names) selected_for_installation_pkgnames = Builtins.maplist( - Ops.get(@objects_state, [one_type, "install"], []) - ) do |one_resolvable| - Ops.get_string(one_resolvable, "name", "") - end + Ops.get(@objects_state, [one_type, "install"], []), &:name + ) # All packages selected to be installed # [ $[ "arch" : ... , "name" : ... , "version" : ... ], ... ] selected_for_installation = Builtins.maplist( Ops.get(@objects_state, [one_type, "install"], []) ) do |one_resolvable| { - "arch" => Ops.get_string(one_resolvable, "arch", ""), - "name" => Ops.get_string(one_resolvable, "name", ""), - "version" => Ops.get_string(one_resolvable, "version", "") + "arch" => one_resolvable.arch, + "name" => one_resolvable.name, + "version" => one_resolvable.version } end @generic_set_progress.call(id, nil) if !@generic_set_progress.nil? @@ -1378,14 +1344,14 @@ one_already_installed_resolvable = {} Builtins.foreach(resolvable_properties) do |one_resolvable| # We are interested in the already installed resolvables only - if Ops.get_symbol(one_resolvable, "status", :unknown) != :installed && - Ops.get_symbol(one_resolvable, "status", :unknown) != :selected + if one_resolvable.status != :installed && + one_resolvable.status != :selected next end one_already_installed_resolvable = { - "arch" => Ops.get_string(one_resolvable, "arch", ""), - "name" => Ops.get_string(one_resolvable, "name", ""), - "version" => Ops.get_string(one_resolvable, "version", "") + "arch" => one_resolvable.arch, + "name" => one_resolvable.name, + "version" => one_resolvable.version } # Already installed resolvable but not in list of resolvables to be installed if !Builtins.contains( @@ -1396,24 +1362,24 @@ # It will be upgraded later if Builtins.contains( selected_for_installation_pkgnames, - Ops.get_string(one_resolvable, "name", "-x-") + one_resolvable.name ) Builtins.y2milestone( "Not Removing type: %1, name: %2 version: %3", one_type, - Ops.get_string(one_resolvable, "name", "-x-"), - Ops.get_string(one_resolvable, "version", "-x-") + one_resolvable.name, + one_resolvable.version ) # Package is installed or selected but should not be, remove it else Builtins.y2milestone( "Removing type: %1, name: %2 version: %3", one_type, - Ops.get_string(one_resolvable, "name", "-x-"), - Ops.get_string(one_resolvable, "version", "-x-") + one_resolvable.name, + one_resolvable.version ) Pkg.ResolvableRemove( - Ops.get_string(one_resolvable, "name", "-x-"), + one_resolvable.name, one_type ) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-4.2.23/test/copy_files_finish_test.rb new/yast2-installation-4.2.25/test/copy_files_finish_test.rb --- old/yast2-installation-4.2.23/test/copy_files_finish_test.rb 2019-11-15 11:43:06.000000000 +0100 +++ new/yast2-installation-4.2.25/test/copy_files_finish_test.rb 2019-11-27 15:10:40.000000000 +0100 @@ -148,14 +148,6 @@ subject.write end - it "deletes install.inf if second stage is not required" do - allow(Yast::InstFunctions).to receive(:second_stage_required?).and_return(false) - - expect(::FileUtils).to receive(:rm).with("/etc/install.inf") - - subject.write - end - it "copies control.xml" do allow(::FileUtils).to receive(:cp) allow(Yast::ProductControl).to receive(:current_control_file).and_return("/control.xml") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-4.2.23/test/lib/clients/inst_extrasources_test.rb new/yast2-installation-4.2.25/test/lib/clients/inst_extrasources_test.rb --- old/yast2-installation-4.2.23/test/lib/clients/inst_extrasources_test.rb 2019-11-15 11:43:06.000000000 +0100 +++ new/yast2-installation-4.2.25/test/lib/clients/inst_extrasources_test.rb 2019-11-27 15:10:40.000000000 +0100 @@ -8,9 +8,12 @@ it "returns available package updates" do source = 42 expect(Yast::Pkg).to receive(:GetPackages).and_return(["foo"]) - expect(Yast::Pkg).to receive(:ResolvableProperties).with("foo", :package, "") - .and_return(["name" => "foo", "version" => "1.0", "arch" => "x86_64", - "status" => :selected, "source" => source]) + expect(Y2Packager::Resolvable).to receive(:find) + .with(kind: :package, name: "foo", status: :selected) + .and_return([Y2Packager::Resolvable.new( + "kind" => :package, "name" => "foo", "version" => "1.0", "arch" => "x86_64", + "status" => :selected, "source" => source + )]) expect(subject.UpgradesAvailable([source])).to eq("packages" => ["foo-1.0.x86_64"], "repositories" => [source]) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-4.2.23/test/lib/inst_modules_extensions_test.rb new/yast2-installation-4.2.25/test/lib/inst_modules_extensions_test.rb --- old/yast2-installation-4.2.23/test/lib/inst_modules_extensions_test.rb 2019-11-15 11:43:06.000000000 +0100 +++ new/yast2-installation-4.2.25/test/lib/inst_modules_extensions_test.rb 2019-11-27 15:10:40.000000000 +0100 @@ -5,18 +5,18 @@ describe ::Installation::Clients::InstModulesExtensions do describe "#run" do - let(:deps_package_a) { [{ "deps" => [{ "provides" => "installer_module_extension() = module_a" }] }] } - let(:deps_package_b) { [{ "deps" => [{ "provides" => "installer_module_extension() = module_b" }] }] } + let(:deps_package_a) { { "deps" => [{ "provides" => "installer_module_extension() = module_a" }] } } + let(:deps_package_b) { { "deps" => [{ "provides" => "installer_module_extension() = module_b" }] } } let(:product) { Y2Packager::Product.new(name: "SLES") } before do allow(Yast::Pkg).to receive(:PkgQueryProvides).and_return([["package_a"], ["package_b"]]) - allow(Yast::Pkg).to receive(:ResolvableDependencies).with("package_a", :package, "") - .and_return(deps_package_a) + allow(Y2Packager::Resolvable).to receive(:find).with(kind: :package, name: "package_a") + .and_return([Y2Packager::Resolvable.new(deps_package_a)]) - allow(Yast::Pkg).to receive(:ResolvableDependencies).with("package_b", :package, "") - .and_return(deps_package_b) + allow(Y2Packager::Resolvable).to receive(:find).with(kind: :package, name: "package_b") + .and_return([Y2Packager::Resolvable.new(deps_package_b)]) allow(Yast::WorkflowManager).to receive(:merge_modules_extensions) @@ -43,12 +43,12 @@ context "when all roles are specified for a different product" do let(:deps_package_a) do - [{ "deps" => [{ "provides" => "installer_module_extension() = module_b" }, - { "provides" => "extension_for_product() = SLED" }] }] + { "deps" => [{ "provides" => "installer_module_extension() = module_b" }, + { "provides" => "extension_for_product() = SLED" }] } end let(:deps_package_b) do - [{ "deps" => [{ "provides" => "installer_module_extension() = module_a" }, - { "provides" => "extension_for_product() = SLED" }] }] + { "deps" => [{ "provides" => "installer_module_extension() = module_a" }, + { "provides" => "extension_for_product() = SLED" }] } end it "does not merge installation workflow for the module extension packages" do @@ -60,8 +60,8 @@ context "when only one role is specified for a different product" do let(:deps_package_a) do - [{ "deps" => [{ "provides" => "installer_module_extension() = module_b" }, - { "provides" => "extension_for_product() = SLED" }] }] + { "deps" => [{ "provides" => "installer_module_extension() = module_b" }, + { "provides" => "extension_for_product() = SLED" }] } end it "merges installation workflow for the other module extension packages" do @@ -73,12 +73,12 @@ context "when all roles are specified only for the current product" do let(:deps_package_a) do - [{ "deps" => [{ "provides" => "installer_module_extension() = module_b" }, - { "provides" => "extension_for_product() = SLES" }] }] + { "deps" => [{ "provides" => "installer_module_extension() = module_b" }, + { "provides" => "extension_for_product() = SLES" }] } end let(:deps_package_b) do - [{ "deps" => [{ "provides" => "installer_module_extension() = module_a" }, - { "provides" => "extension_for_product() = SLES" }] }] + { "deps" => [{ "provides" => "installer_module_extension() = module_a" }, + { "provides" => "extension_for_product() = SLES" }] } end it "merges installation workflow for all module extension packages" do @@ -90,14 +90,14 @@ context "when all roles are specified for multiple products, including the current one" do let(:deps_package_a) do - [{ "deps" => [{ "provides" => "installer_module_extension() = module_b" }, - { "provides" => "extension_for_product() = SLES" }, - { "provides" => "extension_for_product() = SLED" }] }] + { "deps" => [{ "provides" => "installer_module_extension() = module_b" }, + { "provides" => "extension_for_product() = SLES" }, + { "provides" => "extension_for_product() = SLED" }] } end let(:deps_package_b) do - [{ "deps" => [{ "provides" => "installer_module_extension() = module_a" }, - { "provides" => "extension_for_product() = SLED" }, - { "provides" => "extension_for_product() = SLES" }] }] + { "deps" => [{ "provides" => "installer_module_extension() = module_a" }, + { "provides" => "extension_for_product() = SLED" }, + { "provides" => "extension_for_product() = SLES" }] } end it "merges installation workflow for all module extension packages" do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-4.2.23/test/update_repository_test.rb new/yast2-installation-4.2.25/test/update_repository_test.rb --- old/yast2-installation-4.2.23/test/update_repository_test.rb 2019-11-15 11:43:06.000000000 +0100 +++ new/yast2-installation-4.2.25/test/update_repository_test.rb 2019-11-27 15:10:40.000000000 +0100 @@ -34,16 +34,22 @@ after { FileUtils.rm_rf(TEMP_DIR) } let(:package) do - { "name" => "pkg1", "path" => "./x86_64/pkg1-3.1.x86_64.rpm", "source" => repo_id } + Y2Packager::Resolvable.new("name" => "pkg1", "path" => "./x86_64/pkg1-3.1.x86_64.rpm", "source" => repo_id) + end + + let(:other_package) do + Y2Packager::Resolvable.new("name" => "pkg0", "path" => "./x86_64/pkg0-3.1.x86_64.rpm", "source" => repo_id) end let(:from_other_repo) do - { "name" => "pkg2", "path" => "./x86_64/pkg2-3.1.x86_64.rpm", "source" => repo_id + 1 } + Y2Packager::Resolvable.new("name" => "pkg2", "path" => "./x86_64/pkg2-3.1.x86_64.rpm", "source" => repo_id + 1) end before do - allow(Yast::Pkg).to receive(:ResolvableProperties).with("", :package, "") - .and_return(packages) + allow(Y2Packager::Resolvable).to receive(:find).with(kind: :package, source: repo_id) + .and_return([other_package, package]) + allow(Y2Packager::Resolvable).to receive(:find).with(kind: :package, source: repo_id + 1) + .and_return([from_other_repo]) end context "when the repository type can't be determined" do @@ -76,22 +82,16 @@ end context "when the repo does not have packages" do - let(:packages) { [from_other_repo] } - it "returns an empty array" do + expect(Y2Packager::Resolvable).to receive(:find).with(kind: :package, source: repo_id) + .and_return([]) expect(repo.packages).to eq([]) end end context "when the source contains packages" do - let(:other_package) do - { "name" => "pkg0", "path" => "./x86_64/pkg0-3.1.x86_64.rpm", "source" => repo_id } - end - - let(:packages) { [package, from_other_repo, other_package] } - it "returns update repository packages sorted by name" do - expect(repo.packages).to eq([other_package, package]) + expect(repo.packages.map(&:name)).to eq([other_package.name, package.name]) end end end @@ -104,7 +104,7 @@ end let(:package) do - { "name" => "pkg1", "path" => "./x86_64/pkg1-3.1.x86_64.rpm", "source" => repo_id } + Y2Packager::Resolvable.new("name" => "pkg1", "path" => "./x86_64/pkg1-3.1.x86_64.rpm", "source" => repo_id) end let(:libzypp_package_path) { "/var/adm/tmp/pkg1-3.1.x86_64.rpm" } @@ -117,7 +117,7 @@ allow(repo).to receive(:add_repo).and_return(repo_id) allow(repo).to receive(:packages).and_return([package]) allow(Dir).to receive(:mktmpdir).and_yield(tmpdir.to_s) - allow(Packages::PackageDownloader).to receive(:new).with(repo_id, package["name"]).and_return(downloader) + allow(Packages::PackageDownloader).to receive(:new).with(repo_id, package.name).and_return(downloader) allow(Packages::PackageExtractor).to receive(:new).with(tempfile.path.to_s).and_return(extractor) allow(Tempfile).to receive(:new).and_return(tempfile) end
