File tree 3 files changed +35
-6
lines changed
3 files changed +35
-6
lines changed Original file line number Diff line number Diff line change
1
+ # Copyright (c) 2016-present, Facebook, Inc.
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
+ ##############################################################################
15
+
Original file line number Diff line number Diff line change
1
+ if [[ " $1 " == * .py ]]; then
2
+ apache_header=" apache_python.txt"
3
+ else
4
+ apache_header=" apache_header.txt"
5
+ fi
6
+ apache_lines=$( wc -l < " ${apache_header} " )
7
+ apache_md5=$( cat " ${apache_header} " | md5)
8
+ header_md5=$( head -n ${apache_lines} $1 | md5)
9
+ if [ " ${header_md5} " == " ${apache_md5} " ]; then
10
+ keep_lines=$(( $(wc - l < $1 ) - ${apache_lines} ))
11
+ tail -n ${keep_lines} $1 > _remove_apache_header.txt
12
+ mv _remove_apache_header.txt $1
13
+ fi
Original file line number Diff line number Diff line change 1
- find ../caffe2 -name " *.h" -exec ./add_apache_header.sh {} \;
2
- find ../caffe2 -name " *.cc" -exec ./add_apache_header.sh {} \;
3
- find ../caffe2 -name " *.cpp" -exec ./add_apache_header.sh {} \;
4
- find ../caffe2 -name " *.cu" -exec ./add_apache_header.sh {} \;
5
- find ../caffe2 -name " *.mm" -exec ./add_apache_header.sh {} \;
6
- find ../caffe2 -name " *.m" -exec ./add_apache_header.sh {} \;
1
+ find ../caffe2 -name " *.py" -exec ./remove_apache_header.sh {} \;
2
+ find ../caffe2 -name " *.h" -exec ./remove_apache_header.sh {} \;
3
+ find ../caffe2 -name " *.cc" -exec ./remove_apache_header.sh {} \;
4
+ find ../caffe2 -name " *.cpp" -exec ./remove_apache_header.sh {} \;
5
+ find ../caffe2 -name " *.cu" -exec ./remove_apache_header.sh {} \;
6
+ find ../caffe2 -name " *.mm" -exec ./remove_apache_header.sh {} \;
7
+ find ../caffe2 -name " *.m" -exec ./remove_apache_header.sh {} \;
You can’t perform that action at this time.
0 commit comments