Skip to content

fix(service): better handling of script names#1951

Closed
imobachgs wants to merge 2 commits intomasterfrom
fix-scripts-reader
Closed

fix(service): better handling of script names#1951
imobachgs wants to merge 2 commits intomasterfrom
fix-scripts-reader

Conversation

@imobachgs
Copy link
Copy Markdown
Contributor

Problem

There are a few problems when importing an AutoYaST script:

  • Agama uses file_name instead of filename.
  • If file_name is missing, it does not propose another name, generating an invalid profile.

Solution

Fix both problems by:

  • Using the right attribute name (filename instead of file_name).
  • Falling back to the basename from the location. If no location is given, propose script-X
    where X is a number.

Testing

  • Added a new unit test
  • Tested manually

@jreidinger
Copy link
Copy Markdown
Contributor

@imobachgs we really mess up with our amount of delayed PR as exactly this fixes I have in my PR #1946

@jreidinger
Copy link
Copy Markdown
Contributor

to be precise I solve it slightly differently, but I have those fixes and also test for it :)

@imobachgs
Copy link
Copy Markdown
Contributor Author

to be precise I solve it slightly differently, but I have those fixes and also test for it :)

Yes, I saw it later. Well, the main difference is that in this case I am trying to infer the name of the script from the URL if it is not given. But feel free to close it if you prefer the other way.

The only think I do not like about your PR is the "anonymous-" prefix. I would rather prefer something like "script-" or similar.

@imobachgs
Copy link
Copy Markdown
Contributor Author

Well, to reduce the duplication, I am closing this PR. I will review yours.

@imobachgs imobachgs closed this Jan 30, 2025
@jreidinger
Copy link
Copy Markdown
Contributor

thanks, change of fallback name is really trivial in mine...lets discuss it there.

imobachgs added a commit that referenced this pull request Feb 14, 2025
## Problem

The conversion of the localization and scripts sections has several
problems:

- #1903
- #1907
- #1960

This PR include some changes from #1951 and #1946.

## Solution

- Fix the handling of the scripts file name and location.
- Fix the name of the localization setting ("localization" instead of
"l10n").

Additionally, use "pretty" JSON when exporting the converted profile.

## Testing

- _Added a new unit test_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants