Fixed incompatibility with BSD Unix sed in makefile (closes #749)#751
Merged
Fixed incompatibility with BSD Unix sed in makefile (closes #749)#751
Conversation
Sedon BSD Unix requires an argument for the -i switch. Unless you wanta backup file inemust add an empty string argument. Signed-off-by: Sven Strittmatter <[email protected]>
It is not necessar to add ;\ at the end of each line because make runs each command step by step. So this is removed. Also echo what is done is not necessary because make prints by default each command for debug purpose. Also removed the cd <subdir> because this is brittle: If the cd commandfails the subsequent commands work in a wrong directory. Better solution is to always use theconcrete path relative to the Makefile. Signed-off-by: Sven Strittmatter <[email protected]>
rsync is for copy files between remote machines. Since we copy files local it makes no sense to use rsync here. A simple recursive copy is well suited for this. Signed-off-by: Sven Strittmatter <[email protected]>
The -i Switch (in place file processing) is not POSIX compliant and behaves differently on some systems: * BSD Unix: requires an argument (e.g. -i '.bak') * GNU Linux: does not allow an argument This patch introduces a platform independent way for replacing the needle stringin with the scanner name in the copied template files. The trick is to use a temporary file to save the sed result. First aproach was to use > to redirect the sed output from STDOUT into the temp file. This does not work because find's -exec does not execute a shell and executes the command directly in a forked child process. So there are no shell features like redirect or pipe. The solution is to use the sed command 'w' to write the file and supress the output on STDOUT. Signed-off-by: Sven Strittmatter <[email protected]>
malexmave
approved these changes
Oct 21, 2021
Member
malexmave
left a comment
There was a problem hiding this comment.
Works under OS X and seems to do what it's supposed to do. 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This fixes #749 incompatibility with BSD Unix sed.
Checklist
npm testruns for the whole project.