Skip to content

Commit

Permalink
Update the purge-tab-indents.pl script to avoid resetting permissions
Browse files Browse the repository at this point in the history
Signed-off-by: Ralph Castain <rhc@open-mpi.org>
  • Loading branch information
Ralph Castain committed Dec 5, 2016
1 parent 5bb3efd commit 144a9d2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion contrib/purge-tab-indents.pl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ sub quiet_print {

quiet_print "FILE: $f\n";

my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks)
= stat($f);

open(FILE, "$f");
my @lines_with_tabs = <FILE>;
close(FILE);
Expand All @@ -92,6 +96,7 @@ sub quiet_print {
print TEMP @expanded_lines;
close(TEMP);
system("mv temp.txt $f");
chmod($mode, $f);
}

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

print "RELNAME", $relname, "\n";
push @files, $relname
if (-f $relname);
}
Expand Down

0 comments on commit 144a9d2

Please sign in to comment.