[xml/sgml-pkgs] Bug#214982: docbook2man: patch to get the <date> from the sgml file

Simon Paillard simon.paillard at resel.enst-bretagne.fr
Sun Nov 19 23:22:23 UTC 2006


Package: docbook-utils
Version: 0.6.14-1
Followup-For: Bug #214982

Hello,

For the moment, docbook2man doesn't use the tag date in <date> </date>
to but `date "+%d %B %Y"`, and thus depend on the current locale.

<refentry>
  <docinfo>
    <date>06 September 2003</>
  </docinfo>
</refentry>

A patch against /usr/share/perl5/sgmlspl-specs/docbook2man-spec.pl
allows to use the date written in the source SGML file (which can be
localized) instead of the current date.

However, if no correct date tag is present in the SGML file, the date
written in the manpage will depend on the current locale.

I think considering the update of the docbook2x package would be a
better option than patching a software almost dead upstream .. (last
revision 11.02.2004)

Regards,

-- 
Simon Paillard

-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (999, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-2-686
Locale: LANG=fr_FR at euro, LC_CTYPE=fr_FR at euro (charmap=ISO-8859-15)

Versions of packages docbook-utils depends on:
ii  docbook-dsssl            1.79-4          modular DocBook DSSSL stylesheets,
ii  jadetex                  3.13-7.1        generator of printable output from
ii  lynx                     2.8.5-2sarge2.1 Text-mode WWW Browser
ii  perl                     5.8.8-6.1       Larry Wall's Practical Extraction 
ii  sgmlspl                  1.03ii-31       SGMLS-based example Perl script fo
ii  sp                       1.3.4-1.2.1-47  James Clark's SGML parsing tools

Versions of packages docbook-utils recommends:
ii  docbook-xml                   4.4-5      standard XML documentation system,

-- no debconf information
-------------- next part --------------
--- docbook2man-spec.pl.bak	2006-11-19 19:50:12.000000000 +0100
+++ docbook2man-spec.pl	2006-11-19 20:58:09.000000000 +0100
@@ -278,8 +278,9 @@
 .\\" etc. to Steve Cheng <steve\@ggi-project.org>.
 _END_BANNER
 
-	my $manpage_date = `date "+%d %B %Y"`;
-		
+	my $date = `date "+%d %B %Y"`;
+	my $manpage_date = $manpage_date || $date ;
+
 	output '.TH "';
 	
 	# If the title is not mixed-case, convention says to
@@ -292,7 +293,7 @@
 	}
 	
 	output  '" "', fold_string($manpage_sect), 
-		'" "', fold_string(`date "+%d %B %Y"`), 
+		'" "', fold_string($manpage_date), 
 		'" "', $manpage_misc, 
 		'" "', $manpage_manual, 
 		"\"\n";
@@ -568,6 +569,15 @@
 sgml('</ATTRIBUTION>', sub { $_[0]->parent->ext->{'attribution'} = pop_output(); });
 
 
+sgml('<DATE>', sub {
+	save_cdata();
+});
+sgml('</DATE>', sub { 
+	$manpage_date = fold_string(pop_output());
+	$raw_cdata--;
+});
+
+
 # IGNORE.
 sgml('<DOCINFO>', sub { push_output('nul'); });
 sgml('</DOCINFO>', sub { pop_output(); });


More information about the debian-xml-sgml-pkgs mailing list