projects
/
cvc5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
01d8991
)
update-copyright: Preserve file permissions. (#5597)
author
Mathias Preiner
<mathias.preiner@gmail.com>
Fri, 4 Dec 2020 06:32:17 +0000
(22:32 -0800)
committer
GitHub
<noreply@github.com>
Fri, 4 Dec 2020 06:32:17 +0000
(07:32 +0100)
When updating the copyright headers file permissions were not preserved. In some cases this results in losing the permission to execute scripts. This commit makes sure to preserve the file permissions for updated files.
contrib/update-copyright.pl
patch
|
blob
|
history
diff --git
a/contrib/update-copyright.pl
b/contrib/update-copyright.pl
index 1f119d8e95faba3d6aeee3b7c59cbf760d54ede0..6a8482e7692094b01d9cf2bf976799eeadaa4683 100755
(executable)
--- a/
contrib/update-copyright.pl
+++ b/
contrib/update-copyright.pl
@@
-257,6
+257,11
@@
sub handleFile {
print $OUT $_;
}
close $OUT;
+
+ # Preserve file permissions of $infile
+ my $perm = (stat($infile))[2] & 0777;
+ chmod $perm, $outfile;
+
rename($outfile, $infile) || die "can't rename working file \`$outfile' to \`$infile'";
}