From a0238f8a4ccf588953b895f72102496088e30e89 Mon Sep 17 00:00:00 2001 From: Lubos Kocman Date: Mon, 19 Aug 2024 17:07:32 +0200 Subject: [PATCH] Allow overriding of install repos Issue#1474 * Use agama.install_url=https://.. boot param --- service/lib/agama/software/product_builder.rb | 19 +++++++++++++++---- service/package/rubygem-agama-yast.changes | 6 ++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/service/lib/agama/software/product_builder.rb b/service/lib/agama/software/product_builder.rb index 465e2107fd..921b193593 100644 --- a/service/lib/agama/software/product_builder.rb +++ b/service/lib/agama/software/product_builder.rb @@ -19,24 +19,29 @@ # To contact SUSE LLC about this file by physical or electronic mail, you may # find current contact information at www.suse.com. +require "agama/cmdline_args" require "agama/software/product" +require "logger" module Agama module Software # Builds products from the information of a config file. class ProductBuilder # @param config [Agama::Config] - def initialize(config) + def initialize(config, logger: Logger.new($stdout)) @config = config + @logger = logger end # Builds the products. # # @return [Array] def build + cmdline_args = CmdlineArgs.read_from("/proc/cmdline") + @logger.info cmdline_args config.products.map do |id, attrs| data = product_data_from_config(id) - create_product(id, data, attrs) + create_product(id, data, attrs, cmdline_args) end end @@ -45,13 +50,19 @@ def build # @return [Agama::Config] attr_reader :config - def create_product(id, data, attrs) + def create_product(id, data, attrs, cmdline_args) Agama::Software::Product.new(id).tap do |product| product.display_name = attrs["name"] product.description = attrs["description"] product.name = data[:name] product.version = data[:version] - product.repositories = data[:repositories] + # Issue#1474 Use agama.install_url=https://path-to-repodata + if cmdline_args.data.has_key?("install_url") + @logger.info "Overriding default installation as args.install_url boot param is set to " + cmdline_args.data["install_url"] + product.repositories = [cmdline_args.data["install_url"],] + else + product.repositories = data[:repositories] + end product.labels = data[:labels] product.mandatory_packages = data[:mandatory_packages] product.optional_packages = data[:optional_packages] diff --git a/service/package/rubygem-agama-yast.changes b/service/package/rubygem-agama-yast.changes index d8d690db2a..ac41cda055 100644 --- a/service/package/rubygem-agama-yast.changes +++ b/service/package/rubygem-agama-yast.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Aug 19 15:13:46 UTC 2024 - Lubos Kocman + +- Allow overriding of install repos which is needed by openQA +- Override urls by using agama.install_url=https://.. boot param + ------------------------------------------------------------------- Mon Aug 12 11:44:15 UTC 2024 - Josef Reidinger