Skip to content
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

ska3-template is broken on osx due to sed POSIX thingy #26

Closed
jeanconn opened this issue Jul 13, 2018 · 5 comments · Fixed by #28
Closed

ska3-template is broken on osx due to sed POSIX thingy #26

jeanconn opened this issue Jul 13, 2018 · 5 comments · Fixed by #28

Comments

@jeanconn
Copy link
Contributor

jeanconn commented Jul 13, 2018

Basically, I think I need to replace

sed -i "searchandreplacethingy" filename

with

sed -i "" "searchandreplacethingy" filename

I think the explicit empty string is needed for the -i option to the sed command. From the help it is really "sed [-i extension]" and it looks like on linux sed must be smart enough to figure out that the "searchandreplace" command is a command and not a file extension if you neglect to put something for the inplace file extension.

I think this won't need to build on osx if we can noarch the template, but all the recipes should really work.

Without the empty string for -i, on the mac I get something like

sed -i "s|%{PREFIX}%|${PREFIX}|" ska_conda/pkg_defs/ska3-template/bin/flt_envs
sed: 1: "ska_conda/pkg_defs/ska3 ...": bad flag in substitute command: 'a'
@jeanconn
Copy link
Contributor Author

Might also be able to just put the "-i" after the command.

@taldcroft
Copy link
Member

I just looked and on linux the -i needs to be followed by the replacement character(s) with no space, i.e. -i.bak.

@jeanconn
Copy link
Contributor Author

jeanconn commented Jul 13, 2018

Gotcha, which explains why it was working on linux (not magically understanding that my command string wasn't a file extension, just no characters directly after the -i).

@jeanconn
Copy link
Contributor Author

And which probably also means I didn't test #28 correctly on linux. I'll make sure I have a works-on-both solution in the PR before I'm done.

@taldcroft
Copy link
Member

Closed by #28 (which eliminates sed entirely)

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 a pull request may close this issue.

2 participants