|
Lines 42-58
Link Here
|
| 42 |
|
42 |
|
| 43 |
# List of all files missing copyrights |
43 |
# List of all files missing copyrights |
| 44 |
touch BadOrMissingCopyrights |
44 |
touch BadOrMissingCopyrights |
|
|
45 |
touch ThirdPartyCopyrights |
| 45 |
cat CheckedFiles | while read i; do |
46 |
cat CheckedFiles | while read i; do |
| 46 |
if [[ `grep -c "http://www.eclipse.org/legal/epl-v10.html" "$i"` = 0 || `grep -c "Copyright" "$i"` = 0 ]];then |
47 |
if [[ `grep -c "http://www.eclipse.org/legal/epl-v10.html" "$i"` = 0 || `grep -c "Copyright" "$i"` = 0 ]];then |
| 47 |
echo $i >>BadOrMissingCopyrights |
48 |
echo $i >>BadOrMissingCopyrights |
| 48 |
else |
49 |
else |
| 49 |
echo $i >>FilesWithCopyrights |
50 |
{ |
|
|
51 |
if [[ `grep "Copyright" "$i" | egrep -c 'IBM|Intel|Scapa'` == 0 ]] |
| 52 |
then |
| 53 |
echo $i >>ThirdPartyCopyrights |
| 54 |
else |
| 55 |
echo $i >>FilesWithCopyrights |
| 56 |
fi |
| 57 |
} |
| 50 |
fi |
58 |
fi |
| 51 |
done |
59 |
done |
| 52 |
|
60 |
|
| 53 |
if [[ ! -s BadOrMissingCopyrights ]]; |
61 |
if [[ ! -s BadOrMissingCopyrights ]]; |
| 54 |
then echo "This report is clean :)" >> BadOrMissingCopyrights |
62 |
then echo "This report is clean :)" >> BadOrMissingCopyrights |
| 55 |
fi |
63 |
fi |
|
|
64 |
if [[ ! -s ThirdPartyCopyrights ]]; |
| 65 |
then echo "No Third Party Copyrighted files found." >> ThirdPartyCopyrights |
| 66 |
fi |
| 56 |
|
67 |
|
| 57 |
# Generate report with incorrect copyright dates |
68 |
# Generate report with incorrect copyright dates |
| 58 |
touch NeedUpdate |
69 |
touch NeedUpdate |
|
Lines 61-67
Link Here
|
| 61 |
do |
72 |
do |
| 62 |
yr=`ls -l --time-style=+%Y "$FILE" | awk '{ print $6 }'` |
73 |
yr=`ls -l --time-style=+%Y "$FILE" | awk '{ print $6 }'` |
| 63 |
query=`grep -L "Copyright.*$yr" "$FILE"` |
74 |
query=`grep -L "Copyright.*$yr" "$FILE"` |
| 64 |
|
75 |
|
| 65 |
# Include the file in copyright report if copyright year doesn't match last modified date |
76 |
# Include the file in copyright report if copyright year doesn't match last modified date |
| 66 |
if [[ "X$query" != "X" ]]; then |
77 |
if [[ "X$query" != "X" ]]; then |
| 67 |
let count++ |
78 |
let count++ |
|
Lines 74-79
Link Here
|
| 74 |
fi |
85 |
fi |
| 75 |
|
86 |
|
| 76 |
# Copies all the reports to the published directory |
87 |
# Copies all the reports to the published directory |
| 77 |
for file in Patterns CheckedFiles BadOrMissingCopyrights FilesWithCopyrights NeedUpdate; do |
88 |
for file in Patterns CheckedFiles BadOrMissingCopyrights FilesWithCopyrights NeedUpdate ThirdPartyCopyrights; do |
| 78 |
cat "$file" >> "$publishDir/$file" |
89 |
cat "$file" >> "$publishDir/$file" |
| 79 |
done |
90 |
done |