diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh index e516cce05a..1a5de96130 100755 --- a/Ports/.port_include.sh +++ b/Ports/.port_include.sh @@ -40,6 +40,10 @@ function run_fetch_git() { fi } +function run_replace_in_file() { + run_command perl -p -i -e "$1" $2 +} + function run_patch() { echo "+ Applying patch $1" run_command patch "$2" < "$1" diff --git a/Ports/bash/bash.sh b/Ports/bash/bash.sh index 5cafa2344c..61bc2ad269 100755 --- a/Ports/bash/bash.sh +++ b/Ports/bash/bash.sh @@ -18,8 +18,8 @@ function configure() { } function build() { # Avoid some broken cross compile tests... - run_command perl -p -i -e "s/define GETCWD_BROKEN 1/undef GETCWD_BROKEN/" config.h - run_command perl -p -i -e "s/define CAN_REDEFINE_GETENV 1/undef CAN_REDEFINE_GETENV/" config.h + run_replace_in_file "s/define GETCWD_BROKEN 1/undef GETCWD_BROKEN/" config.h + run_replace_in_file "s/define CAN_REDEFINE_GETENV 1/undef CAN_REDEFINE_GETENV/" config.h run_make } function install() {