From: Todd Lyons Date: Tue, 22 Oct 2013 22:55:58 +0000 (-0700) Subject: Use global list format string X-Git-Url: https://git.exim.org/buildfarm-server.git/commitdiff_plain/54efab99b33efe20a0c3c39dd36569310c5441b5 Use global list format string --- diff --git a/BuildFarmWeb.pl.skel b/BuildFarmWeb.pl.skel index e4d05a5..7fa0735 100644 --- a/BuildFarmWeb.pl.skel +++ b/BuildFarmWeb.pl.skel @@ -47,10 +47,15 @@ $green_stat=['foo-status-green@somewhere.org']; $min_script_version = "99.99"; $min_web_script_version = "99.99"; -# captcha keys for site +# captcha keys for site. Get your own ReCaptcha site info. $captcha_pubkey = 'foo'; $captcha_privkey = 'bar'; +# Copy of git tree to compare client references to +$local_git_clone = '/home/farm/git/exim/exim.git'; +$user_list_format = "%-10s %-10s %-18s %-22s %-18s %-s\n"; +# Uncomment to get extra info +# $ENV{BF_DEBUG} = 1; 1; diff --git a/cgi-bin/eximstatus.pl b/cgi-bin/eximstatus.pl index e911e6b..244439e 100755 --- a/cgi-bin/eximstatus.pl +++ b/cgi-bin/eximstatus.pl @@ -227,7 +227,7 @@ if ($log_archive) chomp $githeadref; close $githead; } - # unlink $archname; + unlink $archname; } my $config_flags; diff --git a/scripts/approve_system.pl b/scripts/approve_system.pl index 7a36db7..9a7457d 100755 --- a/scripts/approve_system.pl +++ b/scripts/approve_system.pl @@ -8,6 +8,7 @@ use Data::Dumper; die "Must pass current sysname and new sysname\n" unless scalar @ARGV == 2; use vars qw($dbhost $dbname $dbuser $dbpass $dbport + $user_list_format ); require "$ENV{BFConfDir}/BuildFarmWeb.pl"; @@ -22,10 +23,6 @@ my $db = DBI->connect($dsn,$dbuser,$dbpass); die $DBI::errstr unless $db; -#my $sth_up = $db->prepare(q[ -# SELECT approve(?, ?) -# ]); -#$sth_up->execute(@ARGV); $db->do('SELECT approve(?, ?)', undef, @ARGV); my $sth = $db->prepare(q[ @@ -35,11 +32,12 @@ my $sth = $db->prepare(q[ ]); $sth->execute(); -my $format = "%-10s %-10s %-18s %-20s %-18s %-s\n"; -printf $format, "SysName", "Status", "Owner", "Email", "Distro", "Version"; +printf $user_list_format, + "SysName", "Status", "Owner", "Email", "Distro", "Version"; while (my $row = $sth->fetchrow_hashref) { - printf $format, $row->{name}, $row->{status}, $row->{sys_owner}, + printf $user_list_format, + $row->{name}, $row->{status}, $row->{sys_owner}, $row->{owner_email}, $row->{operating_system}, $row->{os_version}; } diff --git a/scripts/list_buildsystems.pl b/scripts/list_buildsystems.pl index 4fa64d1..f64bdbc 100755 --- a/scripts/list_buildsystems.pl +++ b/scripts/list_buildsystems.pl @@ -6,6 +6,7 @@ use DBI; use Data::Dumper; use vars qw($dbhost $dbname $dbuser $dbpass $dbport + $user_list_format ); require "$ENV{BFConfDir}/BuildFarmWeb.pl"; @@ -27,11 +28,11 @@ my $sth = $db->prepare(q[ ]); $sth->execute(); -my $format = "%-10s %-10s %-18s %-20s %-18s %-s\n"; -printf $format, "SysName", "Status", "Owner", "Email", "Distro", "Version"; +printf $user_list_format, "SysName", "Status", "Owner", "Email", "Distro", "Version"; while (my $row = $sth->fetchrow_hashref) { - printf $format, $row->{name}, $row->{status}, $row->{sys_owner}, + printf $user_list_format, + $row->{name}, $row->{status}, $row->{sys_owner}, $row->{owner_email}, $row->{operating_system}, $row->{os_version}; } diff --git a/scripts/rename_system.pl b/scripts/rename_system.pl index 4a61c77..cf1dbde 100755 --- a/scripts/rename_system.pl +++ b/scripts/rename_system.pl @@ -8,6 +8,7 @@ use Data::Dumper; die "Must pass current and new sysnames\n" unless scalar @ARGV == 2; use vars qw($dbhost $dbname $dbuser $dbpass $dbport + $user_list_format ); require "$ENV{BFConfDir}/BuildFarmWeb.pl"; @@ -36,11 +37,13 @@ my $sth = $db->prepare(q[ ]); $sth->execute(); -my $format = "%-10s %-10s %-18s %-20s %-18s %-s\n"; -printf $format, "SysName", "Status", "Owner", "Email", "Distro", "Version"; +my $user_list_format = "%-10s %-10s %-18s %-20s %-18s %-s\n"; +printf $user_list_format, + "SysName", "Status", "Owner", "Email", "Distro", "Version"; while (my $row = $sth->fetchrow_hashref) { - printf $format, $row->{name}, $row->{status}, $row->{sys_owner}, + printf $user_list_format, + $row->{name}, $row->{status}, $row->{sys_owner}, $row->{owner_email}, $row->{operating_system}, $row->{os_version}; }