Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rubygem-agama-yast for openSUSE:Factory checked in at 2025-08-13 16:29:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-agama-yast (Old) and /work/SRC/openSUSE:Factory/.rubygem-agama-yast.new.1085 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-agama-yast" Wed Aug 13 16:29:23 2025 rev:26 rq:1299041 version:17.devel204.d05c5a9b3 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-agama-yast/rubygem-agama-yast.changes 2025-07-31 17:45:48.787187885 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-agama-yast.new.1085/rubygem-agama-yast.changes 2025-08-13 16:31:18.926404959 +0200 @@ -1,0 +2,24 @@ +Thu Aug 7 10:57:30 UTC 2025 - José Iván López González <jlo...@suse.com> + +- Do not use 'retry' as default answer for questions (bsc#1247436). + +------------------------------------------------------------------- +Wed Aug 6 12:47:13 UTC 2025 - José Iván López González <jlo...@suse.com> + +- Emit D-Bus signal when storage is configured, including the + client id (gh#agama-project/agama#2640). + +------------------------------------------------------------------- +Tue Aug 5 14:01:23 UTC 2025 - José Iván López González <jlo...@suse.com> + +- Fix MD RAID config checker to avoid generating a list of issues + including a false value (bsc#1247557, bsc#1247585). + +------------------------------------------------------------------- +Thu Jul 31 07:34:52 UTC 2025 - Josef Reidinger <jreidin...@suse.com> + +- Do not set selinux policy during installation and lets keep + defaults provided by packages + (bsc#1247046) + +------------------------------------------------------------------- Old: ---- agama-yast-17.devel37.571bbc676.gem New: ---- agama-yast-17.devel204.d05c5a9b3.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ agama-yast.spec ++++++ --- /var/tmp/diff_new_pack.Xgxiqw/_old 2025-08-13 16:31:19.978448936 +0200 +++ /var/tmp/diff_new_pack.Xgxiqw/_new 2025-08-13 16:31:19.982449103 +0200 @@ -1,7 +1,7 @@ # # spec file for package agama-yast # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2025 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: agama-yast -Version: 17.devel37.571bbc676 +Version: 17.devel204.d05c5a9b3 Release: 0 %define mod_name agama-yast %define mod_full_name %{mod_name}-%{version} ++++++ rubygem-agama-yast.spec ++++++ --- /var/tmp/diff_new_pack.Xgxiqw/_old 2025-08-13 16:31:20.026450942 +0200 +++ /var/tmp/diff_new_pack.Xgxiqw/_new 2025-08-13 16:31:20.026450942 +0200 @@ -1,7 +1,7 @@ # # spec file for package rubygem-agama-yast # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2025 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,7 @@ # Name: rubygem-agama-yast -Version: 17.devel37.571bbc676 +Version: 17.devel204.d05c5a9b3 Release: 0 %define mod_name agama-yast %define mod_full_name %{mod_name}-%{version} ++++++ agama-yast-17.devel37.571bbc676.gem -> agama-yast-17.devel204.d05c5a9b3.gem ++++++ Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/agama/dbus/base_object.rb new/lib/agama/dbus/base_object.rb --- old/lib/agama/dbus/base_object.rb 1980-01-02 01:00:00.000000000 +0100 +++ new/lib/agama/dbus/base_object.rb 1980-01-02 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ # frozen_string_literal: true -# Copyright (c) [2021] SUSE LLC +# Copyright (c) [2021-2025] SUSE LLC # # All Rights Reserved. # @@ -38,6 +38,27 @@ # @return [Logger] attr_reader :logger + + # Extra data provided to the D-Bus call (e.g., the client_id requesting the action). + # + # @return [Hash] + def request_data + @request_data ||= {} + end + + # Executes a block ensuring the given request data is available during the process. + # + # Saving the request data is needed in order to have it available while emitting signals as + # part of the block execution. + # + # @param data [Hash] Extra data, see {#request_data}. + # @param block [Proc] + def request(data = {}, &block) + @request_data = data + block.call + ensure + @request_data = {} + end end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/agama/dbus/clients/storage.rb new/lib/agama/dbus/clients/storage.rb --- old/lib/agama/dbus/clients/storage.rb 1980-01-02 01:00:00.000000000 +0100 +++ new/lib/agama/dbus/clients/storage.rb 1980-01-02 01:00:00.000000000 +0100 @@ -48,14 +48,17 @@ # If a block is given, the method returns immediately and the probing is performed in an # asynchronous way. # + # @param data [Hash] Extra data provided to the D-Bus call. # @param done [Proc] Block to execute once the probing is done - def probe(&done) - dbus_object[STORAGE_IFACE].Probe(&done) + def probe(data = {}, &done) + dbus_object[STORAGE_IFACE].Probe(data, &done) end # Reprobes (keeps the current settings). - def reprobe - dbus_object.Reprobe + # + # @param data [Hash] Extra data provided to the D-Bus call. + def reprobe(data = {}) + dbus_object.Reprobe(data) end # Performs the packages installation diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/agama/dbus/manager.rb new/lib/agama/dbus/manager.rb --- old/lib/agama/dbus/manager.rb 1980-01-02 01:00:00.000000000 +0100 +++ new/lib/agama/dbus/manager.rb 1980-01-02 01:00:00.000000000 +0100 @@ -63,8 +63,8 @@ FINISH_PHASE = 3 dbus_interface MANAGER_INTERFACE do - dbus_method(:Probe, "") { config_phase } - dbus_method(:Reprobe, "") { config_phase(reprobe: true) } + dbus_method(:Probe, "in data:a{sv}") { |data| config_phase(data: data) } + dbus_method(:Reprobe, "in data:a{sv}") { |data| config_phase(reprobe: true, data: data) } dbus_method(:Commit, "") { install_phase } dbus_method(:CanInstall, "out result:b") { can_install? } dbus_method(:CollectLogs, "out tarball_filesystem_path:s") { collect_logs } @@ -76,9 +76,12 @@ end # Runs the config phase - def config_phase(reprobe: false) + # + # @param reprobe [Boolean] Whether a reprobe should be done instead of a probe. + # @param data [Hash] Extra data provided to the D-Bus calls. + def config_phase(reprobe: false, data: {}) safe_run do - busy_while { backend.config_phase(reprobe: reprobe) } + busy_while { backend.config_phase(reprobe: reprobe, data: data) } end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/agama/dbus/storage/manager.rb new/lib/agama/dbus/storage/manager.rb --- old/lib/agama/dbus/storage/manager.rb 1980-01-02 01:00:00.000000000 +0100 +++ new/lib/agama/dbus/storage/manager.rb 1980-01-02 01:00:00.000000000 +0100 @@ -35,6 +35,7 @@ require "agama/dbus/storage/volume_conversion" require "agama/dbus/with_progress" require "agama/dbus/with_service_status" +require "agama/storage/config_conversions" require "agama/storage/encryption_settings" require "agama/storage/proposal_settings" require "agama/storage/volume_templates_builder" @@ -70,7 +71,6 @@ @actions = read_actions register_storage_callbacks - register_proposal_callbacks register_progress_callbacks register_service_status_callbacks register_iscsi_callbacks @@ -120,19 +120,34 @@ # @return [Integer] 0 success; 1 error def apply_config(serialized_config) logger.info("Setting storage config from D-Bus: #{serialized_config}") - config_json = JSON.parse(serialized_config, symbolize_names: true) - proposal.calculate_from_json(config_json) - proposal.success? ? 0 : 1 + configure(config_json) + end + + # Applies the given serialized config model according to the JSON schema. + # + # @param serialized_model [String] Serialized storage config model. + # @return [Integer] 0 success; 1 error + def apply_config_model(serialized_model) + logger.info("Setting storage config model from D-Bus: #{serialized_model}") + + model_json = JSON.parse(serialized_model, symbolize_names: true) + config = Agama::Storage::ConfigConversions::FromModel.new( + model_json, + product_config: product_config, + storage_system: proposal.storage_system + ).convert + config_json = { storage: Agama::Storage::ConfigConversions::ToJSON.new(config).convert } + + configure(config_json) end - # Calculates the initial proposal. + # Resets to the default config. # # @return [Integer] 0 success; 1 error def reset_config logger.info("Reset storage config from D-Bus") - backend.calculate_proposal - backend.proposal.success? ? 0 : 1 + configure end # Gets and serializes the storage config used for calculating the current proposal. @@ -143,18 +158,6 @@ JSON.pretty_generate(json) end - # Applies the given serialized config model according to the JSON schema. - # - # @param serialized_model [String] Serialized storage config model. - # @return [Integer] 0 success; 1 error - def apply_config_model(serialized_model) - logger.info("Setting storage config model from D-Bus: #{serialized_model}") - - model_json = JSON.parse(serialized_model, symbolize_names: true) - proposal.calculate_from_model(model_json) - proposal.success? ? 0 : 1 - end - # Gets and serializes the storage config model. # # @return [String] @@ -195,19 +198,32 @@ # they should return whether the config was actually applied. # * Methods like #Probe or #Install return nothing. dbus_interface STORAGE_INTERFACE do - dbus_method(:Probe) { probe } - dbus_method(:Reprobe) { probe(keep_config: true) } - dbus_method(:Reactivate) { probe(keep_config: true, keep_activation: false) } - dbus_method(:SetConfig, "in serialized_config:s, out result:u") do |serialized_config| - busy_while { apply_config(serialized_config) } - end - dbus_method(:ResetConfig, "out result:u") do - busy_while { reset_config } + dbus_signal :Configured, "client_id:s" + dbus_method(:Probe, "in data:a{sv}") do |data| + busy_request(data) { probe } + end + dbus_method(:Reprobe, "in data:a{sv}") do |data| + busy_request(data) { probe(keep_config: true) } + end + dbus_method(:Reactivate, "in data:a{sv}") do |data| + busy_request(data) { probe(keep_config: true, keep_activation: false) } + end + dbus_method( + :SetConfig, + "in serialized_config:s, in data:a{sv}, out result:u" + ) do |serialized_config, data| + busy_request(data) { apply_config(serialized_config) } + end + dbus_method(:ResetConfig, "in data:a{sv}, out result:u") do |data| + busy_request(data) { reset_config } + end + dbus_method( + :SetConfigModel, + "in serialized_model:s, in data:a{sv}, out result:u" + ) do |serialized_model, data| + busy_request(data) { apply_config_model(serialized_model) } end dbus_method(:GetConfig, "out serialized_config:s") { recover_config } - dbus_method(:SetConfigModel, "in serialized_model:s, out result:u") do |serialized_model| - busy_while { apply_config_model(serialized_model) } - end dbus_method(:GetConfigModel, "out serialized_model:s") { recover_model } dbus_method(:SolveConfigModel, "in sparse_model:s, out solved_model:s") do |sparse_model| solve_model(sparse_model) @@ -312,8 +328,7 @@ end dbus_interface STORAGE_DEVICES_INTERFACE do - # PropertiesChanged signal if a proposal is calculated, see - # {#register_proposal_callbacks}. + # PropertiesChanged signal if storage is configured, see {#register_callbacks}. dbus_reader_attr_accessor :actions, "aa{sv}" dbus_reader :available_drives, "ao" @@ -333,7 +348,7 @@ logger.info("Calculating guided storage proposal from D-Bus: #{settings_dbus}") settings = ProposalSettingsConversion.from_dbus(settings_dbus, - config: config, logger: logger) + config: product_config, logger: logger) proposal.calculate_guided(settings) proposal.success? ? 0 : 1 @@ -471,6 +486,20 @@ # @return [DBus::Storage::Proposal, nil] attr_reader :dbus_proposal + # Configures storage. + # + # @param config_json [Hash, nil] Storage config according to the JSON schema. If nil, then + # the default config is applied. + # @return [Integer] 0 success; 1 error + def configure(config_json = nil) + success = backend.configure(config_json) + success ? 0 : 1 + end + + def send_configured_signal + self.Configured(request_data["client_id"].to_s) + end + def add_s390_interfaces require "agama/dbus/storage/interfaces/dasd_manager" require "agama/dbus/storage/interfaces/zfcp_manager" @@ -491,14 +520,12 @@ backend.on_issues_change { issues_properties_changed } backend.on_deprecated_system_change { storage_properties_changed } backend.on_probe { refresh_system_devices } - end - - def register_proposal_callbacks - proposal.on_calculate do + backend.on_configure do export_proposal proposal_properties_changed refresh_staging_devices update_actions + send_configured_signal end end @@ -594,13 +621,13 @@ end # @return [Agama::Config] - def config + def product_config backend.product_config end # @return [Agama::VolumeTemplatesBuilder] def volume_templates_builder - Agama::Storage::VolumeTemplatesBuilder.new_from_config(config) + Agama::Storage::VolumeTemplatesBuilder.new_from_config(product_config) end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/agama/dbus/with_service_status.rb new/lib/agama/dbus/with_service_status.rb --- old/lib/agama/dbus/with_service_status.rb 1980-01-02 01:00:00.000000000 +0100 +++ new/lib/agama/dbus/with_service_status.rb 1980-01-02 01:00:00.000000000 +0100 @@ -39,6 +39,14 @@ def busy_while(&block) service_status.busy_while(&block) end + + # Executes a block setting the service as busy, see {BaseObject#request}. + # + # @param data [Hash] see {BaseObject#request_data}. + # @param block [Proc] + def busy_request(data, &block) + busy_while { request(data, &block) } + end end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/agama/manager.rb new/lib/agama/manager.rb --- old/lib/agama/manager.rb 1980-01-02 01:00:00.000000000 +0100 +++ new/lib/agama/manager.rb 1980-01-02 01:00:00.000000000 +0100 @@ -91,10 +91,13 @@ end # Runs the config phase - def config_phase(reprobe: false) + # + # @param reprobe [Boolean] Whether a reprobe should be done instead of a probe. + # @param data [Hash] Extra data provided to the D-Bus calls. + def config_phase(reprobe: false, data: {}) installation_phase.config start_progress_with_descriptions(_("Analyze disks"), _("Configure software")) - progress.step { reprobe ? storage.reprobe : storage.probe } + progress.step { reprobe ? storage.reprobe(data) : storage.probe(data) } progress.step { software.probe } logger.info("Config phase done") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/agama/question.rb new/lib/agama/question.rb --- old/lib/agama/question.rb 1980-01-02 01:00:00.000000000 +0100 +++ new/lib/agama/question.rb 1980-01-02 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ # frozen_string_literal: true -# Copyright (c) [2022] SUSE LLC +# Copyright (c) [2022-2025] SUSE LLC # # All Rights Reserved. # @@ -45,7 +45,7 @@ # Default option to use as answer # - # @return [Symbol] + # @return [Symbol, nil] attr_reader :default_option # Answer of the question @@ -59,7 +59,7 @@ # @return [Hash<String,String>] attr_reader :data - def initialize(qclass:, text:, options:, default_option:, data: {}) + def initialize(qclass:, text:, options:, default_option: nil, data: {}) @qclass = qclass @text = text @options = options diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/agama/security.rb new/lib/agama/security.rb --- old/lib/agama/security.rb 1980-01-02 01:00:00.000000000 +0100 +++ new/lib/agama/security.rb 1980-01-02 01:00:00.000000000 +0100 @@ -25,6 +25,8 @@ require "agama/config" require "agama/http" +Yast.import "Bootloader" + # FIXME: monkey patching of security config to not read control.xml and # instead use Agama::Config # TODO: add ability to set product features in LSM::Base @@ -73,11 +75,18 @@ end def write + # at first clear previous kernel params + selected = lsm_selected + selected&.reset_kernel_params + candidate = select_software_lsm return unless candidate lsm_config.select(candidate) - lsm_config.save + kernel_params = lsm_selected.kernel_params + # write manually here to bootloader as lsm_config.save do more than agama wants (bsc#1247046) + @logger.info("Modifying Bootlooader kernel params using #{kernel_params}") + Yast::Bootloader.modify_kernel_params(kernel_params) end private diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/agama/software/callbacks/media.rb new/lib/agama/software/callbacks/media.rb --- old/lib/agama/software/callbacks/media.rb 1980-01-02 01:00:00.000000000 +0100 +++ new/lib/agama/software/callbacks/media.rb 1980-01-02 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ # frozen_string_literal: true -# Copyright (c) [2021-2023] SUSE LLC +# Copyright (c) [2021-2025] SUSE LLC # # All Rights Reserved. # @@ -99,11 +99,10 @@ end question = Agama::Question.new( - qclass: "software.package_error.medium_error", - text: error, - options: [retry_label.to_sym, continue_label.to_sym], - default_option: retry_label.to_sym, - data: { "url" => url } + qclass: "software.package_error.medium_error", + text: error, + options: [retry_label.to_sym, continue_label.to_sym], + data: { "url" => url } ) questions_client.ask(question) do |question_client| if question_client.answer == retry_label.to_sym diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/agama/software/callbacks/progress.rb new/lib/agama/software/callbacks/progress.rb --- old/lib/agama/software/callbacks/progress.rb 1980-01-02 01:00:00.000000000 +0100 +++ new/lib/agama/software/callbacks/progress.rb 1980-01-02 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ # frozen_string_literal: true -# Copyright (c) [2021] SUSE LLC +# Copyright (c) [2021-2025] SUSE LLC # # All Rights Reserved. # @@ -90,13 +90,12 @@ logger.error("Package #{current_package} failed: #{description}") question = Agama::Question.new( - qclass: "software.package_error.install_error", - text: description, + qclass: "software.package_error.install_error", + text: description, # FIXME: temporarily removed the "Abort" option until the final failed # state is handled properly - options: [retry_label.to_sym, continue_label.to_sym], - default_option: retry_label.to_sym, - data: { "package" => current_package } + options: [retry_label.to_sym, continue_label.to_sym], + data: { "package" => current_package } ) questions_client.ask(question) do |question_client| diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/agama/software/callbacks/provide.rb new/lib/agama/software/callbacks/provide.rb --- old/lib/agama/software/callbacks/provide.rb 1980-01-02 01:00:00.000000000 +0100 +++ new/lib/agama/software/callbacks/provide.rb 1980-01-02 01:00:00.000000000 +0100 @@ -68,11 +68,10 @@ return nil if error_code.nil? question = Agama::Question.new( - qclass: "software.package_error.provide_error", - text: reason, - options: [retry_label.to_sym, continue_label.to_sym], - default_option: retry_label.to_sym, - data: { "package" => name, "error_code" => error_code } + qclass: "software.package_error.provide_error", + text: reason, + options: [retry_label.to_sym, continue_label.to_sym], + data: { "package" => name, "error_code" => error_code } ) questions_client.ask(question) do |question_client| diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/agama/software/callbacks/script.rb new/lib/agama/software/callbacks/script.rb --- old/lib/agama/software/callbacks/script.rb 1980-01-02 01:00:00.000000000 +0100 +++ new/lib/agama/software/callbacks/script.rb 1980-01-02 01:00:00.000000000 +0100 @@ -21,6 +21,7 @@ require "yast" require "agama/question" +require "agama/software/callbacks/base" Yast.import "Pkg" @@ -28,19 +29,9 @@ module Software module Callbacks # Script callbacks - class Script + class Script < Base include Yast::I18n - # Constructor - # - # @param questions_client [Agama::DBus::Clients::Questions] - # @param logger [Logger] - def initialize(questions_client, logger) - textdomain "agama" - @questions_client = questions_client - @logger = logger - end - # Register the callbacks def setup Yast::Pkg.CallbackScriptProblem( @@ -58,14 +49,13 @@ message = _("There was a problem running a package script.") question = Agama::Question.new( - qclass: "software.script_problem", - text: message, - options: [:Retry, :Ignore], - default_option: :Retry, - data: { "details" => description } + qclass: "software.script_problem", + text: message, + options: [retry_label, continue_label], + data: { "details" => description } ) questions_client.ask(question) do |question_client| - (question_client.answer == :Retry) ? "R" : "I" + (question_client.answer == retry_label.to_sym) ? "R" : "I" end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/agama/storage/config_checkers/md_raid.rb new/lib/agama/storage/config_checkers/md_raid.rb --- old/lib/agama/storage/config_checkers/md_raid.rb 1980-01-02 01:00:00.000000000 +0100 +++ new/lib/agama/storage/config_checkers/md_raid.rb 1980-01-02 01:00:00.000000000 +0100 @@ -274,7 +274,7 @@ # @param device [Y2Storage::BlkDevice] # @return [Issue, nil] def parent_reused_member_issue(device) - return false unless device.respond_to?(:partitionable) + return unless device.respond_to?(:partitionable) parent_config = find_config(device.partitionable) return unless parent_config&.filesystem diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/agama/storage/config_conversions/to_json_conversions/size.rb new/lib/agama/storage/config_conversions/to_json_conversions/size.rb --- old/lib/agama/storage/config_conversions/to_json_conversions/size.rb 1980-01-02 01:00:00.000000000 +0100 +++ new/lib/agama/storage/config_conversions/to_json_conversions/size.rb 1980-01-02 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ # frozen_string_literal: true -# Copyright (c) [2024] SUSE LLC +# Copyright (c) [2024-2025] SUSE LLC # # All Rights Reserved. # @@ -33,6 +33,13 @@ @config = config end + # The size is not generated for default size. + # + # @see Base#convert + def convert + super unless config.default? + end + private # @see Base#conversions diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/agama/storage/manager.rb new/lib/agama/storage/manager.rb --- old/lib/agama/storage/manager.rb 1980-01-02 01:00:00.000000000 +0100 +++ new/lib/agama/storage/manager.rb 1980-01-02 01:00:00.000000000 +0100 @@ -70,7 +70,6 @@ @bootloader = Bootloader.new(logger) register_progress_callbacks - register_proposal_callbacks end # Whether the system is in a deprecated status @@ -115,6 +114,14 @@ @on_probe_callbacks << block end + # Registers a callback to be called when storage is configured. + # + # @param block [Proc] + def on_configure(&block) + @on_configure_callbacks ||= [] + @on_configure_callbacks << block + end + # Probes storage devices and performs an initial proposal # # @param keep_config [Boolean] Whether to use the current storage config for calculating the @@ -137,7 +144,10 @@ progress.step { activate_devices(keep_activation: keep_activation) } progress.step { probe_devices } - progress.step { calculate_proposal(keep_config: keep_config) } + progress.step do + config_json = proposal.storage_json if keep_config + configure(config_json) + end # The system is not deprecated anymore self.deprecated_system = false @@ -169,13 +179,16 @@ Finisher.new(logger, product_config, security).run end - # Calculates the proposal. + # Configures storage. # - # @param keep_config [Boolean] Whether to use the current storage config for calculating the - # proposal. If false, then the default config from the product is used. - def calculate_proposal(keep_config: false) - config_json = proposal.storage_json if keep_config - Configurator.new(proposal).configure(config_json) + # @param config_json [Hash, nil] Storage config according to the JSON schema. If nil, then + # the default config is applied. + # @return [Boolean] Whether storage was successfully configured. + def configure(config_json = nil) + result = Configurator.new(proposal).configure(config_json) + update_issues + @on_configure_callbacks&.each(&:call) + result end # Storage proposal manager @@ -245,11 +258,6 @@ on_progress_change { logger.info(progress.to_s) } end - # Issues are updated when the proposal is calculated - def register_proposal_callbacks - proposal.on_calculate { update_issues } - end - # Activates the devices, calling activation callbacks if needed # # @param keep_activation [Boolean] Whether to keep the current activation (e.g., provided LUKS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/agama/storage/proposal.rb new/lib/agama/storage/proposal.rb --- old/lib/agama/storage/proposal.rb 1980-01-02 01:00:00.000000000 +0100 +++ new/lib/agama/storage/proposal.rb 1980-01-02 01:00:00.000000000 +0100 @@ -46,7 +46,6 @@ @product_config = product_config @logger = logger || Logger.new($stdout) - @on_calculate_callbacks = [] end # Whether the proposal was already calculated. @@ -63,11 +62,6 @@ calculated? && !proposal.failed? && issues.none?(&:error?) end - # Stores callbacks to be called after calculating a proposal. - def on_calculate(&block) - @on_calculate_callbacks << block - end - # Default storage config according to the JSON schema. # # The default config depends on the target device. @@ -154,18 +148,6 @@ success? end - # Calculates a new proposal from a config model. - # - # @param model_json [Hash] Source config model according to the JSON schema. - # @return [Boolean] Whether the proposal successes. - def calculate_from_model(model_json) - config = ConfigConversions::FromModel - .new(model_json, product_config: product_config, storage_system: storage_system) - .convert - - calculate_agama(config) - end - # Calculates a new proposal using the guided strategy. # # @param settings [Agama::Storage::ProposalSettings] @@ -342,7 +324,6 @@ raise e end - @on_calculate_callbacks.each(&:call) success? end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 1980-01-02 01:00:00.000000000 +0100 +++ new/metadata 1980-01-02 01:00:00.000000000 +0100 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: agama-yast version: !ruby/object:Gem::Version - version: 17.devel37.571bbc676 + version: 17.devel204.d05c5a9b3 platform: ruby authors: - YaST Team ++++++ po.tar.bz2 ++++++