2024-03-25 12:47:34 -04:00
|
|
|
#!/bin/sh -e
|
2024-03-25 13:06:29 -04:00
|
|
|
# SPDX-FileCopyrightText: 2024 Redict Contributors
|
|
|
|
# SPDX-License-Identifier: LGPL-3.0-only
|
|
|
|
|
2024-03-25 12:47:34 -04:00
|
|
|
signoff() {
|
|
|
|
if ! git log --format='%b' HEAD^.. | grep 'Signed-off-by' >/dev/null
|
|
|
|
then
|
2024-03-25 12:54:11 -04:00
|
|
|
echo "Missing sign-off!" >&2
|
|
|
|
echo "Run 'git commit --amend -s' to fix" >&2
|
|
|
|
echo "See CONTRIBUTING.md" >&2
|
2024-03-25 12:47:34 -04:00
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2024-03-25 13:06:29 -04:00
|
|
|
licenses() {
|
|
|
|
if ! chronic sh -c "reuse lint 2>/dev/null"
|
|
|
|
then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2024-03-25 12:47:34 -04:00
|
|
|
exitcode=0
|
2024-03-25 13:06:29 -04:00
|
|
|
for step in signoff licenses
|
2024-03-25 12:47:34 -04:00
|
|
|
do
|
|
|
|
if ! $step
|
|
|
|
then
|
|
|
|
exitcode=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ $exitcode -eq 0 ]
|
|
|
|
then
|
|
|
|
echo "Everything looks good!"
|
|
|
|
fi
|
|
|
|
exit $exitcode
|