Move scripts to subdirectory
authorTodd Lyons <tlyons@exim.org>
Tue, 22 Oct 2013 01:33:54 +0000 (18:33 -0700)
committerTodd Lyons <tlyons@exim.org>
Tue, 22 Oct 2013 01:33:54 +0000 (18:33 -0700)
delete_unlisted_branches.pl [deleted file]
list_buildsystems.pl [deleted file]
rename_system.pl [deleted file]
scripts/delete_unlisted_branches.pl [new file with mode: 0755]
scripts/list_buildsystems.pl [new file with mode: 0755]
scripts/rename_system.pl [new file with mode: 0755]
scripts/set_system_status.pl [new file with mode: 0755]
set_system_status.pl [deleted file]

diff --git a/delete_unlisted_branches.pl b/delete_unlisted_branches.pl
deleted file mode 100755 (executable)
index 03df796..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use DBI;
-use Data::Dumper;
-
-use vars qw($dbhost $dbname $dbuser $dbpass $dbport
-);
-require "$ENV{BFConfDir}/BuildFarmWeb.pl";
-
-die "no dbname" unless $dbname;
-die "no dbuser" unless $dbuser;
-
-my $dsn="dbi:Pg:dbname=$dbname";
-$dsn .= ";host=$dbhost" if $dbhost;
-$dsn .= ";port=$dbport" if $dbport;
-
-my $db = DBI->connect($dsn,$dbuser,$dbpass);
-
-die $DBI::errstr unless $db;
-
-my ($brhandle,@branches_of_interest);
-if (open($brhandle,"$ENV{BFConfDir}/htdocs/branches_of_interest.txt"))
-{
-    @branches_of_interest = <$brhandle>;
-    close($brhandle);
-    chomp(@branches_of_interest);
-}
-
-my $sth = $db->prepare(q[ 
-       SELECT DISTINCT ON (sysname,branch)
-       sysname,branch
-       FROM build_status AS s
-       JOIN buildsystems AS b ON (s.sysname = b.name)
-       ORDER BY sysname, branch ASC
-      ]);
-$sth->execute();
-
-my $del_sth = $db->prepare(q[
-       DELETE FROM build_status
-       WHERE sysname = ?
-       AND branch = ?
-      ]);
-my $del_dash_sth = $db->prepare(q[
-       DELETE FROM dashboard_mat
-       WHERE sysname = ?
-       AND branch = ?
-      ]);
-
-while (my $row = $sth->fetchrow_hashref)
-{
-  my $sysname = $row->{sysname};
-  my $branch = $row->{branch};
-  print "Considering $sysname:$branch\n";
-  unless (grep {$_ eq $branch} @branches_of_interest)
-  {
-    print "** Delete branch $branch\n";
-    $del_sth->execute($sysname,$branch);
-    $del_dash_sth->execute($sysname,$branch);
-  }
-}
-$db->disconnect();
diff --git a/list_buildsystems.pl b/list_buildsystems.pl
deleted file mode 100755 (executable)
index 4fa64d1..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use DBI;
-use Data::Dumper;
-
-use vars qw($dbhost $dbname $dbuser $dbpass $dbport
-);
-require "$ENV{BFConfDir}/BuildFarmWeb.pl";
-
-die "no dbname" unless $dbname;
-die "no dbuser" unless $dbuser;
-
-my $dsn="dbi:Pg:dbname=$dbname";
-$dsn .= ";host=$dbhost" if $dbhost;
-$dsn .= ";port=$dbport" if $dbport;
-
-my $db = DBI->connect($dsn,$dbuser,$dbpass);
-
-die $DBI::errstr unless $db;
-
-my $sth = $db->prepare(q[ 
-       SELECT name, status, operating_system, os_version, sys_owner, owner_email
-       FROM buildsystems AS b
-       ORDER BY name ASC
-      ]);
-$sth->execute();
-
-my $format = "%-10s %-10s %-18s %-20s %-18s %-s\n";
-printf $format, "SysName", "Status", "Owner", "Email", "Distro", "Version";
-while (my $row = $sth->fetchrow_hashref)
-{
-  printf $format, $row->{name}, $row->{status}, $row->{sys_owner},
-                  $row->{owner_email}, $row->{operating_system},
-                  $row->{os_version};
-}
-$db->disconnect();
diff --git a/rename_system.pl b/rename_system.pl
deleted file mode 100755 (executable)
index 4a61c77..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use DBI;
-use Data::Dumper;
-
-die "Must pass current and new sysnames\n" unless scalar @ARGV == 2;
-
-use vars qw($dbhost $dbname $dbuser $dbpass $dbport
-);
-require "$ENV{BFConfDir}/BuildFarmWeb.pl";
-
-die "no dbname" unless $dbname;
-die "no dbuser" unless $dbuser;
-
-my $dsn="dbi:Pg:dbname=$dbname";
-$dsn .= ";host=$dbhost" if $dbhost;
-$dsn .= ";port=$dbport" if $dbport;
-
-my $db = DBI->connect($dsn,$dbuser,$dbpass);
-
-die $DBI::errstr unless $db;
-
-my $sth_up = $db->prepare(q[
-       UPDATE buildsystems AS b
-       SET name = ?
-       WHERE name = ?
-      ]);
-$sth_up->execute($ARGV[1],$ARGV[0]);
-
-my $sth = $db->prepare(q[ 
-       SELECT name, status, operating_system, os_version, sys_owner, owner_email
-       FROM buildsystems AS b
-       ORDER BY name ASC
-      ]);
-$sth->execute();
-
-my $format = "%-10s %-10s %-18s %-20s %-18s %-s\n";
-printf $format, "SysName", "Status", "Owner", "Email", "Distro", "Version";
-while (my $row = $sth->fetchrow_hashref)
-{
-  printf $format, $row->{name}, $row->{status}, $row->{sys_owner},
-                  $row->{owner_email}, $row->{operating_system},
-                  $row->{os_version};
-}
-$db->disconnect();
diff --git a/scripts/delete_unlisted_branches.pl b/scripts/delete_unlisted_branches.pl
new file mode 100755 (executable)
index 0000000..03df796
--- /dev/null
@@ -0,0 +1,63 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use DBI;
+use Data::Dumper;
+
+use vars qw($dbhost $dbname $dbuser $dbpass $dbport
+);
+require "$ENV{BFConfDir}/BuildFarmWeb.pl";
+
+die "no dbname" unless $dbname;
+die "no dbuser" unless $dbuser;
+
+my $dsn="dbi:Pg:dbname=$dbname";
+$dsn .= ";host=$dbhost" if $dbhost;
+$dsn .= ";port=$dbport" if $dbport;
+
+my $db = DBI->connect($dsn,$dbuser,$dbpass);
+
+die $DBI::errstr unless $db;
+
+my ($brhandle,@branches_of_interest);
+if (open($brhandle,"$ENV{BFConfDir}/htdocs/branches_of_interest.txt"))
+{
+    @branches_of_interest = <$brhandle>;
+    close($brhandle);
+    chomp(@branches_of_interest);
+}
+
+my $sth = $db->prepare(q[ 
+       SELECT DISTINCT ON (sysname,branch)
+       sysname,branch
+       FROM build_status AS s
+       JOIN buildsystems AS b ON (s.sysname = b.name)
+       ORDER BY sysname, branch ASC
+      ]);
+$sth->execute();
+
+my $del_sth = $db->prepare(q[
+       DELETE FROM build_status
+       WHERE sysname = ?
+       AND branch = ?
+      ]);
+my $del_dash_sth = $db->prepare(q[
+       DELETE FROM dashboard_mat
+       WHERE sysname = ?
+       AND branch = ?
+      ]);
+
+while (my $row = $sth->fetchrow_hashref)
+{
+  my $sysname = $row->{sysname};
+  my $branch = $row->{branch};
+  print "Considering $sysname:$branch\n";
+  unless (grep {$_ eq $branch} @branches_of_interest)
+  {
+    print "** Delete branch $branch\n";
+    $del_sth->execute($sysname,$branch);
+    $del_dash_sth->execute($sysname,$branch);
+  }
+}
+$db->disconnect();
diff --git a/scripts/list_buildsystems.pl b/scripts/list_buildsystems.pl
new file mode 100755 (executable)
index 0000000..4fa64d1
--- /dev/null
@@ -0,0 +1,38 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use DBI;
+use Data::Dumper;
+
+use vars qw($dbhost $dbname $dbuser $dbpass $dbport
+);
+require "$ENV{BFConfDir}/BuildFarmWeb.pl";
+
+die "no dbname" unless $dbname;
+die "no dbuser" unless $dbuser;
+
+my $dsn="dbi:Pg:dbname=$dbname";
+$dsn .= ";host=$dbhost" if $dbhost;
+$dsn .= ";port=$dbport" if $dbport;
+
+my $db = DBI->connect($dsn,$dbuser,$dbpass);
+
+die $DBI::errstr unless $db;
+
+my $sth = $db->prepare(q[ 
+       SELECT name, status, operating_system, os_version, sys_owner, owner_email
+       FROM buildsystems AS b
+       ORDER BY name ASC
+      ]);
+$sth->execute();
+
+my $format = "%-10s %-10s %-18s %-20s %-18s %-s\n";
+printf $format, "SysName", "Status", "Owner", "Email", "Distro", "Version";
+while (my $row = $sth->fetchrow_hashref)
+{
+  printf $format, $row->{name}, $row->{status}, $row->{sys_owner},
+                  $row->{owner_email}, $row->{operating_system},
+                  $row->{os_version};
+}
+$db->disconnect();
diff --git a/scripts/rename_system.pl b/scripts/rename_system.pl
new file mode 100755 (executable)
index 0000000..4a61c77
--- /dev/null
@@ -0,0 +1,47 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use DBI;
+use Data::Dumper;
+
+die "Must pass current and new sysnames\n" unless scalar @ARGV == 2;
+
+use vars qw($dbhost $dbname $dbuser $dbpass $dbport
+);
+require "$ENV{BFConfDir}/BuildFarmWeb.pl";
+
+die "no dbname" unless $dbname;
+die "no dbuser" unless $dbuser;
+
+my $dsn="dbi:Pg:dbname=$dbname";
+$dsn .= ";host=$dbhost" if $dbhost;
+$dsn .= ";port=$dbport" if $dbport;
+
+my $db = DBI->connect($dsn,$dbuser,$dbpass);
+
+die $DBI::errstr unless $db;
+
+my $sth_up = $db->prepare(q[
+       UPDATE buildsystems AS b
+       SET name = ?
+       WHERE name = ?
+      ]);
+$sth_up->execute($ARGV[1],$ARGV[0]);
+
+my $sth = $db->prepare(q[ 
+       SELECT name, status, operating_system, os_version, sys_owner, owner_email
+       FROM buildsystems AS b
+       ORDER BY name ASC
+      ]);
+$sth->execute();
+
+my $format = "%-10s %-10s %-18s %-20s %-18s %-s\n";
+printf $format, "SysName", "Status", "Owner", "Email", "Distro", "Version";
+while (my $row = $sth->fetchrow_hashref)
+{
+  printf $format, $row->{name}, $row->{status}, $row->{sys_owner},
+                  $row->{owner_email}, $row->{operating_system},
+                  $row->{os_version};
+}
+$db->disconnect();
diff --git a/scripts/set_system_status.pl b/scripts/set_system_status.pl
new file mode 100755 (executable)
index 0000000..7912135
--- /dev/null
@@ -0,0 +1,47 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use DBI;
+use Data::Dumper;
+
+die "Must pass sysname and status\n" unless scalar @ARGV == 2;
+
+use vars qw($dbhost $dbname $dbuser $dbpass $dbport
+);
+require "$ENV{BFConfDir}/BuildFarmWeb.pl";
+
+die "no dbname" unless $dbname;
+die "no dbuser" unless $dbuser;
+
+my $dsn="dbi:Pg:dbname=$dbname";
+$dsn .= ";host=$dbhost" if $dbhost;
+$dsn .= ";port=$dbport" if $dbport;
+
+my $db = DBI->connect($dsn,$dbuser,$dbpass);
+
+die $DBI::errstr unless $db;
+
+my $sth_up = $db->prepare(q[
+       UPDATE buildsystems AS b
+       SET status = ?
+       WHERE name = ?
+      ]);
+$sth_up->execute($ARGV[1],$ARGV[0]);
+
+my $sth = $db->prepare(q[ 
+       SELECT name, status, operating_system, os_version, sys_owner, owner_email
+       FROM buildsystems AS b
+       ORDER BY name ASC
+      ]);
+$sth->execute();
+
+my $format = "%-10s %-10s %-18s %-20s %-18s %-s\n";
+printf $format, "SysName", "Status", "Owner", "Email", "Distro", "Version";
+while (my $row = $sth->fetchrow_hashref)
+{
+  printf $format, $row->{name}, $row->{status}, $row->{sys_owner},
+                  $row->{owner_email}, $row->{operating_system},
+                  $row->{os_version};
+}
+$db->disconnect();
diff --git a/set_system_status.pl b/set_system_status.pl
deleted file mode 100755 (executable)
index 7912135..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use DBI;
-use Data::Dumper;
-
-die "Must pass sysname and status\n" unless scalar @ARGV == 2;
-
-use vars qw($dbhost $dbname $dbuser $dbpass $dbport
-);
-require "$ENV{BFConfDir}/BuildFarmWeb.pl";
-
-die "no dbname" unless $dbname;
-die "no dbuser" unless $dbuser;
-
-my $dsn="dbi:Pg:dbname=$dbname";
-$dsn .= ";host=$dbhost" if $dbhost;
-$dsn .= ";port=$dbport" if $dbport;
-
-my $db = DBI->connect($dsn,$dbuser,$dbpass);
-
-die $DBI::errstr unless $db;
-
-my $sth_up = $db->prepare(q[
-       UPDATE buildsystems AS b
-       SET status = ?
-       WHERE name = ?
-      ]);
-$sth_up->execute($ARGV[1],$ARGV[0]);
-
-my $sth = $db->prepare(q[ 
-       SELECT name, status, operating_system, os_version, sys_owner, owner_email
-       FROM buildsystems AS b
-       ORDER BY name ASC
-      ]);
-$sth->execute();
-
-my $format = "%-10s %-10s %-18s %-20s %-18s %-s\n";
-printf $format, "SysName", "Status", "Owner", "Email", "Distro", "Version";
-while (my $row = $sth->fetchrow_hashref)
-{
-  printf $format, $row->{name}, $row->{status}, $row->{sys_owner},
-                  $row->{owner_email}, $row->{operating_system},
-                  $row->{os_version};
-}
-$db->disconnect();