diff options
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | docs/api/network-manager-docs.xml | 9 | ||||
-rw-r--r-- | docs/libnm/libnm-docs.xml | 7 | ||||
-rw-r--r-- | docs/meson.build | 2 | ||||
-rwxr-xr-x | tools/check-docs.sh | 37 |
5 files changed, 33 insertions, 24 deletions
diff --git a/Makefile.am b/Makefile.am index b69acc73a5..0f13358ccb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -462,7 +462,7 @@ EXTRA_DIST += \ introspection/meson.build check-docs: - $(srcdir)/tools/check-docs.sh "$(srcdir)" + $(srcdir)/tools/check-docs.sh "$(srcdir)" "$(builddir)" check_local += check-docs diff --git a/docs/api/network-manager-docs.xml b/docs/api/network-manager-docs.xml index ec2712474b..06ac37415d 100644 --- a/docs/api/network-manager-docs.xml +++ b/docs/api/network-manager-docs.xml @@ -257,15 +257,6 @@ <title>Types</title> <xi:include href="../../libnm-core/nm-dbus-types.xml"/> </chapter> - - <!-- - These are obsolete and intentionally omitted from the manual since they can't - appear on the D-Bus API of the present version of NetworkManager. - Keep them here so that "make check" won't think that they were skipped accidentally . - <xi:include href="dbus-org.freedesktop.NetworkManager.Device.WiMax.xml"/> - <xi:include href="dbus-org.freedesktop.NetworkManager.WiMax.Nsp.xml"/> - --> - </part> <part id="secret-agents"> diff --git a/docs/libnm/libnm-docs.xml b/docs/libnm/libnm-docs.xml index 3597d84972..eb4f6cf585 100644 --- a/docs/libnm/libnm-docs.xml +++ b/docs/libnm/libnm-docs.xml @@ -294,13 +294,6 @@ print ("NetworkManager version " + client.get_version())]]></programlisting></in <xi:include href="xml/nm-vpn-plugin-old.xml"/> </chapter> - <!-- - These don't contain any useful documentation. Keep them here, - so that tools/check-docs.sh knows that we did omit them intentionally. - <xi:include href="xml/nm-core-enum-types.xml"/> - <xi:include href="xml/nm-enum-types.xml"/> - --> - <chapter id="object-tree"> <title>Object Hierarchy</title> <xi:include href="xml/tree_index.sgml"/> diff --git a/docs/meson.build b/docs/meson.build index 1fb21fb47d..92e6d6e9b9 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -14,5 +14,5 @@ endif test( 'check-docs', find_program(join_paths(meson.source_root(), 'tools', 'check-docs.sh')), - args: [meson.source_root()] + args: [meson.source_root(), meson.build_root()] ) diff --git a/tools/check-docs.sh b/tools/check-docs.sh index b7623fed88..b6fca6e0d9 100755 --- a/tools/check-docs.sh +++ b/tools/check-docs.sh @@ -2,6 +2,8 @@ set -e +export LANG=C + die() { printf '%s\n' "$@" >&2 exit 1 @@ -15,25 +17,48 @@ word_regex() { } same_lines() { - diff <(printf "%s\n" "$1" | sed '/^$/d' | sort) \ - <(printf "%s\n%s\n" "$2" "$3" | sed '/^$/d' | sort) >&2 + 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 F1="$(sed -n 's,^ <xi:include href="dbus-\([^"]*\.xml\)"/>$,\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" "$F2" ; then +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. F1="$(sed -n 's/.*<xi:include href="xml\/\([^"]*\)\.xml".*/\1/p' "$SOURCEDIR"docs/libnm/libnm-docs.xml)" +F1_EXTRA=" +nm-core-enum-types +nm-enum-types +" F2="$(grep -l "$(sed -n 's/^[\t ]*\(.*_get_type\);/\1/p' "$SOURCEDIR"libnm/libnm.ver | word_regex)" \ - "$SOURCEDIR"libnm/*.h \ - "$SOURCEDIR"libnm-core/*.h \ + $(libnm_headers "$SOURCEDIR" "$BUILDDIR") \ | sed 's,.*/\([^/]\+\)\.h$,\1,')" F2_EXTRA=" annotation-glossary @@ -43,6 +68,6 @@ nm-errors nm-utils nm-version " -if ! same_lines "$F1" "$F2" "$F2_EXTRA"; then +if ! same_lines "$F1"$'\n'"$F1_EXTRA" "$F2"$'\n'"$F2_EXTRA"; then die "*** Error: libnm classes not included in docs/libnm/libnm-docs.xml ***" fi |