Skip to content

Optional legacy image filename#213

Merged
idroz merged 5 commits intobravetools:masterfrom
Szubie:optional-legacy-image-filename
Nov 25, 2022
Merged

Optional legacy image filename#213
idroz merged 5 commits intobravetools:masterfrom
Szubie:optional-legacy-image-filename

Conversation

@Szubie
Copy link
Collaborator

@Szubie Szubie commented Nov 25, 2022

Legacy image filename parsing was not optional when calling ImageFromFilename. This could lead to problems with incorrectly parsing names with hyphens as versions. Legacy parsing should be opt in and used only in places it makes sense.

Command line commands will now default to modern image syntax. Legacy parsing reserved only for listing images in the bravetools image store.

Also included in this PR are better validation of names and improved error messaging.

…strings used (and source filename on err). This is necessary since otherwise the user does not know the name/version/arch of the newly imported image unless they are familiar with the parsing rules or do a diff before/after
…ImageFromFilename` function. It being non-optional was a problem as it could lead to issues with incorrectly parsing a name with a hyphen in as a version. Update `ListLocalImages` to handle modern/legacy filenames by checking which one exists. Other users of the `ImageFromFilename` function will default to only accepting modern filename structure (for example `ImportLocalImage`).
…return errors, where the basename simply consists of the separator character
…the error encounetered with validation function
@idroz idroz merged commit 9b072a5 into bravetools:master Nov 25, 2022
@Szubie Szubie deleted the optional-legacy-image-filename branch November 25, 2022 16:49
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.

2 participants