diff options
author | Stefan Sauer <ensonic@users.sf.net> | 2013-06-16 14:45:08 +0200 |
---|---|---|
committer | Stefan Sauer <ensonic@users.sf.net> | 2013-06-16 14:45:08 +0200 |
commit | 128763bb74627a021a4828085317bb6de9929f17 (patch) | |
tree | 5f242c98144fbb858e543170801c2b24f3813b7c /docs | |
parent | 1dea024564467d2d6ae0952a3f640c8e7db6c7e4 (diff) |
docs: check for broken links in docs
The check is done using curl (if available). It lists the curl exit code + http
status code (for those > 399) together with the use of the url in the code. The
check is not fatal.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/manuals.mak | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/docs/manuals.mak b/docs/manuals.mak index 353650ce1..c0fec85da 100644 --- a/docs/manuals.mak +++ b/docs/manuals.mak @@ -166,7 +166,20 @@ $(BUILDIMAGESDIR)/%.ps: %.png # make sure xml validates properly check-local: $(BUILDDIR)/$(MAIN) @cp -f $(srcdir)/../image-png $(BUILDDIR)/image.entities - cd $(BUILDDIR) && xmllint -noout -valid $(MAIN) + @cd $(BUILDDIR) && xmllint -noout -valid $(MAIN) + @cd $(BUILDDIR) && \ + if [ `which curl` ]; then \ + links=`$(XSLTPROC) $(XSLTPROC_FLAGS) --xinclude $(abs_top_srcdir)/docs/list-ulink.xsl $(MAIN) | egrep '^http' | sort | uniq` && \ + have_error=0 && \ + for link in $$links; do \ + code=`curl -s -m20 -o /dev/null -I -w "%{http_code}" $$link`; \ + if [ \( $$? -ne 0 \) -o \( $$code -gt 399 \) ]; then \ + echo "exit_status=$$?, http_code=$$code: $$link"; \ + grep -Hnr "$$link" .; \ + have_error=1; \ + fi; \ + done \ + fi # avoid 'cp: cannot create regular file `build/image.entities': File exists' # errors during 'make distcheck' by disabling parallel builds |