File: check_license.sh

package info (click to toggle)
dmtx-utils 0.7.6-1.1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 484 kB
  • sloc: ansic: 2,737; sh: 154; makefile: 124; perl: 28
file content (25 lines) | stat: -rwxr-xr-x 509 bytes parent folder | download | duplicates (5)
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
#!/bin/sh

FILE="$1"

TEST1="^modify it under the terms of the GNU Lesser General Public\$"
TEST2="^MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\.  See the GNU\$"
TEST3="^You should have received a copy of the GNU Lesser General Public\$"

COUNT=0

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

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

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

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

exit 0