Remove tinderbox dependency upon obsolete bonsai scripts

Bug #273441 r=bear
This commit is contained in:
cls%seawood.org 2006-05-27 00:18:42 +00:00
Родитель 4a48353761
Коммит 917f16c649
15 изменённых файлов: 237 добавлений и 53 удалений

Просмотреть файл

@ -20,18 +20,32 @@
# Contributor(s):
# This Makefile helps you install Tinderbox. Define PERL and MYSQLTCL to
# the full pathnames of where you have these utilities. Define PREFIX
# to where you will install the running Tinderbox. Then "make install" should
# copy things for you.
# This Makefile helps you install Tinderbox.
# Set the variables below to their proper locations.
# TINDERBOX_DIR is the full path to where you want to install tinderbox
# BONSAI_DIR is the full path to your local bonsai installation
# BONSAI_URL is the root URL to your bonsai install (e.g. ../bonsai)
# The other variables contain full paths to the utitlies required to
# use tinderbox.
# Then "make install" should copy the files to the tinderbox location
# specified by TINDERBOX_DIR
#TINDERBOX_DIR = /var/www/html/tinderbox
#BONSAI_DIR = /var/www/html/bonsai
#BONSAI_URL = /bonsai
# Set these if you want to tighten permissions
#TINDERBOX_USER = tinderbox
#TINDERBOX_GROUP = tinderbox
#BONSAI = /home/httpd/html/bonsai
#CVSROOT = /cvsroot
#GZIP = /usr/bin/gzip
#PERL = /usr/bin/perl
#PREFIX = /home/httpd/html/tinderbox
#UUDECODE = /usr/bin/uudecode
ALL_UTILS = GZIP PERL UUDECODE
FILES = \
Backwards.pm \
addimage.cgi \
@ -45,6 +59,7 @@ ep_unix.pl \
ep_windows.pl \
fixupimages.pl \
handlemail.pl \
header.pl \
imagelog.pl \
processbuild.pl \
showbuilds.cgi \
@ -54,7 +69,6 @@ tbglobals.pl \
Empty.html \
faq.html \
index.html \
examples/build-moz-smoke.pl \
examples/buildit.config \
examples/mozilla-unix.pl \
examples/mozilla-windows.pl
@ -63,9 +77,22 @@ PICS = \
1afi003r.gif \
star.gif
# Sanity check
ifeq (,$(strip $(TINDERBOX_DIR)))
$(error TINDERBOX_DIR must be set to the tinderbox install location)
endif
ifeq (,$(strip $(BONSAI_DIR)))
$(error BONSAI_DIR must be set for bonsai support to work)
endif
ifeq (,$(strip $(BONSAI_URL)))
$(error BONSAI_URL must be set for bonsai support to work)
endif
install:
mkdir -p $(PREFIX) && \
mkdir -p $(PREFIX)/examples &&
$(foreach u,$(ALL_UTILS),$(if $($u),,$(error $u must be set to the full path of the utility)))
mkdir -p $(TINDERBOX_DIR)/examples
set -e ; \
for I in $(FILES); do \
echo Installing $$I && \
sed -e s#/usr/bonsaitools/bin/perl#$(PERL)#g \
@ -73,11 +100,24 @@ install:
-e s#/m/src#$(CVSROOT)#g \
-e s#/usr/local/bin/gzip#$(GZIP)#g \
-e s#/tools/ns/bin/uudecode#$(UUDECODE)#g \
-e s#/d/webdocs/projects/bonsai#$(BONSAI)#g \
$$I > $(PREFIX)/$$I && \
chmod 755 $(PREFIX)/$$I; done && \
-e s#/d/webdocs/projects/bonsai#$(BONSAI_DIR)#g \
-e s#\.\./bonsai#$(BONSAI_URL)#g \
$$I > $(TINDERBOX_DIR)/$$I && \
chmod 755 $(TINDERBOX_DIR)/$$I; \
done
set -e ; \
for I in $(PICS); do \
echo Installing $$I && \
cp -f $$I $(PREFIX) && \
chmod 755 $(PREFIX)/$$I; done
cp $$I $(TINDERBOX_DIR) && \
chmod 755 $(TINDERBOX_DIR)/$$I; \
done
mkdir -p $(TINDERBOX_DIR)/data
ifneq (,$(TINDERBOX_USER)$(TINDERBOX_GROUP))
chown -R $(TINDERBOX_USER) $(TINDERBOX_DIR)
chgrp -R $(TINDERBOX_GROUP) $(TINDERBOX_DIR)
chmod 755 $(TINDERBOX_DIR)
chmod 775 $(TINDERBOX_DIR)/data
else
chmod 777 $(TINDERBOX_DIR)
chmod 777 $(TINDERBOX_DIR)/data
endif

