-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #485 from yast/add-alp-products
Add ALP products
- Loading branch information
Showing
3 changed files
with
121 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
------------------------------------------------------------------- | ||
Tue Mar 21 11:42:51 UTC 2023 - Imobach Gonzalez Sosa <[email protected]> | ||
|
||
- Update the products definitions (gh#yast/d-installer#485): | ||
* Replace "ALP" with "ALP Bedrock" and "ALP Micro". | ||
* Drop Leap 15.4 and Leap Micro 5.3. | ||
- Add a script to auto-generate the configuration file when | ||
building the ISO. | ||
|
||
------------------------------------------------------------------- | ||
Thu Mar 16 16:13:21 UTC 2023 - Imobach Gonzalez Sosa <[email protected]> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
# Copyright (c) [2023] SUSE LLC | ||
# | ||
# All Rights Reserved. | ||
# | ||
# This program is free software; you can redistribute it and/or modify it | ||
# under the terms of version 2 of the GNU General Public License as published | ||
# by the Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
# more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along | ||
# with this program; if not, contact SUSE LLC. | ||
# | ||
# To contact SUSE LLC about this file by physical or electronic mail, you may | ||
# find current contact information at www.suse.com. | ||
|
||
# Helper script to create a configuration file for a selected list of products. | ||
# | ||
# filter-config.rb /etc/d-installer.yaml ALP-Bedrock ALP-Micro | ||
|
||
require "yast" | ||
require "dinstaller/config" | ||
require "yaml" | ||
|
||
if ARGV.size < 2 | ||
warn("Please, specify a file and, at least, a product ID") | ||
exit(1) | ||
end | ||
|
||
path = ARGV[0] | ||
product_ids = ARGV[1..-1] | ||
|
||
unless File.exist?(path) | ||
warn("The specified file does not exist: #{path}") | ||
exit(2) | ||
end | ||
|
||
config = DInstaller::Config.from_file(path) | ||
|
||
unknown_products = product_ids - config.products.keys | ||
unless unknown_products.empty? | ||
warn(format("The following products are unknown: %{products}.", | ||
products: unknown_products.join(", "))) | ||
exit(3) | ||
end | ||
|
||
keys_to_filter = (["products"] + config.products.keys) - product_ids | ||
products = product_ids.reduce({}) { |all, id| all.merge(id => config.data["products"][id]) } | ||
new_config = { "products" => products } | ||
new_config.merge!(config.pure_data.reject { |k, _v| keys_to_filter.include?(k) }) | ||
puts YAML.dump(new_config) |