Skip to content

Commit 4aa8866

Browse files
committed
chore: tweaks to run-server.sh.in top account for oriole on macos
1 parent a247689 commit 4aa8866

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@
666666
pkgs.runCommand "postgres-${pgpkg.version}-check-harness"
667667
{
668668
nativeBuildInputs = with pkgs; [
669-
coreutils bash pgpkg pg_prove pg_regress procps
669+
coreutils bash perl pgpkg pg_prove pg_regress procps
670670
start-postgres-server-bin which getkey-script
671671
];
672672
} ''

nix/tools/run-server.sh.in

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ session_preload_libraries = 'supautils'" \
225225
orioledb_config_items() {
226226
if [[ "$1" = "orioledb-17" && "$CURRENT_SYSTEM" != "aarch64-darwin" ]]; then
227227
# Remove items from postgresql.conf
228+
echo "non-macos oriole conf"
228229
sed -i 's/ timescaledb,//g;' "$DATDIR/postgresql.conf"
229230
sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf"
230231
sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "$DATDIR/supautils.conf"
@@ -234,17 +235,24 @@ orioledb_config_items() {
234235
# macOS specific configuration
235236
echo "macOS detected, applying macOS specific configuration"
236237
ls -la "$DATDIR"
237-
sed -i '' -e 's/ timescaledb,//g;' "$DATDIR/postgresql.conf"
238-
sed -i '' -e 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf"
239-
sed -i '' -e 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "$DATDIR/supautils.conf"
240-
sed -i '' -e 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "$DATDIR/postgresql.conf"
238+
239+
# Use perl instead of sed for macOS
240+
perl -pi -e 's/ timescaledb,//g' "$DATDIR/postgresql.conf"
241+
perl -pi -e 's/db_user_namespace = off/#db_user_namespace = off/g' "$DATDIR/postgresql.conf"
242+
243+
perl -pi -e 's/ timescaledb,//g' "$DATDIR/supautils.conf"
244+
perl -pi -e 's/ plv8,//g' "$DATDIR/supautils.conf"
245+
perl -pi -e 's/ postgis,//g' "$DATDIR/supautils.conf"
246+
perl -pi -e 's/ pgrouting,//g' "$DATDIR/supautils.conf"
247+
248+
perl -pi -e 's/(shared_preload_libraries\s*=\s*'\''.*?)'\''/\1, orioledb'\''/' "$DATDIR/postgresql.conf"
249+
241250
echo "default_table_access_method = 'orioledb'" >> "$DATDIR/postgresql.conf"
242251
fi
243252
}
244253

245254
# Apply OrioleDB configuration if needed
246255
orioledb_config_items "$VERSION"
247-
248256
# Configure Groonga
249257
export GRN_PLUGINS_DIR=$GROONGA/lib/groonga/plugins
250258

0 commit comments

Comments
 (0)