Просмотреть файл

@ -22,7 +22,6 @@
use Socket;
use lib "../bonsai";
require 'header.pl';
print "Content-type: text/html\n\n";

Просмотреть файл

@ -20,14 +20,14 @@
#
# Contributor(s):
use lib '../bonsai';
use Fcntl;
require 'tbglobals.pl';
require 'lloydcgi.pl';
# Process the form arguments
#
%form = ();
&split_cgi_args();
if (defined($args = $form{log})) {
# Use simplified arguments that uses the logfile as a key.
($tree, $logfile) = split /\//, $args;

Просмотреть файл

@ -20,12 +20,13 @@
#
# Contributor(s):
use lib "../bonsai";
require 'lloydcgi.pl';
require 'tbglobals.pl';
require 'header.pl';
# Process the form arguments
%form = ();
&split_cgi_args();
$|=1;
print "Content-type: text/html\n\n<HTML>\n";

Просмотреть файл

@ -24,7 +24,7 @@ use FileHandle;
use File::Copy 'move';
use Fcntl qw(:DEFAULT :flock);
use lib "../bonsai";
use lib "/d/webdocs/projects/bonsai";
require 'tbglobals.pl';
$F_DEBUG=1;

Просмотреть файл

@ -20,9 +20,6 @@
#
# Contributor(s):
use lib "../bonsai";
require 'lloydcgi.pl';
require 'tbglobals.pl';
require 'header.pl';
@ -31,6 +28,10 @@ use Date::Format;
my $TIMEFORMAT = "%D %T";
# Process the form arguments
%form = ();
&split_cgi_args();
$|=1;
print "Content-type: text/html\n\n<HTML>\n";

Просмотреть файл

@ -21,12 +21,14 @@
# Contributor(s):
use lib "../bonsai";
require 'lloydcgi.pl';
require 'tbglobals.pl';
umask O666;
umask 0666;
$perm = "0775"; # Permission of created files & dirs
# Process the form arguments
%form = ();
&split_cgi_args();
$|=1;
@ -122,10 +124,10 @@ sub create_tree {
$bonsaitreename = $form{'bonsaitreename'};
if( -r $treename ){
chmod 0777, $treename;
chmod(oct($perm), $treename);
}
else {
mkdir( $treename, 0777 ) || die "<h1> Cannot mkdir $treename</h1>";
mkdir( $treename, oct($perm)) || die "<h1> Cannot mkdir $treename</h1>";
}
open( F, ">$treename/treedata.pl" );
print F "\$cvs_module='$modulename';\n";
@ -134,6 +136,7 @@ sub create_tree {
if ($repository ne "") {
print F "\$cvs_root='$repository';\n";
}
print F "1;\n";
close( F );
open( F, ">$treename/build.dat" );
@ -145,7 +148,7 @@ sub create_tree {
open( F, ">$treename/notes.txt" );
close( F );
chmod 0777, "$treename/build.dat", "$treename/who.dat", "$treename/notes.txt",
chmod oct($perm), "$treename/build.dat", "$treename/who.dat", "$treename/notes.txt",
"$treename/treedata.pl";
print "<h2><a href=showbuilds.cgi?tree=$treename>Tree created or modified</a></h2>\n";
@ -179,7 +182,7 @@ sub disable_builds {
}
print IGNORE "\t};\n";
chmod( 0777, "$tree/ignorebuilds.pl");
chmod( oct($perm), "$tree/ignorebuilds.pl");
print "<h2><a href=showbuilds.cgi?tree=$tree>Build state Changed</a></h2>\n";
}
@ -211,7 +214,7 @@ sub scrape_builds {
}
print SCRAPE "\t};\n";
chmod( 0777, "$tree/scrapebuilds.pl");
chmod( oct($perm), "$tree/scrapebuilds.pl");
print "<h2><a href=showbuilds.cgi?tree=$tree>Build state Changed</a></h2>\n";
}
@ -222,7 +225,7 @@ sub set_sheriff {
open(SHERIFF, ">$tree/sheriff.pl");
print SHERIFF "\$current_sheriff = '$m';\n1;";
close(SHERIFF);
chmod( 0777, "$tree/sheriff.pl");
chmod( oct($perm), "$tree/sheriff.pl");
print "<h2><a href=showbuilds.cgi?tree=$tree>
Sheriff Changed.</a><br></h2>\n";
}
@ -233,7 +236,7 @@ sub set_status_message {
open(TREESTATUS, ">$tree/status.pl");
print TREESTATUS "\$status_message = \'$m\'\;\n1;";
close(TREESTATUS);
chmod( 0777, "$tree/status.pl");
chmod( oct($perm), "$tree/status.pl");
print "<h2><a href=showbuilds.cgi?tree=$tree>
Status message changed.</a><br></h2>\n";
}
@ -244,7 +247,7 @@ sub set_rules_message {
open(RULES, ">$tree/rules.pl");
print RULES "\$rules_message = \'$m\';\n1;";
close(RULES);
chmod( 0777, "$tree/rules.pl");
chmod( oct($perm), "$tree/rules.pl");
print "<h2><a href=showbuilds.cgi?tree=$tree>
Rule message changed.</a><br></h2>\n";
}

Просмотреть файл

@ -0,0 +1,66 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Bonsai CVS tool.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
sub EmitHtmlTitleAndHeader {
my($doctitle,$heading,$subheading) = @_;
print "<HTML><HEAD><TITLE>$doctitle</TITLE>";
print "<link rel=\"icon\" href=\"http://mozilla.org/images/mozilla-16.png\" type=\"image/png\">";
print "</HEAD>";
print "<BODY BGCOLOR=\"#FFFFFF\" TEXT=\"#000000\"";
print "LINK=\"#0000EE\" VLINK=\"#551A8B\" ALINK=\"#FF0000\">";
if (open(BANNER, "<data/banner.html")) {
while (<BANNER>) { print; }
close BANNER;
} elsif (open(BANNER, "<../bonsai/data/banner.html")) {
while (<BANNER>) { print; }
close BANNER;
}
print "<TABLE BORDER=0 CELLPADDING=12 CELLSPACING=0 WIDTH=\"100%\">";
print " <TR>\n";
print " <TD>\n";
print " <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=2>\n";
print " <TR><TD VALIGN=TOP ALIGN=CENTER NOWRAP>\n";
print " <FONT SIZE=\"+3\"><B><NOBR>$heading</NOBR></B></FONT>\n";
print " </TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER>\n";
print " <B>$subheading</B>\n";
print " </TD></TR>\n";
print " </TABLE>\n";
print " </TD>\n";
print " <TD>\n";
if (open(BLURB, "<data/blurb")) {
while (<BLURB>) { print; }
close BLURB;
}
print "</TD></TR></TABLE>\n";
}
sub EmitHtmlHeader {
my($heading,$subheading) = @_;
EmitHtmlTitleAndHeader($heading,$heading,$subheading);
}
1;

Просмотреть файл

@ -71,7 +71,9 @@ unlink $mail_file;
# Who data
#
system("./buildwho.pl", "$tinderbox{tree}");
if ("$tinderbox{bonsai_tree}" ne "") {
system("./buildwho.pl", "$tinderbox{tree}");
}
# Warnings

Просмотреть файл

@ -20,12 +20,14 @@
#
# Contributor(s):
use lib '../bonsai';
require 'tbglobals.pl';
require 'lloydcgi.pl';
require 'imagelog.pl';
require 'header.pl';
# Process the form arguments
%form = ();
&split_cgi_args();
# Hack this until I can figure out how to do get default root. -slamm
$default_root = '/cvsroot';
@ -623,12 +625,12 @@ BEGIN {
local $_;
$::BatchID='';
eval qq(require "../bonsai/data/$bonsai_tree/batchid.pl");
eval qq(require "/d/webdocs/projects/bonsai/data/$bonsai_tree/batchid.pl");
if ($::BatchID eq '') {
warn "No BatchID in ../bonsai/data/$bonsai_tree/batchid.pl\n";
warn "No BatchID in /d/webdocs/projects/bonsai/data/$bonsai_tree/batchid.pl\n";
return;
}
open(BATCH, "<../bonsai/data/$bonsai_tree/batch-$::BatchID.pl")
open(BATCH, "</d/webdocs/projects/bonsai/data/$bonsai_tree/batch-$::BatchID.pl")
or print "can't open batch-$::BatchID.pl<br>";
while (<BATCH>) {
if (/^\$::TreeOpen = '(\d+)';/) {

Просмотреть файл

@ -23,13 +23,14 @@
$| = 1;
use lib "../bonsai";
require 'tbglobals.pl';
require 'imagelog.pl';
require 'lloydcgi.pl';
require 'header.pl';
# Process the form arguments
%form = ();
&split_cgi_args();
tb_check_password();
print "Content-type: text/html\n\n";

Просмотреть файл

@ -20,12 +20,13 @@
#
# Contributor(s):
use lib '../bonsai';
require 'tbglobals.pl';
require 'lloydcgi.pl';
require 'header.pl';
# Process the form arguments
%form = ();
&split_cgi_args();
#############################################################
# Global variables

Просмотреть файл

@ -728,4 +728,71 @@ sub load_notes {
close NOTES;
}
sub split_cgi_args {
local (@args, $pair, $key, $value, $s);
if ($ENV{"REQUEST_METHOD"} eq 'POST') {
$s .= $_ while (<>);
}
else {
$s = $ENV{"QUERY_STRING"};
}
$s =~ tr/+/ /;
@args= split(/\&/, $s );
for $pair (@args) {
($key, $value) = split(/=/, $pair);
$key =~ s/%([a-fA-F0-9]{2})/pack("C", hex($1))/eg;
$value =~ s/%([a-fA-F0-9]{2})/pack("C", hex($1))/eg;
$form{$key} = $value;
}
# extract the cookies from the HTTP_COOKIE environment
%cookie_jar = split('[;=] *',$ENV{'HTTP_COOKIE'});
}
sub make_cgi_args {
local($k,$v,$ret);
for $k (sort keys %form){
$ret .= ($ret eq "" ? '?' : '&');
$v = $form{$k};
$ret .= &url_encode2($k);
$ret .= '=';
$ret .= &url_encode2($v);
}
return $ret;
}
sub url_encode2 {
local( $s ) = @_;
$s =~ s/\%/\%25/g;
$s =~ s/\=/\%3d/g;
$s =~ s/\?/\%3f/g;
$s =~ s/ /\%20/g;
$s =~ s/\n/\%0a/g;
$s =~ s/\r//g;
$s =~ s/\"/\%22/g;
$s =~ s/\'/\%27/g;
$s =~ s/\|/\%7c/g;
$s =~ s/\&/\%26/g;
$s =~ s/\+/\%2b/g;
return $s;
}
@weekdays = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
@months = ('Jan','Feb','Mar','Apr','May','Jun',
'Jul','Aug','Sep','Oct','Nov','Dec');
sub toGMTString {
local ($seconds) = $_[0];
local ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)
= gmtime($seconds);
$year += 1900;
sprintf('%s, %02d-%s-%d %02d:%02d:%02d GMT',
$weekdays[$wday],$mday,$months[$mon],$year,$hour,$min,$sec);
}

Просмотреть файл

@ -20,9 +20,7 @@
#
# Contributor(s):
use lib '../bonsai';
require "tbglobals.pl";
require 'lloydcgi.pl';
require 'header.pl';
use Date::Parse;
@ -30,6 +28,10 @@ use Date::Format;
my $TIMEFORMAT = "%D %T";
# Process the form arguments
%form = ();
&split_cgi_args();
$| = 1;
print "Content-type: text/html\n\n<HTML>\n";

Просмотреть файл

@ -475,8 +475,7 @@ sub mac_parser {
sub build_blame {
my ($cvs_root, $tags) = @_;
use lib '../bonsai';
require 'utils.pl';
use lib '/d/webdocs/projects/bonsai';
require 'cvsblame.pl';
while (($file, $lines_hash) = each %warnings) {