From 0640671b1d4a0101ca1ca24cd368566586c70be8 Mon Sep 17 00:00:00 2001 From: Joshua Drake Date: Mon, 19 Mar 2007 20:03:04 +0000 Subject: [PATCH] pgstatus.pl update --- cgi-bin/pgstatus.pl | 13 +++++++++++-- htdocs/inc/pgbf.css | 5 +++-- schema/bfwebdb.sql | 21 +++++++++++++++++++++ 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/cgi-bin/pgstatus.pl b/cgi-bin/pgstatus.pl index d3ba72a..576dd38 100644 --- a/cgi-bin/pgstatus.pl +++ b/cgi-bin/pgstatus.pl @@ -74,7 +74,7 @@ $year += 1900; $mon +=1; my $date= sprintf("%d-%.2d-%.2d_%.2d:%.2d:%.2d",$year,$mon,$mday,$hour,$min,$sec); -if ($ENV{BF_DEBUG} || ($ts > time) || (! $secret) ) +if ($ENV{BF_DEBUG} || ($ts > time) || ($ts + 86400 < time ) || (! $secret) ) { open(TX,">../buildlogs/$animal.$date"); print TX "sig=$sig\nlogtar-len=" , length($log_archive), @@ -90,11 +90,20 @@ unless ($ts < time) { my $gmt = gmtime($ts); print "Status: 491 bad ts parameter - $ts ($gmt GMT) is in the future.\n", - "Context-Type: text/plain\n\n bad ts parameter - $ts ($gmt GMT) is in the future\n"; + "Content-Type: text/plain\n\n bad ts parameter - $ts ($gmt GMT) is in the future\n"; $db->disconnect; exit; } +unless ($ts + 86400 > time) +{ + my $gmt = gmtime($ts); + print "Status: 491 bad ts parameter - $ts ($gmt GMT) is more than 24 hours ago.\n", + "Content-Type: text/plain\n\n bad ts parameter - $ts ($gmt GMT) is more than 24 hours ago.\n"; + $db->disconnect; + exit; +} + unless ($secret) { print diff --git a/htdocs/inc/pgbf.css b/htdocs/inc/pgbf.css index a83b2cb..62f8b86 100644 --- a/htdocs/inc/pgbf.css +++ b/htdocs/inc/pgbf.css @@ -13,8 +13,9 @@ a:hover img { border: none; } #wrapper { margin:0 auto; - margin-left: 5px; - /* width: 800px; */ + margin-left: 5px; + width: 1020px; + } #banner img { margin:6px 0; } diff --git a/schema/bfwebdb.sql b/schema/bfwebdb.sql index 36f61f3..c2c7042 100644 --- a/schema/bfwebdb.sql +++ b/schema/bfwebdb.sql @@ -144,6 +144,17 @@ $_$ ALTER FUNCTION public.prevstat(text, text, timestamp without time zone) OWNER TO pgbuildfarm; +-- +-- Name: target(text); Type: FUNCTION; Schema: public; Owner: pgbuildfarm +-- + +CREATE FUNCTION target(t text) RETURNS text + AS $_$ my $log = shift; $log =~ s/.*(Target:[^\n]*).*/$1/s; return $log; $_$ + LANGUAGE plperl; + + +ALTER FUNCTION public.target(t text) OWNER TO pgbuildfarm; + SET default_tablespace = ''; SET default_with_oids = true; @@ -242,6 +253,16 @@ CREATE VIEW buildsystems_export AS ALTER TABLE public.buildsystems_export OWNER TO pgbuildfarm; +-- +-- Name: failures; Type: VIEW; Schema: public; Owner: pgbuildfarm +-- + +CREATE VIEW failures AS + SELECT build_status.sysname, build_status.snapshot, build_status.stage, build_status.conf_sum, build_status.branch, build_status.changed_this_run, build_status.changed_since_success, build_status.log_archive_filenames, build_status.build_flags, build_status.report_time FROM build_status WHERE (((build_status.stage <> 'OK'::text) AND (build_status.stage !~~ 'CVS%'::text)) AND (build_status.report_time IS NOT NULL)); + + +ALTER TABLE public.failures OWNER TO pgbuildfarm; + -- -- Name: list_subscriptions; Type: TABLE; Schema: public; Owner: pgbuildfarm; Tablespace: -- -- 2.30.2