mirror of
https://github.com/ceph/ceph
synced 2025-02-07 10:53:30 +00:00
07ac5d3e74
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1068 29311d96-e01e-0410-9327-a35deaab8ce9
25 lines
405 B
Perl
Executable File
25 lines
405 B
Perl
Executable File
#!/usr/bin/perl
|
|
|
|
my $tablen = shift @ARGV;
|
|
my $fn = shift @ARGV;
|
|
|
|
my $tab = ' ' x $tablen;
|
|
open(I, $fn);
|
|
my $f;
|
|
my $oldtab = ' ' x 4;
|
|
while (<I>) {
|
|
if (my ($oldlen) = /\-\*\- .*tab-width:(\d)/) {
|
|
print "old length was $oldlen\n";
|
|
$oldtab = ' ' x $oldlen;
|
|
s/tab-width:\d/tab-width:$tablen/;
|
|
}
|
|
s/\t/$oldtab/g;
|
|
$f .= $_;
|
|
}
|
|
close I;
|
|
open(O, ">$fn.new");
|
|
print O $f;
|
|
close O;
|
|
|
|
rename "$fn.new", $fn;
|