Skip to content

Commit 5f6b5f8

Browse files
authored
Extend license checking to .sh files (#43)
the only difference is that they don't need to check encoding.
1 parent d465eb7 commit 5f6b5f8

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

buildbot/buildbot_init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/bin/bash
21
# Copyright 2020 Google LLC
32
#
43
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,6 +12,7 @@
1312
# See the License for the specific language governing permissions and
1413
# limitations under the License.
1514

15+
#!/bin/bash
1616

1717
# Script to configure GCE instance to run LLVM ml-driven optimization build bots.
1818

check-license.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright 2020 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
#!/bin/bash
216

317
exitcode=0
@@ -10,4 +24,15 @@ do
1024
exitcode=1
1125
fi
1226
done
27+
28+
for fname in `find . -name "*.sh"`;
29+
do
30+
diff -q <(head -13 $fname) <(tail -13 license-header.txt) > /dev/null
31+
if [ $? -ne 0 ]
32+
then
33+
echo "$fname does not have license header. Please copy and paste ./license-header.txt"
34+
exitcode=1
35+
fi
36+
done
37+
1338
exit ${exitcode}

0 commit comments

Comments
 (0)