Permalink
Browse files

Updated for Perl 5 version 12.1

  • Loading branch information...
1 parent dfd10e0 commit a23e2f44a8858604d35a2a9bc4347a29c6fbede2 @jonallen committed May 17, 2010
Showing with 36 additions and 5 deletions.
  1. +34 −4 build-perldoc-pdf.pl
  2. +2 −1 javascript/perlversion.js
View
@@ -9,14 +9,15 @@
use lib "$Bin/lib";
use Perldoc::Config;
-use Perldoc::Page;
-use Perldoc::Page::Convert;
-use Perldoc::Section;
+
#--Set config options-----------------------------------------------------
-my %specifiers = ( 'output-path' => '=s' );
+my %specifiers = (
+ 'output-path' => '=s',
+ 'perl' => '=s',
+);
my %options;
GetOptions( \%options, optionspec(%specifiers) );
@@ -42,6 +43,35 @@
$Perldoc::Config::option{output_path} = $options{output_path};
+#--Check if we are using a different perl----------------------------------
+
+if ($options{perl}) {
+ #warn "Setting perl to $options{perl}\n";
+ my $version_cmd = 'printf("%vd",$^V)';
+ my $perl_version = `$options{perl} -e '$version_cmd'`;
+ my $inc_cmd = 'print "$_\n" foreach @INC';
+ my $perl_inc = `$options{perl} -e '$inc_cmd'`;
+ my $bin_cmd = 'use Config; print $Config{bin}';
+ my $perl_bin = `$options{perl} -e '$bin_cmd'`;
+
+ $Perldoc::Config::option{perl_version} = $perl_version;
+ $Perldoc::Config::option{perl5_version} = substr($perl_version,2);
+ $Perldoc::Config::option{inc} = [split /\n/,$perl_inc];
+ $Perldoc::Config::option{bin} = $perl_bin;
+
+ #warn Dumper(\%Perldoc::Config::option);
+}
+
+
+eval <<EOT;
+use Perldoc::Page;
+use Perldoc::Page::Convert;
+use Perldoc::Section;
+EOT
+
+die $@ if $@;
+
+
#--Convert pages to PDF---------------------------------------------------
my @pages = grep {exists $Perldoc::Page::CoreList{$_}} Perldoc::Page::list();
@@ -9,7 +9,8 @@ function selectPerlVersion(element) {
document.write('<select id="perl_version_select" name="version-chooser" onChange="selectPerlVersion(this)">');
document.write(' <option selected>Select...');
document.write(' <optgroup label="Perl 5 version 12">');
-document.write(' <option value="/index.html">Perl 5.12.0');
+document.write(' <option value="/index.html">Perl 5.12.1');
+document.write(' <option value="/5.12.0/index.html">Perl 5.12.0');
document.write(' </optgroup>');
document.write(' <optgroup label="Perl 5 version 10">');
document.write(' <option value="/5.10.0/index.html">Perl 5.10.0');

0 comments on commit a23e2f4

Please sign in to comment.