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.
This commit is contained in:
@@ -37,6 +37,7 @@ run_sed() {
|
||||
rm $filename.$$
|
||||
msgc "unchanged"
|
||||
else
|
||||
chmod --reference=$filename $filename.$$
|
||||
mv $filename.$$ $filename
|
||||
msgc "done"
|
||||
fi
|
||||
|
Reference in New Issue
Block a user