Comment 0 for bug 968531

Revision history for this message
Jason Stephenson (jstephenson) wrote : Build system makes use of sed -i option

The Evergreen Makefiles use the -i option to sed when modifying some files at installation time.

This option is problematic because it causes incompatibilities between different versions of sed.

For instance, GNU sed will take the -i option unadorned, i.e. without a file name argument.

In order to invoke sed on BSD-derived systems without a file name argument requires that an empty quoted string serve as a place holder: -i ''.

GNU sed will accept an empty quoted string argument. However, there is a difference in how the argument must be entered.

On BSD sed the -i and empty quoted string arguments must have a space between them. Not having the space causes an error.

With GNU sed, the -i and empty quoted string arguments must not have any spaces between them. That is, they must touch like so: -i''. Having spaces between the arguments leads to unexpected behavior or an error.

The above situation hampers the portability of the Evergreen build system to BSD-derived operating systems. This in turn hampers the portability or testing of Evergreen on such systems, and so limits its use to GNU/Linux.

In order to improve this portability and test coverage, I suggest that all references to sed -i be replaced with simple sed commands using redirection to an output file, which works the same with all versions of sed. For an example, one could look at how Cronscript.pm is now created in Open-ILS/src/perlmods/lib/Makefile.am.