@@ -186,18 +186,20 @@ function patch_wrappers {
186
186
# - new version: wrappers-0.1.18.so
187
187
# - workaround to make pg_upgrade happy: copy wrappers-0.1.18.so to wrappers-0.1.16.so
188
188
if [ " $IS_NIX_UPGRADE " = " true" ]; then
189
- OLD_WRAPPER_LIB_PATH=$( find " $PGLIBOLD " -name " wrappers*so" -print -quit)
190
- OLD_LIB_FILE_NAME=$( basename " $OLD_WRAPPER_LIB_PATH " )
191
-
192
- find /nix/store/ -name " wrappers*so" -print0 | while read -r -d $' \0' WRAPPERS_LIB_PATH; do
193
- if [ -f " $WRAPPERS_LIB_PATH " ]; then
194
- WRAPPERS_LIB_PATH_DIR=$( dirname " $WRAPPERS_LIB_PATH " )
195
- if [ " $WRAPPERS_LIB_PATH " != " $WRAPPERS_LIB_PATH_DIR /${OLD_LIB_FILE_NAME} " ]; then
196
- echo " Copying $WRAPPERS_LIB_PATH to $WRAPPERS_LIB_PATH_DIR /${OLD_LIB_FILE_NAME} "
197
- cp " $WRAPPERS_LIB_PATH " " $WRAPPERS_LIB_PATH_DIR /${OLD_LIB_FILE_NAME} "
189
+ if [ -d " $PGLIBOLD " ]; then
190
+ OLD_WRAPPER_LIB_PATH=$( find " $PGLIBOLD " -name " wrappers*so" -print -quit)
191
+ OLD_LIB_FILE_NAME=$( basename " $OLD_WRAPPER_LIB_PATH " )
192
+
193
+ find /nix/store/ -name " wrappers*so" -print0 | while read -r -d $' \0' WRAPPERS_LIB_PATH; do
194
+ if [ -f " $WRAPPERS_LIB_PATH " ]; then
195
+ WRAPPERS_LIB_PATH_DIR=$( dirname " $WRAPPERS_LIB_PATH " )
196
+ if [ " $WRAPPERS_LIB_PATH " != " $WRAPPERS_LIB_PATH_DIR /${OLD_LIB_FILE_NAME} " ]; then
197
+ echo " Copying $WRAPPERS_LIB_PATH to $WRAPPERS_LIB_PATH_DIR /${OLD_LIB_FILE_NAME} "
198
+ cp " $WRAPPERS_LIB_PATH " " $WRAPPERS_LIB_PATH_DIR /${OLD_LIB_FILE_NAME} "
199
+ fi
198
200
fi
199
- fi
200
- done
201
+ done
202
+ fi
201
203
else
202
204
if [ -d " $PGLIBOLD " ]; then
203
205
WRAPPERS_LIB_PATH=$( find " $PGLIBNEW " -name " wrappers*so" -print -quit)
0 commit comments