Skip to content
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
3 changes: 1 addition & 2 deletions rust/agama-lib/src/scripts/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ impl BaseScript {
#[derive(Clone, Debug, Serialize, Deserialize, utoipa::ToSchema)]
#[serde(untagged)]
pub enum ScriptSource {
/// Script's content. Deprecated name was body which is still accepted.
#[serde(alias = "body")]
/// Script's content.
Text { content: String },
/// URL to get the script from.
Remote { url: String },
Expand Down
2 changes: 1 addition & 1 deletion service/lib/agama/autoyast/scripts_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def read_script(section)
if section["location"] && !section["location"].empty?
script["url"] = section["location"]
elsif section["source"]
script["body"] = section["source"]
script["content"] = section["source"]
end

script
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 @@
-------------------------------------------------------------------
Fri Mar 28 11:13:48 UTC 2025 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Properly map AutoYaST scripts "source" to "content"
(gh#agama-project/agama#2224).

-------------------------------------------------------------------
Thu Mar 27 12:35:32 UTC 2025 - Ladislav Slezák <lslezak@suse.com>

Expand Down
10 changes: 5 additions & 5 deletions service/share/autoyast-compat.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
"agama": "scripts.pre[].name"
},
{ "key": "location", "support": "yes", "agama": "scripts.pre[].url" },
{ "key": "source", "support": "yes", "agama": "scripts.pre[].body" },
{ "key": "source", "support": "yes", "agama": "scripts.pre[].content" },
{
"key": "interpreter",
"support": "no",
Expand Down Expand Up @@ -292,7 +292,7 @@
{
"key": "source",
"support": "yes",
"agama": "scripts.postPartitioning[].body"
"agama": "scripts.postPartitioning[].content"
},
{
"key": "interpreter",
Expand Down Expand Up @@ -324,7 +324,7 @@
{
"key": "source",
"support": "yes",
"agama": "scripts.chroot[].body"
"agama": "scripts.chroot[].content"
},
{
"key": "interpreter",
Expand Down Expand Up @@ -353,7 +353,7 @@
"support": "yes",
"agama": "scripts.init[].url"
},
{ "key": "source", "support": "yes", "agama": "scripts.init[].body" },
{ "key": "source", "support": "yes", "agama": "scripts.init[].content" },
{
"key": "interpreter",
"support": "no",
Expand Down Expand Up @@ -381,7 +381,7 @@
"support": "yes",
"agama": "scripts.init[].url"
},
{ "key": "source", "support": "yes", "agama": "scripts.init[].body" },
{ "key": "source", "support": "yes", "agama": "scripts.init[].content" },
{ "key": "rerun", "support": "no" }
]
}
Expand Down
8 changes: 5 additions & 3 deletions service/test/agama/autoyast/scripts_reader_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@
}
end

it "sets the \"body\" to the \"sources\"" do
it "uses the \"sources\" as \"content\"" do
scripts = subject.read["scripts"][section]
expect(scripts.first).to include("body" => "#!/bin/bash\necho 'Hello World!'")
expect(scripts.first).to include("content" => "#!/bin/bash\necho 'Hello World!'")
end

context "and the script filename is not specified" do
Expand Down Expand Up @@ -133,7 +133,9 @@
expect(subject.read["scripts"]).to include(
"post" => [
{
"name" => "test.sh", "chroot" => false, "body" => "#!/bin/bash\necho 'Hello World!'"
"name" => "test.sh",
"chroot" => false,
"content" => "#!/bin/bash\necho 'Hello World!'"
}
]
)
Expand Down
Loading