2 # Package Namespace is hardcoded. Modules must live in
5 package EximBuild::Modules::TestUpgrade;
7 use EximBuild::Options;
14 use vars qw($VERSION); $VERSION = 'REL_0.1';
18 # 'checkout' => \&checkout,
19 # 'setup-target' => \&setup_target,
20 # 'need-run' => \&need_run,
21 # 'configure' => \&configure,
23 # 'install' => \&install,
26 # 'cleanup' => \&cleanup,
31 my $class = __PACKAGE__;
33 my $buildroot = shift; # where we're building
34 my $branch = shift; # The branch of exim that's being built.
35 my $conf = shift; # ref to the whole config object
36 my $exim = shift; # exim build dir
38 return unless ($branch eq 'HEAD' or $branch ge 'REL9_2');
41 "overly long build root $buildroot will cause upgrade problems - try something shorter than 46 chars"
42 if (length($buildroot) > 46);
44 # could even set up several of these (e.g. for different branches)
46 buildroot => $buildroot,
53 # for each instance you create, do:
54 main::register_module_hooks($self,$hooks);
62 return unless main::step_wanted('pg_upgrade-check');
64 print main::time_str(), "checking pg_upgrade\n" if $verbose;
66 my $make = $self->{bfconf}->{make};
71 (my $buildport = $ENV{EXTRA_REGRESS_OPTS}) =~ s/--port=//;
72 $ENV{PGPORT} = $buildport;
76 if ($self->{bfconf}->{using_msvc})
78 chdir "$self->{exim}/src/tools/msvc";
79 @checklog = `perl vcregress.pl upgradecheck 2>&1`;
80 chdir "$self->{buildroot}/$self->{eximbranch}";
84 my $cmd = "cd $self->{exim}/contrib/pg_upgrade && $make check";
85 @checklog = `$cmd 2>&1`;
88 my @logfiles = glob("$self->{exim}/contrib/pg_upgrade/*.log");
89 foreach my $log (@logfiles)
91 my $fname = basename $log;
95 my $contents = <$handle>;
98 "=========================== $fname ================\n",$contents);
103 main::writelog("check-pg_upgrade",\@checklog);
104 print "======== pg_upgrade check log ===========\n",@checklog
106 main::send_result("pg_upgradeCheck",$status,\@checklog) if $status;
109 $main::steps_completed .= " pg_upgradeCheck";