mirror of
https://github.com/nginx/nginx.git
synced 2024-11-27 23:49:00 +08:00
Dynamic modules: do not overwrite old modules on install.
Just using "cp" is incorrect, as it will overwrite old files possibly used by OS, leading to unexpected effects. Changed to "mv + cp", much like used for the main binary.
This commit is contained in:
parent
2301b095e6
commit
5835963d61
@ -5,7 +5,6 @@
|
||||
|
||||
NGX_MAKEFILE=$NGX_OBJS/Makefile
|
||||
NGX_MODULES_C=$NGX_OBJS/ngx_modules.c
|
||||
NGX_MODULES=
|
||||
|
||||
NGX_AUTO_HEADERS_H=$NGX_OBJS/ngx_auto_headers.h
|
||||
NGX_AUTO_CONFIG_H=$NGX_OBJS/ngx_auto_config.h
|
||||
|
18
auto/install
18
auto/install
@ -169,17 +169,31 @@ END
|
||||
fi
|
||||
|
||||
|
||||
if test -n "$NGX_MODULES"; then
|
||||
if test -n "$DYNAMIC_MODULES"; then
|
||||
cat << END >> $NGX_MAKEFILE
|
||||
|
||||
test -d '\$(DESTDIR)$NGX_MODULES_PATH' \
|
||||
|| mkdir -p '\$(DESTDIR)$NGX_MODULES_PATH'
|
||||
cp $NGX_MODULES '\$(DESTDIR)$NGX_MODULES_PATH'
|
||||
END
|
||||
|
||||
fi
|
||||
|
||||
|
||||
for ngx_module in $DYNAMIC_MODULES
|
||||
do
|
||||
ngx_module=$ngx_module$ngx_modext
|
||||
|
||||
cat << END >> $NGX_MAKEFILE
|
||||
|
||||
test ! -f '\$(DESTDIR)$NGX_MODULES_PATH/$ngx_module' \
|
||||
|| mv '\$(DESTDIR)$NGX_MODULES_PATH/$ngx_module' \
|
||||
'\$(DESTDIR)$NGX_MODULES_PATH/$ngx_module.old'
|
||||
cp $NGX_OBJS/$ngx_module '\$(DESTDIR)$NGX_MODULES_PATH/$ngx_module'
|
||||
END
|
||||
|
||||
done
|
||||
|
||||
|
||||
# create Makefile
|
||||
|
||||
cat << END >> Makefile
|
||||
|
Loading…
Reference in New Issue
Block a user