From 88c6225ee54c4fa0c7c00c50762333fe64d1426f Mon Sep 17 00:00:00 2001 From: Mark Roberts Date: Tue, 7 Jan 2025 09:43:32 -0800 Subject: [PATCH] fix issue 630 (#634) --- framework/core/Project/Closure.pm | 16 ++++++++++------ framework/core/Project/Codec.pm | 4 +++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/framework/core/Project/Closure.pm b/framework/core/Project/Closure.pm index 89a8d26f3..1be0132a3 100644 --- a/framework/core/Project/Closure.pm +++ b/framework/core/Project/Closure.pm @@ -104,12 +104,16 @@ sub _post_checkout { close FH; # Set default Java target to 6. - # either these: - Utils::sed_cmd("s/source-level: 1\.[1-5]/source-level ${jvm_version}/", "$work_dir/lib/rhino/build.properties"); - Utils::sed_cmd("s/target-jvm: 1\.[1-5]/target-jvm ${jvm_version}/", "$work_dir/lib/rhino/build.properties"); - # or these: - Utils::sed_cmd("s/source-level: 1\.[1-5]/source-level ${jvm_version}/", "$work_dir/lib/rhino/src/mozilla/js/rhino/build.properties"); - Utils::sed_cmd("s/target-jvm: 1\.[1-5]/target-jvm ${jvm_version}/", "$work_dir/lib/rhino/src/mozilla/js/rhino/build.properties"); + if (-e "$work_dir/lib/rhino/build.properties") { + # either these: + Utils::sed_cmd("s/source-level: 1\.[1-5]/source-level ${jvm_version}/", "$work_dir/lib/rhino/build.properties"); + Utils::sed_cmd("s/target-jvm: 1\.[1-5]/target-jvm ${jvm_version}/", "$work_dir/lib/rhino/build.properties"); + } + if (-e "$work_dir/lib/rhino/src/mozilla/js/rhino/build.properties") { + # or these: + Utils::sed_cmd("s/source-level: 1\.[1-5]/source-level ${jvm_version}/", "$work_dir/lib/rhino/src/mozilla/js/rhino/build.properties"); + Utils::sed_cmd("s/target-jvm: 1\.[1-5]/target-jvm ${jvm_version}/", "$work_dir/lib/rhino/src/mozilla/js/rhino/build.properties"); + } } 1; diff --git a/framework/core/Project/Codec.pm b/framework/core/Project/Codec.pm index 2601ab7f2..ada64f725 100644 --- a/framework/core/Project/Codec.pm +++ b/framework/core/Project/Codec.pm @@ -132,7 +132,9 @@ sub _post_checkout { } # Set default Java target to 6. - Utils::sed_cmd("s/1\.[1-5]/1.6/", "$work_dir/default.properties"); + if (-e "$work_dir/default.properties") { + Utils::sed_cmd("s/1\.[1-5]/1.6/", "$work_dir/default.properties"); + } } #