Update license header and scripts (#8666)
* Update `add_license` script * run script * add `remove duplicate lines script` and run it * Revert changes `English spaces` * strip whitespaces * Revert `GPL` in files with `apache/mit license` * don't append `gpl license` in files with other lic * Don't append `gpl header` in files with other lic. * re-ran script * include c and cpp files too * remove duplicate header * rebase nit
This commit is contained in:
committed by
Marek Kotewicz
parent
3d76417353
commit
98b7c07171
@@ -1,6 +1,20 @@
|
||||
#!/bin/sh
|
||||
#!/usr/bin/env sh
|
||||
|
||||
for f in $(find . -name '*.rs'); do
|
||||
cat license_header $f > $f.new
|
||||
mv $f.new $f
|
||||
PAT_GPL="^// Copyright.*If not, see <http://www.gnu.org/licenses/>\.$"
|
||||
PAT_OTHER="^// Copyright"
|
||||
|
||||
for f in $(find . -type f | egrep '\.(c|cpp|rs)$'); do
|
||||
HEADER=$(head -16 $f)
|
||||
if [[ $HEADER =~ $PAT_GPL ]]; then
|
||||
BODY=$(tail -n +17 $f)
|
||||
cat license_header > temp
|
||||
echo "$BODY" >> temp
|
||||
mv temp $f
|
||||
elif [[ $HEADER =~ $PAT_OTHER ]]; then
|
||||
echo "Other license was found do nothing"
|
||||
else
|
||||
echo "$f was missing header"
|
||||
cat license_header $f > temp
|
||||
mv temp $f
|
||||
fi
|
||||
done
|
||||
|
||||
6
scripts/remove_duplicate_empty_lines.sh
Executable file
6
scripts/remove_duplicate_empty_lines.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
for f in $(find . -name '*.rs'); do
|
||||
cat -s $f > $f.temp
|
||||
mv $f.temp $f
|
||||
done
|
||||
Reference in New Issue
Block a user