From 28d738e44a7d4566b4b2149fbafb727a566f516e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 6 Mar 2020 00:54:46 +0100 Subject: [PATCH] Ensure that updating the file preserves its mode Preserve the file mode when replacing it, this notably keeps docs/doxygen/regen.sh executable when running misc/scripts/inc_year. This uses GNU chmod --reference option which is not available on all systems, but it shouldn't be a problem in practice. --- misc/scripts/run_sed_common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/scripts/run_sed_common.sh b/misc/scripts/run_sed_common.sh index e3599732fe..2c0793fc58 100644 --- a/misc/scripts/run_sed_common.sh +++ b/misc/scripts/run_sed_common.sh @@ -37,6 +37,7 @@ run_sed() { rm $filename.$$ msgc "unchanged" else + chmod --reference=$filename $filename.$$ mv $filename.$$ $filename msgc "done" fi