From aed2e214b660ad8ffa512315ca554011d03ed7bd Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Wed, 23 Feb 2022 15:00:08 +0100 Subject: [PATCH] Ports: Use `sed -i` for run_replace_in_file on Serenity hosts We don't have a perl port, so let's use GNU sed's in-place option for doing substitutions when running inside Serenity. Note that we can't do this unconditionally, as `sed -i` is not portable and works differently on BSD systems. --- Ports/.port_include.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh index 957c3c5508..f8f030b119 100755 --- a/Ports/.port_include.sh +++ b/Ports/.port_include.sh @@ -108,7 +108,11 @@ run() { } run_replace_in_file() { - run perl -p -i -e "$1" $2 + if [ "$(uname -s)" = "SerenityOS" ]; then + run sed -i "$1" $2 + else + run perl -p -i -e "$1" $2 + fi } get_new_config_sub() {