From 802b0ef1d1f5cd32628883c9a5de247255b7d2e0 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sat, 9 Jul 2022 20:40:37 +0200 Subject: [PATCH] Add verify-ports presubmit. --- Makefile | 4 ++++ build-aux/verify-ports.sh | 16 ++++++++++++++++ share/man/man7/development.7 | 4 +++- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100755 build-aux/verify-ports.sh diff --git a/Makefile b/Makefile index dd4d37db..90f62e0b 100644 --- a/Makefile +++ b/Makefile @@ -585,6 +585,7 @@ release: release-arch release-shared # Presubmit checks presubmit: + $(MAKE) verify-ports $(MAKE) verify-coding-style $(MAKE) verify-manual $(MAKE) verify-build-tools @@ -598,6 +599,9 @@ endif $(MAKE) verify-headers @echo ok +verify-ports: + build-aux/verify-ports.sh + verify-coding-style: build-aux/verify-coding-style.sh diff --git a/build-aux/verify-ports.sh b/build-aux/verify-ports.sh new file mode 100755 index 00000000..5023f639 --- /dev/null +++ b/build-aux/verify-ports.sh @@ -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 diff --git a/share/man/man7/development.7 b/share/man/man7/development.7 index 20fc0d0e..db863dea 100644 --- a/share/man/man7/development.7 +++ b/share/man/man7/development.7 @@ -132,7 +132,9 @@ a remote mirror. Clean everything except binary packages and the mirror of upstream releases. .Sy ( clean-builds , clean-ports , clean-release , clean-sysroot , distclean-ports ) .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 ) , the manual pages does not have lints .Sy ( verify-manual ) ,