Add verify-ports presubmit.

This commit is contained in:
Jonas 'Sortie' Termansen 2022-07-09 20:40:37 +02:00
parent 86f6cdb718
commit 802b0ef1d1
3 changed files with 23 additions and 1 deletions

View File

@ -585,6 +585,7 @@ release: release-arch release-shared
# Presubmit checks # Presubmit checks
presubmit: presubmit:
$(MAKE) verify-ports
$(MAKE) verify-coding-style $(MAKE) verify-coding-style
$(MAKE) verify-manual $(MAKE) verify-manual
$(MAKE) verify-build-tools $(MAKE) verify-build-tools
@ -598,6 +599,9 @@ endif
$(MAKE) verify-headers $(MAKE) verify-headers
@echo ok @echo ok
verify-ports:
build-aux/verify-ports.sh
verify-coding-style: verify-coding-style:
build-aux/verify-coding-style.sh build-aux/verify-coding-style.sh

16
build-aux/verify-ports.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
# Verifies the port(5) files.
set -e
for port in ports/*/*.port; do \
tix-vars -t "$port"
NAME=$(tix-vars "$port" NAME)
if [ "$port" != "ports/$NAME/$NAME.port" ]; then
echo "error: $port should be ports/$NAME/$NAME.port"
exit 1
fi
DEVELOPMENT=$(tix-vars -d unset "$port" DEVELOPMENT)
if [ "$DEVELOPMENT" != unset ]; then
echo "error: $port: DEVELOPMENT should be not be set"
exit 1
fi
done

View File

@ -132,7 +132,9 @@ a remote mirror.
Clean everything except binary packages and the mirror of upstream releases. Clean everything except binary packages and the mirror of upstream releases.
.Sy ( clean-builds , clean-ports , clean-release , clean-sysroot , distclean-ports ) .Sy ( clean-builds , clean-ports , clean-release , clean-sysroot , distclean-ports )
.It Sy presubmit .It Sy presubmit
Verify the coding style is followed Verify the port configuration
.Sy ( verify-ports ) ,
the coding style is followed
.Sy ( verify-coding-style ) , .Sy ( verify-coding-style ) ,
the manual pages does not have lints the manual pages does not have lints
.Sy ( verify-manual ) , .Sy ( verify-manual ) ,