From 964ae8cc391520440cf5aa13e2b9cc34850ea6c2 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Tue, 26 Feb 2019 19:01:41 +0100 Subject: New upstream version 1.14.6 --- tools/check-docs.sh | 79 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 65 insertions(+), 14 deletions(-) (limited to 'tools/check-docs.sh') diff --git a/tools/check-docs.sh b/tools/check-docs.sh index 9dcdb1ef..b6fca6e0 100755 --- a/tools/check-docs.sh +++ b/tools/check-docs.sh @@ -1,22 +1,73 @@ -#!/bin/sh +#!/bin/bash -SOURCEDIR=$1 +set -e + +export LANG=C + +die() { + printf '%s\n' "$@" >&2 + exit 1 +} + +word_regex() { + tr '\n|<>\\' ' ' \ + | sed -e 's, *$,\\>,' \ + -e 's,^ *,\\<,' \ + -e 's, \+,\\>\\|\\<,g' +} + +same_lines() { + diff <(printf "%s\n" "$1" | sed '/^$/d' | sort) \ + <(printf "%s\n" "$2" | sed '/^$/d' | sort) >&2 +} + +libnm_headers() { + ( + ls -1 "$1"libnm/*.h "$1"libnm-core/*.h + if [ -n "$2" ]; then + ls -1 "$2"/libnm/*.h "$2"/libnm-core/*.h + fi + ) | sort | uniq +} + + +SOURCEDIR="$1" +BUILDDIR="$2" +if test "$SOURCEDIR" == "$BUILDDIR"; then + BUILDDIR= +fi [ -n "$SOURCEDIR" ] && SOURCEDIR="$SOURCEDIR/" + # Check that the D-Bus API docs contain all known interfaces -if (sed -n 's/.*&2; then - echo "*** Error: D-Bus interfaces not included in docs/api/network-manager-docs.xml ***" >&2 - exit 1 +F1="$(sed -n 's,^ $,\1,p' "$SOURCEDIR"docs/api/network-manager-docs.xml)" +F1_EXTRA=" +org.freedesktop.NetworkManager.Device.WiMax.xml +org.freedesktop.NetworkManager.WiMax.Nsp.xml +" +F2="$(cd "$SOURCEDIR"introspection; ls -1 *.xml)" +if ! same_lines "$F1"$'\n'"$F1_EXTRA" "$F2" ; then + die "*** Error: D-Bus interfaces not included in docs/api/network-manager-docs.xml ***" fi + # Check that files that define types that are in public libnm API are included in libnm documentation. -# Don't complain about readability or I'll rewrite this in Perl. -if (sed -n 's/.*&2; then - echo "*** Error: libnm classes not included in docs/libnm/libnm-docs.xml ***" >&2 - exit 1 +F1="$(sed -n 's/.*