-
Notifications
You must be signed in to change notification settings - Fork 69
User Repositories: Adapt autoyast conversion #2458
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
Changes from 5 commits
74caa82
ab12ce2
f89721f
c4f74da
30ef5bb
25e70d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,12 +37,16 @@ def initialize(profile) | |
| # | ||
| # @return [Hash] Agama "software" section | ||
| def read | ||
| return {} if profile["software"].nil? | ||
|
|
||
| software = {} | ||
|
|
||
| software["patterns"] = profile["software"].fetch_as_array("patterns") | ||
| software["packages"] = profile["software"].fetch_as_array("packages") | ||
| if profile["software"] | ||
| software["patterns"] = profile["software"].fetch_as_array("patterns") | ||
| software["packages"] = profile["software"].fetch_as_array("packages") | ||
| end | ||
| if profile["add-on"] | ||
| repos = process_repos | ||
| software["extraRepositories"] = repos unless repos.empty? | ||
| end | ||
| return {} if software.empty? | ||
|
|
||
| { "software" => software } | ||
|
|
@@ -51,6 +55,21 @@ def read | |
| private | ||
|
|
||
| attr_reader :profile | ||
|
|
||
| def process_repos | ||
| repos = profile["add-on"].fetch_as_array("add_on_products") + | ||
| profile["add-on"].fetch_as_array("add_on_others") | ||
| repos.each_with_index.map do |repo, index| | ||
| res = {} | ||
| res["url"] = repo["media_url"] | ||
| # alias is mandatory to craft one if needed | ||
| res["alias"] = repo["alias"] || "autoyast_#{index}" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: we will sill using "autoyast" naming?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well, it is conversion from autoyast profile. But we can name it whatever we want...I am just not sure about better name |
||
| res["priority"] = repo["priority"] if repo["priority"] | ||
| res["name"] = repo["name"] if repo["name"] | ||
| res["productDir"] = repo["product_dir"] if repo["product_dir"] | ||
| res | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,9 @@ | ||
| ------------------------------------------------------------------- | ||
| Tue Jun 10 12:08:44 UTC 2025 - Josef Reidinger <[email protected]> | ||
|
|
||
| - AutoYaST support: add support for add-on elements | ||
| (gh#agama-project/agama#2458) | ||
|
|
||
| ------------------------------------------------------------------- | ||
| Fri Jun 6 10:22:36 UTC 2025 - Knut Anderssen <[email protected]> | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NP: I do not know if that logic should live here. A bit disconnected of that part currently. But I'd at least rename it to
fecth_addon_reposto make it more readable.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, idea of method is to translate autoyast entries into agama profile ones...not sure if fetch is the right verb for it