Skip to content

Conversation

@jakub-nt
Copy link
Contributor

No description provided.

…e helper function

This improved how the program messages read (especially when in interactive mode, where there will be a prompt about editing the commit message) and reduced code verbosity.

Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
@cf-bottom
Copy link

Thank you for submitting a PR! Maybe @larsewi can review this?

@olehermanse olehermanse requested a review from larsewi November 17, 2025 12:45
@jakub-nt jakub-nt marked this pull request as ready for review November 17, 2025 15:15
Copy link
Contributor

@larsewi larsewi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great 🚀



def _apply_masterfiles_patch(patch_path):
if not cli_tool_present("patch"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function could take a list of commands. You should check for gpatch first, to ensure GNU implementation. Some UNIX systems have their own implementation of patch which can behave differently.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only bundle cfbs in hub packages as far as I know. And they are all Linux. So should be fine to not do this.

# make the patches local module on first use
if not patches_module_present:
print("Adding patches local module...")
mkdir(patches_dir)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably not error in case of FileExistsError

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That directory can't exist due to

cfbs/cfbs/commands.py

Lines 1138 to 1141 in 3f602d9

if not (len(dir_content) == 1 and dir_content[0].startswith("masterfiles-")):
raise CFBSUserError(
"cfbs convert must be run in a directory containing only one item, a subdirectory named masterfiles-<some-name>"
)

…the system

Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
… a unified diff

Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
… cfbs-convert

Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
…st file converted to a patch file

Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
…e conversion together

This makes sense since a module with no build steps is not considered valid.

Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
Copy link
Contributor

@larsewi larsewi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🚀

@larsewi larsewi merged commit 0fe97e4 into cfengine:master Nov 18, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants