Skip to content

Commit 66ef6fb

Browse files
committed
Cosmetic fix: make sure the filename of the current file, where is appears at the top of the file, is accurate.
1 parent fa1440d commit 66ef6fb

File tree

59 files changed

+125
-86
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+125
-86
lines changed

misc/maintenance/fix_apache_headers.sh

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,43 @@
44
# authors appears in the apache headers in the source, and that source files
55
# have their Apache headers. Including this mainly for documentation, as I
66
# doubt the issue will occur much in future.
7+
#
8+
# Also makes sure that where the filename appears in a comment at the top of the
9+
# file, e.g. as in
10+
# // somedir/some-file.cc
11+
# the filename is accurate.
712

813
# run this from the top level of the repo, as
914
# misc/maintenance/fix_apache_headers.sh
1015

1116
set -e
1217
cd src
1318
rm -rf tmp
14-
for x in */*.{h,cc,dox}; do
19+
for x in */*.{h,cc,dox}; do
1520
if [ $x != "util/basic-filebuf.h" ]; then
1621
if ! grep 'COPYING for clarification' $x >/dev/null; then
1722
echo Fixing $x;
1823
if ! grep "Apache License" $x >/dev/null; then
1924
echo "$0: warning: file $x may not have an Apache license header"
2025
else
21-
cp $x tmp; cat tmp | perl -ape ' if (m/Licensed under the Apache License/) {
22-
print "// See ../../COPYING for clarification regarding multiple authors\n";
26+
cp $x tmp; cat tmp | perl -ape ' if (m/Licensed under the Apache License/) {
27+
print "// See ../../COPYING for clarification regarding multiple authors\n";
2328
print "//\n";} ' > $x;
2429
fi
2530
fi
2631
fi
2732
done
33+
34+
for x in */*.{h,cc,dox}; do
35+
if [ $x != "util/basic-filebuf.h" ]; then
36+
echo "// $x" | cat - <(tail -n +2 $x) >tmp
37+
if ! diff tmp $x; then
38+
if head -n 1 $x | grep -E '// [-a-z0-9_]+/[-a-z0-9_.]+$'; then
39+
echo "Fixing $x automatically"
40+
cp tmp $x
41+
else
42+
echo "**Please fix $x manually"
43+
fi
44+
fi
45+
fi
46+
done

src/bin/am-info.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// gmmbin/am-info.cc
1+
// bin/am-info.cc
22

33
// Copyright 2012-2013 Johns Hopkins University (Author: Daniel Povey)
44

src/bin/sum-lda-accs.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// bin/sum-lda.cc
1+
// bin/sum-lda-accs.cc
22

33
// Copyright 2014 LINSE/UFSC; Augusto Henrique Hentz
44

src/bin/sum-mllt-accs.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// bin/sum-mllt.cc
1+
// bin/sum-mllt-accs.cc
22

33
// Copyright 2014 LINSE/UFSC; Augusto Henrique Hentz
44

src/bin/transform-vec.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// featbin/transform-vec.cc
1+
// bin/transform-vec.cc
22

33
// Copyright 2009-2012 Microsoft Corporation
44
// 2012-2014 Johns Hopkins University (author: Daniel Povey)

src/cudamatrix/cu-math-test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// cudamatrix/cuda-math-test.cc
1+
// cudamatrix/cu-math-test.cc
22

33
// Copyright 2013 Johns Hopkins University (Author: David Snyder)
44

src/cudamatrix/cu-matrix-test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// cudamatrix/cuda-matrix-test.cc
1+
// cudamatrix/cu-matrix-test.cc
22

33
// Copyright 2010 Karel Vesely
44
// 2013 Lucas Ondel

src/cudamatrix/cu-packed-matrix-test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// cudamatrix/cu-sp-matrix-test.cc
1+
// cudamatrix/cu-packed-matrix-test.cc
22
//
33
// Copyright 2013 Ehsan Variani
44
// Lucas Ondel

src/cudamatrix/cu-sp-matrix-speed-test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// cudamatrix/cu-matrix-speed-test.cc
1+
// cudamatrix/cu-sp-matrix-speed-test.cc
22

33
// Copyright 2013 Johns Hopkins University (author: Daniel Povey)
44

src/cudamatrix/cu-tp-matrix-test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// cudamatrix/cu-sp-matrix-test.cc
1+
// cudamatrix/cu-tp-matrix-test.cc
22
//
33
// Copyright 2013 Ehsan Variani
44
// Lucas Ondel

0 commit comments

Comments
 (0)