X-Git-Url: https://git.exim.org/buildfarm-server.git/blobdiff_plain/2e86f437603ee6977c9ca751e97e490ce2768584..c3ad6df34e5ec30c6be887033dad6d834ddf8fb1:/cgi-bin/show_log.pl diff --git a/cgi-bin/show_log.pl b/cgi-bin/show_log.pl index 929af0d..bd1a608 100755 --- a/cgi-bin/show_log.pl +++ b/cgi-bin/show_log.pl @@ -6,12 +6,15 @@ use Template; use CGI; use URI::Escape; -use vars qw($dbhost $dbname $dbuser $dbpass $dbport @log_file_names); +use vars qw($dbhost $dbname $dbuser $dbpass $dbport $template_dir @log_file_names); require "$ENV{BFConfDir}/BuildFarmWeb.pl"; #require "BuildFarmWeb.pl"; +my $template_opts = { INCLUDE_PATH => $template_dir}; +my $template = new Template($template_opts); + die "no dbname" unless $dbname; die "no dbuser" unless $dbuser; @@ -26,7 +29,8 @@ my $logdate = $query->param('dt'); $logdate =~ s/[^a-zA-Z0-9_ -]//g; my $log = ""; my $conf = ""; -my ($stage,$changed_this_run,$changed_since_success,$sysinfo,$branch); +my ($stage,$changed_this_run,$changed_since_success,$sysinfo,$branch,$scmurl); +my $scm; use vars qw($info_row); @@ -40,7 +44,7 @@ if ($system && $logdate) my $statement = <[4]; $branch = $row->[5]; my $log_file_names = $row->[6]; + $scm = $row->[7]; + $scm ||= 'cvs'; # legacy scripts + $scmurl = $row->[8]; $log_file_names =~ s/^\{(.*)\}$/$1/; @log_file_names=split(',',$log_file_names) if $log_file_names; @@ -66,7 +73,8 @@ EOS select operating_system, os_version, compiler, compiler_version, architecture, - replace(owner_email,'\@',' [ a t ] ') as owner_email + replace(owner_email,'\@',' [ a t ] ') as owner_email, + sys_notes_ts::date AS sys_notes_date, sys_notes from buildsystems where status = 'approved' and name = ? @@ -76,18 +84,27 @@ EOS $sth=$db->prepare($statement); $sth->execute($system); $info_row=$sth->fetchrow_hashref; - $sysinfo = join(" ",@$row); + # $sysinfo = join(" ",@$row); $sth->finish; $db->disconnect; } foreach my $chgd ($changed_this_run,$changed_since_success) { + my $cvsurl = 'http://anoncvs.postgresql.org/cvsweb.cgi'; + my $giturl = $scmurl || 'http://git.postgresql.org/gitweb?p=postgresql.git;a=commit;h='; my @lines = split(/!/,$chgd); foreach (@lines) { - next unless m!^pgsql/!; - s!(^\S+)(\s+)(\S+)!$1$2$3!; + if ($scm eq 'git') + { + s!(^\S+)(\s+)(\S+)!$1!; + } + elsif ($scm eq 'cvs') + { + next unless m!^(pgsql|master|REL\d_\d_STABLE)/!; + s!(^\S+)(\s+)(\S+)!$1$2$3!; + } } $chgd = join("\n",@lines); $chgd ||= 'not recorded'; @@ -100,7 +117,7 @@ map {s/&/&/g; s//>/g; s/\"/"/g;} ($log,$conf); use POSIX qw(ceil); -my $lrfactor = 7; +my $lrfactor = 6; my $logrows = ceil(scalar(@log_file_names)/$lrfactor); my $logcells = $lrfactor * $logrows; @@ -134,7 +151,7 @@ if ($stage eq 'OK')
  • Home
  • Status
  • Members
  • -
  • Register
  • +
  • Register
  • PGFoundry
  • @@ -162,9 +179,28 @@ if ($stage eq 'OK') EOHTML + if ($info_row->{sys_notes}) + { + print < + + + + + + + + + + +
    System NotesDateNotes
    $info_row->{sys_notes_date}$info_row->{sys_notes}
    +EOHTML + + } + for my $logstage (@log_file_names) { - print "
    \n" + print "
    Stage Logs
    \n" unless $heading_done; $heading_done = 1; $cell++; @@ -239,7 +275,7 @@ print <Home
  • Status
  • Members
  • -
  • Register
  • +
  • Register
  • PGFoundry
  • @@ -265,9 +301,28 @@ print <$info_row->{architecture}
    -
    Stage Logs$info_row->{owner_email}
    + +EOHTML + + if ($info_row->{sys_notes}) + { + print < + + + + + + + + + + +
    System NotesDateNotes
    $info_row->{sys_notes_date}$info_row->{sys_notes}
    EOHTML + } + for my $logstage (@log_file_names) { print "
    \n"
    Stage Logs