2004-10-22 16:06:05 +00:00
|
|
|
#!/usr/bin/perl
|
2004-11-22 00:37:56 +00:00
|
|
|
#
|
2005-11-05 19:57:48 +00:00
|
|
|
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
# University Research and Technology
|
|
|
|
# Corporation. All rights reserved.
|
|
|
|
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
# of Tennessee Research Foundation. All rights
|
|
|
|
# reserved.
|
2015-06-23 20:59:57 -07:00
|
|
|
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2004-11-28 20:09:25 +00:00
|
|
|
# University of Stuttgart. All rights reserved.
|
2005-03-24 12:43:37 +00:00
|
|
|
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
# All rights reserved.
|
2016-11-19 11:41:57 -08:00
|
|
|
# Copyright (c) 2016 Intel, Inc. All rights reserved.
|
2004-11-22 01:38:40 +00:00
|
|
|
# $COPYRIGHT$
|
2015-06-23 20:59:57 -07:00
|
|
|
#
|
2004-11-22 01:38:40 +00:00
|
|
|
# Additional copyrights may follow
|
2015-06-23 20:59:57 -07:00
|
|
|
#
|
2004-11-22 00:37:56 +00:00
|
|
|
# $HEADER$
|
|
|
|
#
|
2004-10-22 16:06:05 +00:00
|
|
|
#To keep brian happy
|
|
|
|
|
2016-11-19 11:41:57 -08:00
|
|
|
use Text::Tabs;
|
|
|
|
|
2004-10-22 16:06:05 +00:00
|
|
|
if (scalar(@ARGV) != 1) {
|
|
|
|
print "We need a source tree path\n";
|
|
|
|
exit(3);
|
|
|
|
}
|
|
|
|
|
|
|
|
$source_path = @ARGV[0];
|
|
|
|
|
|
|
|
open(HEADERS, "find $source_path -name *.h |");
|
|
|
|
while(<HEADERS>) {
|
|
|
|
open(TEMP, ">temp.txt");
|
|
|
|
$file_name = $_;
|
|
|
|
print $file_name;
|
|
|
|
open(FILE, "$file_name");
|
2016-11-19 11:41:57 -08:00
|
|
|
my @lines_with_tabs = <FILE>;
|
2004-10-22 16:06:05 +00:00
|
|
|
close(FILE);
|
2016-11-19 11:41:57 -08:00
|
|
|
my @expanded_lines = expand(@lines_with_tabs);
|
|
|
|
print TEMP join("\n",@expanded_lines),"\n";
|
|
|
|
close(TEMP);
|
2004-10-22 16:06:05 +00:00
|
|
|
system("mv temp.txt $file_name");
|
|
|
|
}
|
|
|
|
close(HEADERS);
|
|
|
|
|
|
|
|
open(SOURCES, "find $source_path -name *.c |");
|
|
|
|
while(<SOURCES>) {
|
|
|
|
open(TEMP, ">temp.txt");
|
|
|
|
$file_name = $_;
|
|
|
|
print $file_name;
|
|
|
|
open(FILE, "$file_name");
|
2016-11-19 11:41:57 -08:00
|
|
|
my @lines_with_tabs = <FILE>;
|
2004-10-22 16:06:05 +00:00
|
|
|
close(FILE);
|
2016-11-19 11:41:57 -08:00
|
|
|
my @expanded_lines = expand(@lines_with_tabs);
|
|
|
|
print TEMP join("\n",@expanded_lines),"\n";
|
|
|
|
close(TEMP);
|
2004-10-22 16:06:05 +00:00
|
|
|
system("mv temp.txt $file_name");
|
|
|
|
}
|
|
|
|
close(SOURCES);
|