List:Internals« Previous MessageNext Message »
From:paul Date:June 15 2005 5:48am
Subject:bk commit - mysqldoc@docsrva tree (paul:1.2787)
View as plain text  
Below is the list of changes that have just been committed into a local
mysqldoc repository of paul. When paul does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet
  1.2787 05/06/14 22:48:05 paul@stripped +3 -0
  Move script back.

  DocsX/Makefile
    1.72 05/06/14 22:48:04 paul@stripped +1 -1
    Move script back.

  DocsX/chapterfmt.pl
    1.6 05/06/14 22:44:54 paul@stripped +0 -0
    Rename: tools/chapterfmt.pl -> DocsX/chapterfmt.pl

  refman/chapterfmt.pl
    1.1 05/06/14 22:39:10 paul@stripped +104 -0

  refman/chapterfmt.pl
    1.0 05/06/14 22:39:09 paul@stripped +0 -0
    BitKeeper file /src/extern/MySQL/bk/mysqldoc/refman/chapterfmt.pl

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	paul
# Host:	snake-hub.snake.net
# Root:	/src/extern/MySQL/bk/mysqldoc

--- 1.71/DocsX/Makefile	Tue Jun 14 21:43:23 2005
+++ 1.72/DocsX/Makefile	Tue Jun 14 22:48:04 2005
@@ -534,7 +534,7 @@
 		"Installing MySQL on NetWare" \
 		> $@
 
-CHAPTERFMT = $(TOOLS_DIR)/chapterfmt.pl
+CHAPTERFMT = ./chapterfmt.pl
 
 ReadMe.html: manual.xml
 	$(CHAPTERFMT) --no-rebuild mac-os-x-installation.html
--- New file ---
+++ refman/chapterfmt.pl	05/06/14 22:39:09
#! /usr/bin/perl -w

# chapterfmt.pl - format a single chapter (or section) from the manual.

# Syntax: chapterfmt.pl node-id.{html,xhtml,pdf,...}
#     or: chapterfmt.pl node-id.lang.{html,xhtml,pdf,...}

# How it works:
# - Builds the monolithic manual.xml or manual.lang.xml file (removes
#   it first to force it to be rebuilt)
# - Copies manual{.lang}.xml to node-id{.lang}.xml.
# - Invokes make to build rootid{.lang}.ofmt, where ofmt is the
#	output format.  The trick here is that we define
#	XSLTPROC_EXTRA_FLAGS as "--stringparam rootid node-id",
#	which causes xsltproc to read the entire input file but
#	format only the element (a <chapter> or <section>) that has
#	the given node-id value as its id attribute.  This way,
#	we get the section formatted with the proper numbering.
#	(If we formatted only the individual section, TOC
#	entries would always be numbered beginning with 1.  Also,
#	cross-references to other sections would show up as ???.)

# Who to blame:
# Paul DuBois
# paul@stripped
# 2004-09-16

# 2004-11-10
# - Add --no-rebuild option to not rebuild the monolithic manual from the
#   split manual.
# 2004-11-11
# - Remember to build the -toc-entries.xml file for .txt output.

use Getopt::Long;
$Getopt::Long::ignorecase = 0; # options are case sensitive
$Getopt::Long::bundling = 1;   # allow short options to be bundled

my $prog = "chapterfmt.pl";
my $usage = <<EOF;
Usage: $prog [options] target ...

Options:
--help
    Print this message
--no-rebuild
    Do not rebuild monolithic manual from split manual.
    (Assume the monolithic manual is up to date.)

Each target should be of the form chapter-name.ofmt or chapter-name.lang.ofmt

ofmt is the output format: html, xhtml, pdf, etc.
lang, if present, is the two-digit language code.  The English manual
is used if omitted.
EOF

# Variables for command line options; most are undefined initially.
my $help;
my $no_rebuild;

GetOptions (
	"help"			=> \$help,			# print help message
	"no-rebuild"	=> \$no_rebuild		# don't rebuild monolithic manual
) or die "$usage\n";

die  "$usage\n" if defined $help;

@ARGV or die "$usage\n";

$no_rebuild = defined ($no_rebuild);	# convert defined/undefined to boolean

format_target (shift @ARGV) while @ARGV;

exit (0);

sub format_target
{
my $target = shift;
my @parts = split (/\./, $target);
my ($chapname, $lang, $ofmt);

	if (@parts == 2)
	{
		($chapname, $ofmt) = @parts;
		$lang = "";
	}
	elsif (@parts == 3)
	{
		($chapname, $lang, $ofmt) = @parts;
		$lang = ".$lang";
	}
	else
	{
		die "bad target name: $target\n$usage\n";
	}

	system "cp manual$lang.xml $chapname$lang.xml";
	if ($ofmt eq "txt")
	{
		system "make manual$lang-toc-entries.xml";
		system "cp manual$lang-toc-entries.xml $chapname$lang-toc-entries.xml";
	}
	system "make $chapname$lang.$ofmt"
			. " XSLTPROC_EXTRA_FLAGS=\"--stringparam rootid $chapname\"";
}
Thread
bk commit - mysqldoc@docsrva tree (paul:1.2787)paul16 Jun