2017-01-31 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
* update-copyright.py (Copyright.process_file): Retain original
file mode.
From-SVN: r245028
+2017-01-31 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
+
+ * update-copyright.py (Copyright.process_file): Retain original
+ file mode.
+
2017-01-29 Gerald Pfeifer <gerald@pfeifer.com>
* update-copyright.py: Fix the name of this script in examples.
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
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)