[kernel] r22812 - in dists/trunk/linux/debian: . patches patches/bugfix/all
Ben Hutchings
benh at moszumanska.debian.org
Wed Jul 8 01:00:57 UTC 2015
Author: benh
Date: Wed Jul 8 01:00:56 2015
New Revision: 22812
Log:
DocBook: Fix duplicate man pages
Added:
dists/trunk/linux/debian/patches/bugfix/all/docbook-fix-duplicate-man-pages.patch
Modified:
dists/trunk/linux/debian/changelog
dists/trunk/linux/debian/patches/series
Modified: dists/trunk/linux/debian/changelog
==============================================================================
--- dists/trunk/linux/debian/changelog Tue Jul 7 18:03:03 2015 (r22811)
+++ dists/trunk/linux/debian/changelog Wed Jul 8 01:00:56 2015 (r22812)
@@ -2,6 +2,7 @@
* Fix more issues that prevent a reproducible build:
- linux-doc: DocBook: generate consistent IDs
+ - linux-doc: DocBook: Fix duplicate man pages
-- Ben Hutchings <ben at decadent.org.uk> Tue, 07 Jul 2015 16:25:05 +0100
Added: dists/trunk/linux/debian/patches/bugfix/all/docbook-fix-duplicate-man-pages.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/trunk/linux/debian/patches/bugfix/all/docbook-fix-duplicate-man-pages.patch Wed Jul 8 01:00:56 2015 (r22812)
@@ -0,0 +1,125 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Wed, 08 Jul 2015 00:32:38 +0100
+Subject: DocBook: Fix duplicate man pages
+Bug-Debian: https://bugs.debian.org/769844
+
+Some kernel-doc sections are included in multiple DocBook files. This
+means the mandocs target will generate the same manual page multiple
+times with different metadata (author name/address and manual title,
+taken from the including DocBook file). If it's invoked in a parallel
+build, the output is nondeterminstic.
+
+For each section that is duplicated, mark the less specific manual's
+inclusion as 'extra' and exclude it during conversion to manual pages.
+Use xmlif for this, as that is bundled with xmlto which we already
+use.
+
+I would have preferred to use more conventional markup for this, but
+each of the following approaches failed:
+
+1. Wrap the extra inclusions with a new element and add a template to
+ the stylesheet to include/exclude them. Unfortunately DocBook XSL
+ doesn't seem to support foreign elements at an intermediate level
+ in the document tree.
+2. Use DocBook profiling. This works but requires passing an absolute
+ path to the profile stylesheet to xmlto, so it's not portable.
+3. Use SGML marked sections. docbook2x can handle these but xmlto
+ chokes on them.
+
+Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
+---
+--- a/Documentation/DocBook/Makefile
++++ b/Documentation/DocBook/Makefile
+@@ -56,6 +56,13 @@ htmldocs: $(HTML)
+
+ MAN := $(patsubst %.xml, %.9, $(BOOKS))
+ mandocs: $(MAN)
++ @dups=$(sed -n 's/.*<refname>\([^<]*\)<\/refname>.*/\1/p' \
++ $(patsubst %, %.noextra, $(BOOKS)))| sort | uniq -d); \
++ if [ -n "$$dups" ]; then \
++ echo >&2 "The following manual pages are generated more than once:"; \
++ printf >&2 '%s\n' "$$dups"; \
++ exit 1; \
++ fi
+ find $(obj)/man -name '*.9' | xargs gzip -nf
+
+ installmandocs: mandocs
+@@ -150,7 +157,7 @@ quiet_cmd_db2html = HTML $@
+ cp $(PNG-$(basename $(notdir $@))) $(patsubst %.html,%,$@); fi
+
+ quiet_cmd_db2man = MAN $@
+- cmd_db2man = if grep -q refentry $<; then xmlto man $(XMLTOFLAGS) -o $(obj)/man $< ; fi
++ cmd_db2man = if grep -q refentry $<; then xmlif excludeextra=1 <$< >$<.noextra && xmlto man $(XMLTOFLAGS) -o $(obj)/man $<.noextra ; fi
+ %.9 : %.xml
+ @(which xmlto > /dev/null 2>&1) || \
+ (echo "*** You need to install xmlto ***"; \
+@@ -217,6 +224,7 @@ clean-files := $(DOCBOOKS) \
+ $(patsubst %.xml, %.ps, $(DOCBOOKS)) \
+ $(patsubst %.xml, %.pdf, $(DOCBOOKS)) \
+ $(patsubst %.xml, %.html, $(DOCBOOKS)) \
++ $(patsubst %, %.noextra, $(DOCBOOKS)) \
+ $(patsubst %.xml, %.9, $(DOCBOOKS)) \
+ $(index)
+
+--- a/Documentation/DocBook/gadget.tmpl
++++ b/Documentation/DocBook/gadget.tmpl
+@@ -488,7 +488,10 @@ These are the same types and constants u
+ side drivers (and usbcore).
+ </para>
+
++<?xmlif if excludeextra='1'?>
++<?xmlif else?>
+ !Iinclude/linux/usb/ch9.h
++<?xmlif fi?>
+ </sect1>
+
+ <sect1 id="core"><title>Core Objects and Methods</title>
+--- a/Documentation/DocBook/kernel-api.tmpl
++++ b/Documentation/DocBook/kernel-api.tmpl
+@@ -58,8 +58,11 @@
+
+ <sect1><title>String Conversions</title>
+ !Elib/vsprintf.c
++<?xmlif if excludeextra='1'?>
++<?xmlif else?>
+ !Finclude/linux/kernel.h kstrtol
+ !Finclude/linux/kernel.h kstrtoul
++<?xmlif fi?>
+ !Elib/kstrtox.c
+ </sect1>
+ <sect1><title>String Manipulation</title>
+@@ -178,7 +181,10 @@ X!Ekernel/module.c
+ <chapter id="hardware">
+ <title>Hardware Interfaces</title>
+ <sect1><title>Interrupt Handling</title>
++<?xmlif if excludeextra='1'?>
++<?xmlif else?>
+ !Ekernel/irq/manage.c
++<?xmlif fi?>
+ </sect1>
+
+ <sect1><title>DMA Channels</title>
+--- a/Documentation/DocBook/device-drivers.tmpl
++++ b/Documentation/DocBook/device-drivers.tmpl
+@@ -194,8 +194,13 @@ X!Edrivers/pnp/system.c
+
+ <chapter id="snddev">
+ <title>Sound Devices</title>
++<?xmlif if excludeextra='1'?>
++<?xmlif else?>
+ !Iinclude/sound/core.h
++<?xmlif fi?>
+ !Esound/sound_core.c
++<?xmlif if excludeextra='1'?>
++<?xmlif else?>
+ !Iinclude/sound/pcm.h
+ !Esound/core/pcm.c
+ !Esound/core/device.c
+@@ -211,6 +216,7 @@ X!Edrivers/pnp/system.c
+ !Esound/core/hwdep.c
+ !Esound/core/pcm_native.c
+ !Esound/core/memalloc.c
++<?xmlif fi?>
+ <!-- FIXME: Removed for now since no structured comments in source
+ X!Isound/sound_firmware.c
+ -->
Modified: dists/trunk/linux/debian/patches/series
==============================================================================
--- dists/trunk/linux/debian/patches/series Tue Jul 7 18:03:03 2015 (r22811)
+++ dists/trunk/linux/debian/patches/series Wed Jul 8 01:00:56 2015 (r22812)
@@ -71,6 +71,7 @@
bugfix/all/make-highlights-deterministic-in-kernel-doc.patch
bugfix/all/remove-timestamps-from-compressed-man-pages.patch
bugfix/all/docbook-generate-consistent-ids.patch
+bugfix/all/docbook-fix-duplicate-man-pages.patch
# Miscellaneous features
features/all/efi-autoload-efi-pstore.patch
More information about the Kernel-svn-changes
mailing list