summaryrefslogtreecommitdiffstats
path: root/docs/makedocs.pl
diff options
context:
space:
mode:
authormozilla%colinogilvie.co.uk <>2006-07-20 06:37:44 +0200
committermozilla%colinogilvie.co.uk <>2006-07-20 06:37:44 +0200
commit7b7974745ec094f0db9bc42bf0025657ae77df65 (patch)
tree8777d529200a6a2f686d2e9456a356cdf7918455 /docs/makedocs.pl
parent439114b135b22bd4d1ea98d8c3e6c102806ebf1c (diff)
downloadbugzilla-7b7974745ec094f0db9bc42bf0025657ae77df65.tar.gz
bugzilla-7b7974745ec094f0db9bc42bf0025657ae77df65.tar.xz
Bug 344731: Update documentation minimum versions automatically
Patch by Colin Ogilvie <colin.ogilvie@gmail.com>; r=mkanat; a=myk
Diffstat (limited to 'docs/makedocs.pl')
-rw-r--r--docs/makedocs.pl41
1 files changed, 39 insertions, 2 deletions
diff --git a/docs/makedocs.pl b/docs/makedocs.pl
index 5a001ea06..871fb3370 100644
--- a/docs/makedocs.pl
+++ b/docs/makedocs.pl
@@ -20,6 +20,7 @@
#
# Contributor(s): Matthew Tuck <matty@chariot.net.au>
# Jacob Steenhagen <jake@bugzilla.org>
+# Colin Ogilvie <colin.ogilvie@gmail.com>
# This script compiles all the documentation.
@@ -27,6 +28,44 @@ use diagnostics;
use strict;
use File::Basename;
+use lib("..");
+use Bugzilla::Install::Requirements qw (REQUIRED_MODULES OPTIONAL_MODULES);
+use Bugzilla::Constants qw (DB_MODULE);
+chdir dirname($0);
+
+###############################################################################
+# Generate minimum version list
+###############################################################################
+
+my $modules = REQUIRED_MODULES;
+my $opt_modules = OPTIONAL_MODULES;
+
+open(ENTITIES, '>', 'xml/bugzilla.ent') or die('Could not open xml/bugzilla.ent: ' . $!);
+print ENTITIES '<?xml version="1.0"?>' ."\n\n";
+print ENTITIES '<!-- Module Versions -->' . "\n";
+foreach my $module (@$modules, @$opt_modules)
+{
+ my $name = $module->{'name'};
+ $name =~ s/::/-/g;
+ $name = lc($name);
+ #This needs to be a string comparison, due to the modules having
+ #version numbers like 0.9.4
+ my $version = $module->{'version'} eq 0 ? 'any' : $module->{'version'};
+ print ENTITIES '<!ENTITY min-' . $name . '-ver "'.$version.'">' . "\n";
+}
+print ENTITIES "\n <!-- Database Versions --> \n";
+
+my $db_modules = DB_MODULE;
+foreach my $db (keys %$db_modules) {
+ my $name = $db_modules->{$db}->{'dbd'};
+ $name =~ s/::/-/g;
+ $name = lc($name);
+ my $version = $db_modules->{$db}->{'dbd_version'} eq 0 ? 'any' : $db_modules->{$db}->{'dbd_version'};
+ my $db_version = $db_modules->{$db}->{'db_version'};
+ print ENTITIES '<!ENTITY min-' . $name . '-ver "'.$version.'">' . "\n";
+ print ENTITIES '<!ENTITY min-' . lc($db) . '-ver "'.$db_version.'">' . "\n";
+}
+close(ENTITIES);
###############################################################################
# Environment Variable Checking
@@ -67,8 +106,6 @@ sub MakeDocs {
# Make the docs ...
###############################################################################
-chdir dirname($0);
-
if (!-d 'html') {
unlink 'html';
mkdir 'html', 0755;