This is an automated email from the ASF dual-hosted git repository.
yjhjstz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
The following commit(s) were added to refs/heads/main by this push:
new 7e867f605c8 Fix sed -i compatibility on macOS in configure (#1598)
7e867f605c8 is described below
commit 7e867f605c8798979405b163a7d5c65b572edb4c
Author: zhangyue <[email protected]>
AuthorDate: Wed Mar 4 04:49:45 2026 +0800
Fix sed -i compatibility on macOS in configure (#1598)
macOS BSD sed requires an explicit empty string argument after
-i (sed -i '' 'script' file), unlike GNU sed which takes -i
without a suffix argument. Without this fix, BSD sed misinterprets
the sed script as a backup suffix and treats the filename as the
script, causing "unterminated substitute pattern" error.
---
configure | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index b9371321677..c9ce3d46302 100755
--- a/configure
+++ b/configure
@@ -24833,4 +24833,11 @@ fi
# The configure args contain '-Wl,-rpath,\$$ORIGIN`, when it falls
# as a C literal string, it's invalid, so converting `\` to `\\`
# to be correct for C program.
-sed -i '/define CONFIGURE_ARGS/s,\([^\\]\)\\\$\$,\1\\\\$$,g'
src/include/pg_config.h
+case $build_os in
+darwin*)
+ sed -i '' '/define CONFIGURE_ARGS/s,\([^\\]\)\\\$\$,\1\\\\$$,g'
src/include/pg_config.h
+ ;;
+*)
+ sed -i '/define CONFIGURE_ARGS/s,\([^\\]\)\\\$\$,\1\\\\$$,g'
src/include/pg_config.h
+ ;;
+esac
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]