Select Git revision
code_counter.pl
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
code_counter.pl 4.77 KiB
#!/usr/bin/env perl
#
# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# Primitive script to give approximate code counts in the Open MPI tree
#
use strict;
use File::Find;
use File::stat;
use Cwd;
# Setup some directories
my $verbose = 0;
my @skip_dirs;
my @code_dirs = ( "ompi", "orte", "opal", "test" );
my @doc_dirs = ( );
my @meta_dirs = ( ".svn", ".deps", ".libs", "libltdl" );
my @skip_files = ( "Makefile.in", "Makefile", ".ompi_built" , "config.cache",
"libtool", "depcomp", "aclocal.m4", "install-sh",
"missing", "mkinstalldirs", "compile", "config.sub",
"config.guess", "config.log", "config.status",
"TAGS", ".", "configure", "ltmain.sh",
"ChangeLog");
my @skip_patterns = ( ".o\$", ".lo\$", ".out\$", "autom4te", ".in\$",
".bak\$", "~\$", ".gz\$", "^stamp-", "^.#", "^#.+#\$",
"dynamic-mca" );
my $loc = 0;
# Primitive check to find the top OMPI dir
my @tlds = @code_dirs;
for (my $i = 0; $i <= $#doc_dirs; ++$i) {
$tlds[$#tlds + 1] = $doc_dirs[$i];
}
my $good = 0;
do {
$good = 1;
for (my $i = 0; $i <= $#tlds; ++$i) {
if (! -d $tlds[$i]) {
$good = 0;
last;
}
}
if (!$good) {
chdir("..");
my $dir = getcwd();
if ($dir eq "/") {