diff options
author | aldot <aldot@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-01-30 14:31:59 +0000 |
---|---|---|
committer | aldot <aldot@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-01-30 14:31:59 +0000 |
commit | 8aa99d05b9b45bba02a7c04576150240d327ca8f (patch) | |
tree | 0c7970b92a2469bcd44a16460ec8b6a0266f1fe6 /contrib | |
parent | 111c441e8c5d5cfee4481ec26cb88b9a64912af7 (diff) | |
download | gcc-8aa99d05b9b45bba02a7c04576150240d327ca8f.tar.gz |
update-copyright.py: Retain original file mode
2017-01-31 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
* update-copyright.py (Copyright.process_file): Retain original
file mode.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245028 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/ChangeLog | 5 | ||||
-rwxr-xr-x | contrib/update-copyright.py | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 15e74782076..87dc2337c5d 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,8 @@ +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. diff --git a/contrib/update-copyright.py b/contrib/update-copyright.py index 289ce098f3f..f9852a8544f 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) |