Permalink
Browse files

perltidy run

  • Loading branch information...
1 parent 2fabe82 commit 8a6cf6529aa0d6e75eef235d56db7f4d2f44bf86 @adunstan adunstan committed Feb 15, 2013
Showing with 151 additions and 146 deletions.
  1. +3 −4 PGBuild/Modules/FileTextArrayFDW.pm
  2. +1 −1 PGBuild/SCM.pm
  3. +112 −109 PGBuild/WebTxn.pm
  4. +9 −4 build-farm.conf
  5. +8 −8 run_branches.pl
  6. +17 −17 run_build.pl
  7. +1 −3 run_web_txn.pl
View
7 PGBuild/Modules/FileTextArrayFDW.pm
@@ -166,12 +166,11 @@ sub installcheck
my @log = `cd $self->{where} && $cmd 2>&1`;
my $status = $? >>8;
- my $installdir = "$self->{buildroot}/$self->{pgbranch}/inst";
- my @logfiles =
- ("$self->{where}/regression.diffs","$installdir/logfile");
+ my $installdir = "$self->{buildroot}/$self->{pgbranch}/inst";
+ my @logfiles =("$self->{where}/regression.diffs","$installdir/logfile");
foreach my $logfile(@logfiles)
{
- last unless $status;
+ last unless $status;
next unless (-e $logfile );
push(@log,"\n\n================== $logfile ==================\n");
my $handle;
View
2 PGBuild/SCM.pm
@@ -560,7 +560,7 @@ sub checkout
my @branches = `git branch 2>&1`;
unless (grep {/^\* bf_$branch$/} @branches)
{
- chdir '..';
+ chdir '..';
print "Missing checked out branch bf_$branch:\n",@branches
if ($main::verbose);
unshift @branches,"Missing checked out branch bf_$branch:\n";
View
221 PGBuild/WebTxn.pm
@@ -13,124 +13,127 @@ needed on older Msys installations (i.e. things running perl < 5.8).
=cut
-
-
use strict;
use vars qw($VERSION); $VERSION = 'REL_4.10';
use vars qw($changed_this_run $changed_since_success $branch $status $stage
- $animal $ts $log_data $confsum $target $verbose $secret);
+ $animal $ts $log_data $confsum $target $verbose $secret);
sub run_web_txn
{
- my $lrname = shift || 'lastrun-logs';
-
- # make these runtime imports so they are loaded by the perl that's running
- # the procedure. On older Msys it won't be the same as the one that's
- # running run_build.pl.
-
- require LWP; import LWP;
- require HTTP::Request::Common; import HTTP::Request::Common;
- require MIME::Base64; import MIME::Base64;
- require Digest::SHA; import Digest::SHA qw(sha1_hex);
- require Storable; import Storable qw(nfreeze);
-
- my $txfname = "$lrname/web-txn.data";
- my $txdhandle;
- $/=undef;
- open($txdhandle,"$txfname") or die "opening $txfname: $!";
- my $txdata = <$txdhandle>;
- close($txdhandle);
-
- eval $txdata;
- if ($@)
- {
- warn $@;
- return undef;
- }
-
- my $tarname = "$lrname/runlogs.tgz";
- my $tardata="";
- if (open($txdhandle,$tarname))
- {
- binmode $txdhandle;
- $tardata=<$txdhandle>;
- close($txdhandle);
- }
-
- # add our own version string and time
- my $current_ts = time;
- my $webscriptversion = "'web_script_version' => '$VERSION',\n";
- my $cts = "'current_ts' => $current_ts,\n";
-
- # $2 here helps us to preserve the nice spacing from Data::Dumper
- my $scriptline = "((.*)'script_version' => '(REL_)?\\d+\\.\\d+',\n)";
- $confsum =~ s/$scriptline/$1$2$webscriptversion$2$cts/;
- my $sconf = $confsum;
- $sconf =~ s/.*(\$Script_Config)/$1/ms;
- my $Script_Config;
- eval $sconf;
-
- # very modern Storable modules choke on regexes
- # the server has no need of them anyway, so just chop them out
- # they are still there in the text version used for reporting
- foreach my $k ( keys %$Script_Config )
- {
- delete $Script_Config->{$k}
- if ref($Script_Config->{$k}) eq q(Regexp);
- }
- my $frozen_sconf = nfreeze($Script_Config);
-
- # make the base64 data escape-proof; = is probably ok but no harm done
- # this ensures that what is seen at the other end is EXACTLY what we
- # see when we calculate the signature
-
- map{ $_=encode_base64($_,""); tr/+=/$@/; }
- ($log_data,$confsum,$changed_this_run,$changed_since_success,$tardata,
- $frozen_sconf
- );
-
- my $content =
- "changed_files=$changed_this_run&"
- . "changed_since_success=$changed_since_success&"
- ."branch=$branch&res=$status&stage=$stage&animal=$animal&ts=$ts"
- ."&log=$log_data&conf=$confsum";
- my $sig= sha1_hex($content,$secret);
-
- $content .= "&frozen_sconf=$frozen_sconf";
-
- if ($tardata)
- {
- $content .= "&logtar=$tardata";
- }
-
- my $ua = new LWP::UserAgent;
- $ua->agent("Postgres Build Farm Reporter");
- if (my $proxy = $ENV{BF_PROXY})
- {
- $ua->proxy('http',$proxy);
- }
-
- my $request=HTTP::Request->new(POST => "$target/$sig");
- $request->content_type("application/x-www-form-urlencoded");
- $request->content($content);
-
- my $response=$ua->request($request);
-
- unless ($response->is_success)
- {
- print
- "Query for: stage=$stage&animal=$animal&ts=$ts\n",
- "Target: $target/$sig\n";
- print "Status Line: ",$response->status_line,"\n";
- print "Content: \n", $response->content,"\n"
- if ($verbose && $response->content);
- return undef;
- }
-
- return 1;
+ my $lrname = shift || 'lastrun-logs';
+
+ # make these runtime imports so they are loaded by the perl that's running
+ # the procedure. On older Msys it won't be the same as the one that's
+ # running run_build.pl.
+
+ require LWP;
+ import LWP;
+ require HTTP::Request::Common;
+ import HTTP::Request::Common;
+ require MIME::Base64;
+ import MIME::Base64;
+ require Digest::SHA;
+ import Digest::SHA qw(sha1_hex);
+ require Storable;
+ import Storable qw(nfreeze);
+
+ my $txfname = "$lrname/web-txn.data";
+ my $txdhandle;
+ $/=undef;
+ open($txdhandle,"$txfname") or die "opening $txfname: $!";
+ my $txdata = <$txdhandle>;
+ close($txdhandle);
+
+ eval $txdata;
+ if ($@)
+ {
+ warn $@;
+ return undef;
+ }
+
+ my $tarname = "$lrname/runlogs.tgz";
+ my $tardata="";
+ if (open($txdhandle,$tarname))
+ {
+ binmode $txdhandle;
+ $tardata=<$txdhandle>;
+ close($txdhandle);
+ }
+
+ # add our own version string and time
+ my $current_ts = time;
+ my $webscriptversion = "'web_script_version' => '$VERSION',\n";
+ my $cts = "'current_ts' => $current_ts,\n";
+
+ # $2 here helps us to preserve the nice spacing from Data::Dumper
+ my $scriptline = "((.*)'script_version' => '(REL_)?\\d+\\.\\d+',\n)";
+ $confsum =~ s/$scriptline/$1$2$webscriptversion$2$cts/;
+ my $sconf = $confsum;
+ $sconf =~ s/.*(\$Script_Config)/$1/ms;
+ my $Script_Config;
+ eval $sconf;
+
+ # very modern Storable modules choke on regexes
+ # the server has no need of them anyway, so just chop them out
+ # they are still there in the text version used for reporting
+ foreach my $k ( keys %$Script_Config )
+ {
+ delete $Script_Config->{$k}
+ if ref($Script_Config->{$k}) eq q(Regexp);
+ }
+ my $frozen_sconf = nfreeze($Script_Config);
+
+ # make the base64 data escape-proof; = is probably ok but no harm done
+ # this ensures that what is seen at the other end is EXACTLY what we
+ # see when we calculate the signature
+
+ map{ $_=encode_base64($_,""); tr/+=/$@/; }(
+ $log_data,$confsum,$changed_this_run,$changed_since_success,$tardata,
+ $frozen_sconf
+ );
+
+ my $content =
+ "changed_files=$changed_this_run&"
+ . "changed_since_success=$changed_since_success&"
+ ."branch=$branch&res=$status&stage=$stage&animal=$animal&ts=$ts"
+ ."&log=$log_data&conf=$confsum";
+ my $sig= sha1_hex($content,$secret);
+
+ $content .= "&frozen_sconf=$frozen_sconf";
+
+ if ($tardata)
+ {
+ $content .= "&logtar=$tardata";
+ }
+
+ my $ua = new LWP::UserAgent;
+ $ua->agent("Postgres Build Farm Reporter");
+ if (my $proxy = $ENV{BF_PROXY})
+ {
+ $ua->proxy('http',$proxy);
+ }
+
+ my $request=HTTP::Request->new(POST => "$target/$sig");
+ $request->content_type("application/x-www-form-urlencoded");
+ $request->content($content);
+
+ my $response=$ua->request($request);
+
+ unless ($response->is_success)
+ {
+ print
+ "Query for: stage=$stage&animal=$animal&ts=$ts\n",
+ "Target: $target/$sig\n";
+ print "Status Line: ",$response->status_line,"\n";
+ print "Content: \n", $response->content,"\n"
+ if ($verbose && $response->content);
+ return undef;
+ }
+
+ return 1;
}
1;
View
13 build-farm.conf
@@ -126,7 +126,11 @@ my $branch;
# env settings to pass to configure. These settings will only be seen by
# configure.
- config_env =>{CC => 'ccache gcc',},
+ config_env =>{
+
+ # comment out if not using ccache
+ CC => 'ccache gcc',
+ },
# don't use --prefix or --with-pgport here
# they are set up by the script
@@ -190,9 +194,10 @@ my $branch;
if ($branch eq 'global')
{
- $conf{branches_to_build} = 'ALL';
- # or 'HEAD_PLUS_LATEST' or 'HEAD_PLUS_LATEST2'
- # or [qw( HEAD RELx_y_STABLE etc )]
+ $conf{branches_to_build} = 'ALL';
+
+ # or 'HEAD_PLUS_LATEST' or 'HEAD_PLUS_LATEST2'
+ # or [qw( HEAD RELx_y_STABLE etc )]
}
View
16 run_branches.pl
@@ -55,8 +55,8 @@
ref $PGBuild::conf{branches_to_build} eq 'ARRAY'
&&@{$PGBuild::conf{branches_to_build}}
)
- ||$PGBuild::conf{branches_to_build} =~
- /^(ALL|HEAD_PLUS_LATEST|HEAD_PLUS_LATEST2)$/
+ ||$PGBuild::conf{branches_to_build} =~
+ /^(ALL|HEAD_PLUS_LATEST|HEAD_PLUS_LATEST2)$/
)
{
die "no branches_to_build specified in $buildconf";
@@ -67,8 +67,8 @@
{
@branches = @{$PGBuild::conf{branches_to_build}};
}
-elsif ($PGBuild::conf{branches_to_build} =~
- /^(ALL|HEAD_PLUS_LATEST|HEAD_PLUS_LATEST2)$/ )
+elsif ($PGBuild::conf{branches_to_build} =~
+ /^(ALL|HEAD_PLUS_LATEST|HEAD_PLUS_LATEST2)$/ )
{
# Need to set the path here so we make sure we pick up the right perl.
@@ -86,10 +86,10 @@
push(@branches,$_)foreach (split(/\s+/,$branches_of_interest));
@branches = grep {$_ ne 'REL8_2_STABLE'} @branches
if $PGBuild::conf{using_msvc};
- splice(@branches,0,-2)
- if $PGBuild::conf{branches_to_build} eq 'HEAD_PLUS_LATEST';
- splice(@branches,0,-3)
- if $PGBuild::conf{branches_to_build} eq 'HEAD_PLUS_LATEST2';
+ splice(@branches,0,-2)
+ if $PGBuild::conf{branches_to_build} eq 'HEAD_PLUS_LATEST';
+ splice(@branches,0,-3)
+ if $PGBuild::conf{branches_to_build} eq 'HEAD_PLUS_LATEST2';
}
@branches = apply_throttle(@branches);
View
34 run_build.pl
@@ -251,7 +251,7 @@ BEGIN
if ($^V lt v5.8.0)
{
- die "no aux_path in config file" unless $aux_path;
+ die "no aux_path in config file" unless $aux_path;
}
die "cannot run as root/Administrator" unless ($using_msvc or $> > 0);
@@ -1800,28 +1800,28 @@ sub send_result
unlink "$lrname/runlogs.tgz";
}
- my $txstatus;
+ my $txstatus;
- # this should now only apply to older Msys installs. All others should
- # be running with perl >= 5.8 since that's required to build postgres
- # anyway
- if (!$^V or $^V lt v5.8.0)
- {
+ # this should now only apply to older Msys installs. All others should
+ # be running with perl >= 5.8 since that's required to build postgres
+ # anyway
+ if (!$^V or $^V lt v5.8.0)
+ {
- unless (-x "$aux_path/run_web_txn.pl")
- {
- print "Could not locate $aux_path/run_web_txn.pl\n";
- exit(1);
- }
+ unless (-x "$aux_path/run_web_txn.pl")
+ {
+ print "Could not locate $aux_path/run_web_txn.pl\n";
+ exit(1);
+ }
system("$aux_path/run_web_txn.pl $lrname");
- $txstatus = $? >> 8;
+ $txstatus = $? >> 8;
}
- else
- {
- $txstatus = PGBuild::WebTxn::run_web_txn($lrname) ? 0 : 1;
+ else
+ {
+ $txstatus = PGBuild::WebTxn::run_web_txn($lrname) ? 0 : 1;
- }
+ }
if ($txstatus)
{
View
4 run_web_txn.pl
@@ -15,7 +15,7 @@
#
# The comments below now only apply to older Msys installations (where
# the native SDK perl version is < 5.8).
-# All other installations now do not need to set aux_path, nor should this
+# All other installations now do not need to set aux_path, nor should this
# script be called.
#
# auxiliary script to get around the
@@ -49,5 +49,3 @@
exit $res ? 0 : 1;
-
-

0 comments on commit 8a6cf65

Please sign in to comment.