From d2c7f3b7411b92b5d7ee3382a00dc3df10a75f7e Mon Sep 17 00:00:00 2001 From: Mark Roberts Date: Tue, 6 Aug 2024 20:03:10 -0700 Subject: [PATCH] modify sed command to work for both Linux and OS X --- framework/core/Project/JacksonDatabind.pm | 4 ++-- framework/core/Project/Lang.pm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/framework/core/Project/JacksonDatabind.pm b/framework/core/Project/JacksonDatabind.pm index 95e6640c0..3b20cddcf 100644 --- a/framework/core/Project/JacksonDatabind.pm +++ b/framework/core/Project/JacksonDatabind.pm @@ -86,14 +86,14 @@ sub _post_checkout { my $log = `$cmd`; my $ret = $?; if ($ret == 0 && length($log) > 0) { - Utils::exec_cmd("grep -lR ' extends Module\$' $work_dir | xargs sed -i'' -e 's/ extends Module\$/ extends com.fasterxml.jackson.databind.Module/'", "Correct Module ambiguity 1") or die; + Utils::exec_cmd("grep -lR ' extends Module\$' $work_dir | xargs sed -i'.bak' -e 's/ extends Module\$/ extends com.fasterxml.jackson.databind.Module/'", "Correct Module ambiguity 1") or die; } $cmd = "grep -lR ' Module ' $work_dir "; $log = `$cmd`; $ret = $?; if ($ret == 0 && length($log) > 0) { - Utils::exec_cmd("grep -lR ' Module ' $work_dir | xargs sed -i'' -e 's/ Module / com.fasterxml.jackson.databind.Module /'", "Correct Module ambiguity 2") or die; + Utils::exec_cmd("grep -lR ' Module ' $work_dir | xargs sed -i'.bak' -e 's/ Module / com.fasterxml.jackson.databind.Module /'", "Correct Module ambiguity 2") or die; } my $project_dir = "$PROJECTS_DIR/$self->{pid}"; diff --git a/framework/core/Project/Lang.pm b/framework/core/Project/Lang.pm index ac342960e..9a02637cc 100644 --- a/framework/core/Project/Lang.pm +++ b/framework/core/Project/Lang.pm @@ -95,14 +95,14 @@ sub _post_checkout { my $log = `$cmd`; my $ret = $?; if ($ret == 0 && length($log) > 0) { - Utils::exec_cmd("grep -lR '\\.enum;' $work_dir'/'$result->{src}'/org/apache/commons/lang/enum/' | xargs sed -i'' 's/\\.enum;/\\.oldenum;/'", "Rename enum 1") or die; + Utils::exec_cmd("grep -lR '\\.enum;' $work_dir'/'$result->{src}'/org/apache/commons/lang/enum/' | xargs sed -i'.bak' 's/\\.enum;/\\.oldenum;/'", "Rename enum 1") or die; } $cmd = "grep -lR '\.enum;' $work_dir'/'$result->{test}'/org/apache/commons/lang/enum/'"; $log = `$cmd`; $ret = $?; if ($ret == 0 && length($log) > 0) { - Utils::exec_cmd("grep -lR '\\.enum;' $work_dir'/'$result->{test}'/org/apache/commons/lang/enum/' | xargs sed -i'' 's/\\.enum;/\\.oldenum;/'", "Rename enum 2") or die; + Utils::exec_cmd("grep -lR '\\.enum;' $work_dir'/'$result->{test}'/org/apache/commons/lang/enum/' | xargs sed -i'.bak' 's/\\.enum;/\\.oldenum;/'", "Rename enum 2") or die; } # Fix compilation errors if necessary