Skip to content

PATCH: config.c: problems with #tryinclude statements, whitespace #48

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

Conversation

Allan-N
Copy link
Contributor

@Allan-N Allan-N commented Nov 9, 2024

Creating phreaknet patches for the following Asterisk issues / pull requests :

  1. config_c_fix_tryinclude.patch

    Correct an issue in ast_config_text_file_save2() when updating configuration files with "#tryinclude" statements. The API currently replaces "#tryinclude" with "#include". The API also creates empty template files if the referenced files do not exist. This patch resolves these problems.

  2. config_c_fix_whitespace.patch

    Configurations loaded with the ast_config_load2() API and later written out with ast_config_text_file_save2() will have any leading whitespace stripped away. The APIs should make reasonable efforts to maintain the content and formatting of the configuration files.

Copy link
Owner

@InterLinked1 InterLinked1 left a comment

Choose a reason for hiding this comment

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

These can be added until they are merged upstream, but since they are already Asterisk PRs, we don't need to duplicate the patches here, that way it's less stuff to remove later after it merges.

It can be done with just a single line, like so: https://github.com/InterLinked1/phreakscript/blob/master/phreaknet.sh#L2207

You can use asterisk_pr_unconditional to pull in both of these (and if it can be in that section, beneath the other config patches, that would be great). The total diff should then be just 2 lines :)

A side benefit of this is if the Asterisk PR is updated, the latest patch is automatically pulled in.

@Allan-N Allan-N force-pushed the asterisk-108-fix-tryinclude-and-whitespace branch from 83b4b4a to d988628 Compare November 9, 2024 20:28
@Allan-N Allan-N requested a review from InterLinked1 November 9, 2024 20:28
phreaknet.sh Outdated
@@ -2205,8 +2205,10 @@ phreak_patches() { # $1 = $PATCH_DIR, $2 = $AST_SRC_DIR

## Unmerged patches: remove once merged
asterisk_pr_unconditional 917 # FreeBSD compilation fixes
git_patch "config_c_fix_template_inheritance_overrides.patch" # config.c: fix template inheritance/overrides
git_patch "config_c_fix_template_writing.patch" # config.c: fix template inheritance/overrides
git_patch "config_c_fix_template_inheritance_overrides.patch"
Copy link
Owner

Choose a reason for hiding this comment

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

Why remove the comments from these 2 lines?

phreaknet.sh Outdated
git_patch "config_c_fix_template_inheritance_overrides.patch"
git_patch "config_c_fix_template_writing.patch"
asterisk_pr_unconditional 918 # config.c #tryinclude fixes
asterisk_pr_unconditional 971 # config.c fix issues w/ whitespace
Copy link
Owner

Choose a reason for hiding this comment

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

w/ whitespace in comments

Pull in Asterisk pull requests for the following issues :

1. asterisk/asterisk#920
   asterisk/asterisk#918

   Correct an issue in ast_config_text_file_save2() when updating configuration
   files with "#tryinclude" statements. The API currently replaces "#tryinclude"
   with "#include". The API also creates empty template files if the referenced
   files do not exist. This patch resolves these problems.

2. asterisk/asterisk#970
   asterisk/asterisk#971

   Configurations loaded with the ast_config_load2() API and later written
   out with ast_config_text_file_save2() will have any leading whitespace
   stripped away.  The APIs should make reasonable efforts to maintain the
   content and formatting of the configuration files.
@Allan-N Allan-N force-pushed the asterisk-108-fix-tryinclude-and-whitespace branch from d988628 to 2f959df Compare November 9, 2024 20:44
@Allan-N Allan-N requested a review from InterLinked1 November 9, 2024 20:45
Copy link
Owner

@InterLinked1 InterLinked1 left a comment

Choose a reason for hiding this comment

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

Once the build finishes, I'll merge it

@InterLinked1 InterLinked1 merged commit 5c172b3 into InterLinked1:master Nov 9, 2024
30 checks passed
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