Messages in this thread Patch in this message | | | Date | Sun, 22 Apr 2007 17:59:25 +0200 | From | Borislav Petkov <> | Subject | [PATCHv4] [KERNEL-DOC] kill warnings when building mandocs (final) |
| |
We were simply reinventing the wheel until now. Here's the final version of the patch which is also the simplest solution (if you hold your eyes open at all time, you'll see that KERNELVERSION is already exported by the main Makefile and there's no need for changing the build string in Documentation/DocBook/Makefile):
----- From: Borislav Petkov <bbpetkov@yahoo.de>
This patch shuts warnings of the sort:
make -C /mnt/samsung_200/sam/kernel/trees/21-rc6/build \ KBUILD_SRC=/mnt/samsung_200/sam/kernel/trees/21-rc6 \ KBUILD_EXTMOD="" -f /mnt/samsung_200/sam/kernel/trees/21-rc6/Makefile mandocs make -f /mnt/samsung_200/sam/kernel/trees/21-rc6/scripts/Makefile.build obj=scripts/basic make -f /mnt/samsung_200/sam/kernel/trees/21-rc6/scripts/Makefile.build obj=Documentation/DocBook mandocs SRCTREE=/mnt/samsung_200/sam/kernel/trees/21-rc6/ /mnt/samsung_200/sam/kernel/trees/21-rc6/build/scripts/basic/docproc doc /mnt/samsung_200/sam/kernel/trees/21-rc6/Documentation/DocBook/wanbook.tmpl >Documentation/DocBook/wanbook.xml if grep -q refentry Documentation/DocBook/wanbook.xml; then xmlto man -m /mnt/samsung_200/sam/kernel/trees/21-rc6/Documentation/DocBook/stylesheet.xsl -o Documentation/DocBook/man Documentation/DocBook/wanbook.xml ; gzip -f Documentation/DocBook/man/*.9; fi Note: meta version: No productnumber or alternative sppp_close Note: meta version: No refmiscinfo@class=version sppp_close Note: Writing sppp_close.9 Note: meta version: No productnumber or alternative sppp_open Note: meta version: No refmiscinfo@class=version sppp_open
by adding a RefMiscInfo xml tag in the form of the current kernel version to the function, struct and enum definitions in files included by kernel-doc when building 'mandocs'. However, the version string appears truncated on the manpage due to some constraints in the xml DTD for the man header, I believe, for the troff output is truncated too.
The current patch improves upon previous versions by reading the kernel version directly from the enclosing build environment exported by the main Makefile.
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de> CC: Randy Dunlap <randy.dunlap@oracle.com>
--- Index: 21-rc7/scripts/kernel-doc =================================================================== --- 21-rc7.orig/scripts/kernel-doc +++ 21-rc7/scripts/kernel-doc @@ -326,6 +326,15 @@ while ($ARGV[0] =~ m/^-(.*)/) { } } +# get kernel version from env +sub get_kernel_version() { + my $version; + + if (defined($ENV{'KERNELVERSION'})) { + $version = $ENV{'KERNELVERSION'}; + } + return $version; +} # generate a sequence of code that will splice in highlighting information # using the s// operator. @@ -592,6 +601,7 @@ sub output_function_xml(%) { print "<refmeta>\n"; print " <refentrytitle><phrase>".$args{'function'}."</phrase></refentrytitle>\n"; print " <manvolnum>9</manvolnum>\n"; + print " <refmiscinfo class=\"version\">" . get_kernel_version() . "</refmiscinfo>\n"; print "</refmeta>\n"; print "<refnamediv>\n"; print " <refname>".$args{'function'}."</refname>\n"; @@ -668,6 +678,7 @@ sub output_struct_xml(%) { print "<refmeta>\n"; print " <refentrytitle><phrase>".$args{'type'}." ".$args{'struct'}."</phrase></refentrytitle>\n"; print " <manvolnum>9</manvolnum>\n"; + print " <refmiscinfo class=\"version\">" . get_kernel_version() . "</refmiscinfo>\n"; print "</refmeta>\n"; print "<refnamediv>\n"; print " <refname>".$args{'type'}." ".$args{'struct'}."</refname>\n"; @@ -752,6 +763,7 @@ sub output_enum_xml(%) { print "<refmeta>\n"; print " <refentrytitle><phrase>enum ".$args{'enum'}."</phrase></refentrytitle>\n"; print " <manvolnum>9</manvolnum>\n"; + print " <refmiscinfo class=\"version\">" . get_kernel_version() . "</refmiscinfo>\n"; print "</refmeta>\n"; print "<refnamediv>\n"; print " <refname>enum ".$args{'enum'}."</refname>\n"; -- Regards/Gruß, Boris. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |