mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bbpetkov@yahoo.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Randy Dunlap <randy.dunlap@oracle.com>,
	lkml <linux-kernel@vger.kernel.org>
Subject: [PATCHv3] [KERNEL-DOC] kill warnings when building mandocs
Date: Sun, 22 Apr 2007 09:40:36 +0200	[thread overview]
Message-ID: <20070422074036.GA3934@gollum.tnic> (raw)
In-Reply-To: <20070421002045.36a663ba.akpm@linux-foundation.org>

On Sat, Apr 21, 2007 at 12:20:45AM -0700, Andrew Morton wrote:
> On Thu, 19 Apr 2007 09:19:32 +0200 Borislav Petkov <bbpetkov@yahoo.de> wrote:
>
> we already did this in the top-level Makefile.  It's in $(KERNELVERSION)
> and is printed by `make kernelversion'.
> 
> Cannot we use that info somehow?

Yes, we can. I personally like this one even better.


-----
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. In order to do so, the
KERNELVERSION variable is passed onto the shell from within the Makefile build
command string.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
CC: Randy Dunlap <randy.dunlap@oracle.com>

---

Index: 21-rc7/Documentation/DocBook/Makefile
===================================================================
--- 21-rc7.orig/Documentation/DocBook/Makefile
+++ 21-rc7/Documentation/DocBook/Makefile
@@ -147,7 +147,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 $< ; gzip -f $(obj)/man/*.9; fi
+      cmd_db2man = if grep -q refentry $<; then KERNELVERSION=$(KERNELVERSION) xmlto man $(XMLTOFLAGS) -o $(obj)/man $< ; gzip -f $(obj)/man/*.9; fi
 %.9 : %.xml
 	@(which xmlto > /dev/null 2>&1) || \
 	 (echo "*** You need to install xmlto ***"; \
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.

  reply	other threads:[~2007-04-22  7:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-13  9:14 [PATCH] " Borislav Petkov
2007-04-13  9:29 ` Borislav Petkov
2007-04-18 17:16   ` Randy Dunlap
2007-04-19  6:30     ` Borislav Petkov
2007-04-19  7:19       ` [PATCHv2] " Borislav Petkov
2007-04-19 16:21         ` Randy Dunlap
2007-04-20  5:59           ` Borislav Petkov
2007-04-21  7:20         ` Andrew Morton
2007-04-22  7:40           ` Borislav Petkov [this message]
2007-04-22  7:49           ` [PATCHv3] [KERNEL-DOC] kill warnings when building mandocs (fixed whitespaces) Borislav Petkov
2007-04-22 15:59             ` [PATCHv4] [KERNEL-DOC] kill warnings when building mandocs (final) Borislav Petkov
2007-04-14 16:13 ` [PATCH] [KERNEL-DOC] kill warnings when building mandocs Randy Dunlap
2007-04-15  7:10   ` Borislav Petkov
2007-04-17 10:49     ` Borislav Petkov
2007-04-18 16:03       ` Randy Dunlap
2007-04-19  6:20         ` Borislav Petkov
2007-04-19 15:53           ` Randy Dunlap
2007-04-20  6:02             ` Borislav Petkov
2007-04-25 20:22               ` Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070422074036.GA3934@gollum.tnic \
    --to=bbpetkov@yahoo.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®