Skip to content

Correctly ignore patches that are already applied. #20480

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

Merged
merged 1 commit into from
Jun 13, 2025

Conversation

Ferroin
Copy link
Member

@Ferroin Ferroin commented Jun 13, 2025

Summary

When trying to process a patch that has already been applied, patch will return a non-zero exit code. Additionally, there is no option to override this behavior and simply ignore patches that are already applied.

Given this, restructure our patching script so that it just ignores patches that have already been applied, since we obviously don’t need to apply them.

Test Plan

Requires testing to confirm the change is working.

@github-actions github-actions bot added the area/packaging Packaging and operating systems support label Jun 13, 2025
@ilyam8 ilyam8 requested a review from Copilot June 13, 2025 13:09
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modifies the patching script to ignore patches that have already been applied instead of causing the process to fail.

  • Added the --forward flag to the patch command.
  • Captured the patch command's exit code and conditionally exited only for errors other than already applied patches.
Comments suppressed due to low confidence (1)

packaging/cmake/patches/apply-patches.sh:10

  • [nitpick] Consider renaming 'ret' to 'exit_status' to improve readability by clearly indicating that it holds the exit code.
ret="${?}"

@Ferroin Ferroin marked this pull request as ready for review June 13, 2025 15:09
@Ferroin Ferroin requested a review from vkalintiris as a code owner June 13, 2025 15:09
@Ferroin Ferroin merged commit ade0e5b into netdata:master Jun 13, 2025
106 checks passed
@Ferroin Ferroin deleted the fix-absl-patch branch June 13, 2025 15:09
stelfrag pushed a commit to stelfrag/netdata that referenced this pull request Jun 16, 2025
@stelfrag stelfrag mentioned this pull request Jun 16, 2025
Ferroin added a commit to stelfrag/netdata that referenced this pull request Jun 24, 2025
Ferroin added a commit that referenced this pull request Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/packaging Packaging and operating systems support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants