File: check_license.sh

package info (click to toggle)
libdmtx 0.7.8-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 2,108 kB
  • sloc: ansic: 10,638; sh: 253; makefile: 154; perl: 28
file content (29 lines) | stat: -rwxr-xr-x 560 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh

FILE="$1"

TEST1="^ \* libdmtx - Data Matrix Encoding/Decoding Library\$"
TEST2="^ \* See LICENSE file in the main project directory for full\$"
TEST3="^ \* terms of use and distribution.\$"
TEST4="^ \* Vadim A. Misbakh-Soloviov\$"

COUNT=0

grep --silent "$TEST1" $FILE
COUNT=$(( COUNT + $? ))

grep --silent "$TEST2" $FILE
COUNT=$(( COUNT + $? ))

grep --silent "$TEST3" $FILE
COUNT=$(( COUNT + $? ))

grep --silent "$TEST4" $FILE
COUNT=$(( COUNT + $? ))

if [[ "$COUNT" -gt 0 ]]; then
   echo "Missing license text in $FILE"
   exit 1
fi

exit 0