summaryrefslogtreecommitdiff
path: root/contrib/update-copyright.py
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/update-copyright.py')
-rwxr-xr-xcontrib/update-copyright.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/update-copyright.py b/contrib/update-copyright.py
index 289ce098f3f3..f9852a8544f8 100755
--- a/contrib/update-copyright.py
+++ b/contrib/update-copyright.py
@@ -393,8 +393,10 @@ class Copyright:
lines = []
changed = False
line_filter = filter.get_line_filter (dir, filename)
+ mode = None
with open (pathname, 'r') as file:
prev = None
+ mode = os.fstat (file.fileno()).st_mode
for line in file:
while line:
next_line = None
@@ -421,6 +423,7 @@ class Copyright:
with open (tmp_pathname, 'w') as file:
for line in lines:
file.write (line)
+ os.fchmod (file.fileno(), mode)
if self.use_quilt:
subprocess.call (['quilt', 'add', pathname])
os.rename (tmp_pathname, pathname)