File: licensecheck.sh

package info (click to toggle)
golang-github-digitalocean-go-qemu 0.0~git20250212.ee9b066-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 860 kB
  • sloc: sh: 34; makefile: 3
file content (20 lines) | stat: -rwxr-xr-x 366 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
#!/bin/bash

# Verify that the correct license block is present in all Go source
# files.
EXPECTED=$(cat ./scripts/license.txt)

# Scan each Go source file for license.
EXIT=0
GOFILES=$(find . -name "*.go")

for FILE in $GOFILES; do
	BLOCK=$(head -n 14 $FILE)

	if [ "$BLOCK" != "$EXPECTED" ]; then
		echo "file missing license: $FILE"
		EXIT=1
	fi
done

exit $EXIT