Ports: Replace run_command use in bash with a run_replace_in_file helper

This way, we don't (in the ports themselves) depend on perl as a public
interface, which means if we ever have to, we can port to something else easier.
This commit is contained in:
Robin Burchell 2019-05-28 10:25:39 +02:00 committed by Andreas Kling
parent 2b1a52745e
commit 335d0e52a4
Notes: sideshowbarker 2024-07-19 13:52:38 +09:00
2 changed files with 6 additions and 2 deletions

View file

@ -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"

View file

@ -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() {