From ad3fe2953ec28157f9121721e0a769d00b79c29e Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Wed, 26 Sep 2012 11:05:41 +0000 Subject: [PATCH] LUCENE-4434: Make changes-to-html not depend on wget or curl, fix some unicode bugs with PERL, add -Dperl.exe property git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1390402 13f79535-47bb-0310-9956-ffa450edef68 --- lucene/benchmark/build.xml | 6 +++-- lucene/build.xml | 4 +-- lucene/common-build.xml | 13 ++++++++-- lucene/site/changes/changes2html.pl | 39 +++++++++-------------------- solr/build.xml | 5 ++-- 5 files changed, 32 insertions(+), 35 deletions(-) diff --git a/lucene/benchmark/build.xml b/lucene/benchmark/build.xml index c316736197d..4809e4a3251 100644 --- a/lucene/benchmark/build.xml +++ b/lucene/benchmark/build.xml @@ -220,7 +220,8 @@ Benchmark output is in file: ${collation.output.file} Converting to JIRA table format... - + + @@ -246,7 +247,8 @@ Benchmark output is in file: ${shingle.output.file} Converting to JIRA table format... - + + diff --git a/lucene/build.xml b/lucene/build.xml index 230bfa7696c..7418c8080bf 100644 --- a/lucene/build.xml +++ b/lucene/build.xml @@ -416,7 +416,7 @@ + changes.target.dir="${svn.export.dir}/docs/changes" changes.product="LUCENE"/> @@ -507,7 +507,7 @@ - + diff --git a/lucene/common-build.xml b/lucene/common-build.xml index 0b145b212be..9131c1ddcb5 100644 --- a/lucene/common-build.xml +++ b/lucene/common-build.xml @@ -209,6 +209,7 @@ --> + @@ -1351,7 +1352,8 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites - + + @@ -1889,14 +1891,21 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites compile changes.txt into an html file --> + - + + + + + diff --git a/lucene/site/changes/changes2html.pl b/lucene/site/changes/changes2html.pl index 9e4dfd95846..0279750250b 100755 --- a/lucene/site/changes/changes2html.pl +++ b/lucene/site/changes/changes2html.pl @@ -41,17 +41,10 @@ my $first_relid = undef; my $second_relid = undef; my @releases = (); -my @lines = <>; # Get all input at once +my @lines = ; # Get all input at once -my $product = ''; -for my $line (@lines) { - ($product) = $line =~ /(Solr|Lucene)/i; - if ($product) { - $product = uc($product); - last; - } -} -my %release_dates = &setup_release_dates; +my $product = $ARGV[0]; +my %release_dates = &setup_release_dates($ARGV[1]); my $in_major_component_versions_section = 0; @@ -804,6 +797,7 @@ sub get_release_date { # sub setup_release_dates { my %release_dates; + my $file = shift; if (uc($product) eq 'LUCENE') { %release_dates = ( '0.01' => '2000-03-30', '0.04' => '2000-04-19', @@ -826,9 +820,7 @@ sub setup_release_dates { '3.0.0' => '2009-11-25'); } - print STDERR "Retrieving $project_info_url/$product ...\n"; - my $project_info_json = get_url_contents("$project_info_url/$product"); - + my $project_info_json = readFile($file); my $project_info = json2perl($project_info_json); for my $version (@{$project_info->{versions}}) { if ($version->{releaseDate}) { @@ -844,20 +836,13 @@ sub setup_release_dates { return %release_dates; } -# -# returns contents of the passed in url -# -sub get_url_contents { - my $url = shift; - my $tryWget = `wget --no-check-certificate -O - $url`; - if ($? eq 0) { - return $tryWget; - } - my $tryCurl = `curl $url`; - if ($? eq 0) { - return $tryCurl; - } - die "could not retrieve $url with either wget or curl!"; +sub readFile { + my $file = shift; + open(F, '<'.$file) || die "could not open $file: $!"; + local $/ = undef; + my $project_info_json = ; + close(F); + return $project_info_json; } # diff --git a/solr/build.xml b/solr/build.xml index e280c825cec..bd007c330ae 100644 --- a/solr/build.xml +++ b/solr/build.xml @@ -370,7 +370,8 @@ + changes.target.dir="${svn.export.dir}/solr/docs/changes" + changes.product="SOLR"/> - +