Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not consider the arch when filtering the config #691

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions service/package/rubygem-agama.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Aug 7 10:52:35 UTC 2023 - Imobach Gonzalez Sosa <[email protected]>

- Do not consider the architecture when filtering the configuration
file through the filter-config.rb script (gh#openSUSE/agama#691).

-------------------------------------------------------------------
Wed Aug 2 10:03:13 UTC 2023 - Imobach Gonzalez Sosa <[email protected]>

Expand Down
10 changes: 5 additions & 5 deletions service/share/filter-config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@
exit(2)
end

config = Agama::Config.from_file(path)
config = YAML.load_file(path)

unknown_products = product_ids - config.products.keys
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]) }
keys_to_filter = (["products"] + config["products"].keys) - product_ids
products = product_ids.reduce({}) { |all, id| all.merge(id => config["products"][id]) }
new_config = { "products" => products }
new_config.merge!(config.pure_data.reject { |k, _v| keys_to_filter.include?(k) })
new_config.merge!(config.reject { |k, _v| keys_to_filter.include?(k) })
puts YAML.dump(new_config)