Skip to content

Commit

Permalink
Merge pull request #691 from imobachgs/fix-filter-config
Browse files Browse the repository at this point in the history
Do not consider the arch when filtering the config
  • Loading branch information
imobachgs authored Aug 7, 2023
2 parents d0834ac + bc2f53b commit 050ed9d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
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)

0 comments on commit 050ed9d

Please sign in to comment.