Skip to content

Commit 144a9d2

Browse files
author
Ralph Castain
committed
Update the purge-tab-indents.pl script to avoid resetting permissions
Signed-off-by: Ralph Castain <[email protected]>
1 parent 5bb3efd commit 144a9d2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

contrib/purge-tab-indents.pl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ sub quiet_print {
8383

8484
quiet_print "FILE: $f\n";
8585

86+
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
87+
$atime,$mtime,$ctime,$blksize,$blocks)
88+
= stat($f);
89+
8690
open(FILE, "$f");
8791
my @lines_with_tabs = <FILE>;
8892
close(FILE);
@@ -92,6 +96,7 @@ sub quiet_print {
9296
print TEMP @expanded_lines;
9397
close(TEMP);
9498
system("mv temp.txt $f");
99+
chmod($mode, $f);
95100
}
96101

97102
# Returns a list of file names (relative to pwd) which the VCS considers to be modified.
@@ -157,7 +162,6 @@ sub find_modified_files {
157162
my $relname = $fullname;
158163
$relname =~ s!^([^/]*/){$n_strip}!!g;
159164

160-
print "RELNAME", $relname, "\n";
161165
push @files, $relname
162166
if (-f $relname);
163167
}

0 commit comments

Comments
 (0)