Skip to content

Commit

Permalink
Allow overriding of install repos Issue#1474
Browse files Browse the repository at this point in the history
* Use agama.install_url=https://.. boot param
  • Loading branch information
lkocman committed Aug 19, 2024
1 parent 5f2b96b commit a0238f8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
19 changes: 15 additions & 4 deletions service/lib/agama/software/product_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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<Agama::Product>]
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

Expand All @@ -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]
Expand Down
6 changes: 6 additions & 0 deletions service/package/rubygem-agama-yast.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Aug 19 15:13:46 UTC 2024 - Lubos Kocman <[email protected]>

- 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 <[email protected]>

Expand Down

0 comments on commit a0238f8

Please sign in to comment.