aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Rousse <guillomovitch@mandriva.org>2007-06-29 22:42:49 +0000
committerGuillaume Rousse <guillomovitch@mandriva.org>2007-06-29 22:42:49 +0000
commit27e71a3afa6857e3bb864a3ef4575d07e8dbf0e6 (patch)
treeba5bb16085741d63b75e8b7fc4cb8485ad97c833
parentea98a204f1191f393da7c1dd8b884be5a65d0f8e (diff)
downloadspec-helper-27e71a3afa6857e3bb864a3ef4575d07e8dbf0e6.tar
spec-helper-27e71a3afa6857e3bb864a3ef4575d07e8dbf0e6.tar.gz
spec-helper-27e71a3afa6857e3bb864a3ef4575d07e8dbf0e6.tar.bz2
spec-helper-27e71a3afa6857e3bb864a3ef4575d07e8dbf0e6.tar.xz
spec-helper-27e71a3afa6857e3bb864a3ef4575d07e8dbf0e6.zip
make sure fix-eol keep original file permissions
-rw-r--r--fix-eol3
1 files changed, 3 insertions, 0 deletions
diff --git a/fix-eol b/fix-eol
index 7d3bf21..15d1b0f 100644
--- a/fix-eol
+++ b/fix-eol
@@ -40,7 +40,10 @@ sub convert {
my $tmp = $out->filename;
$out = undef;
+ # rename file, taking care to keep original permissions
+ my $perms = (stat $_)[2] & 07777;
rename($tmp, $_) or die "Unable to rename $tmp to $_: $!";
+ chmod($perms, $_);
}
close($in);