diff --git a/mozilla/webtools/bonsai/CGI.pl b/mozilla/webtools/bonsai/CGI.pl index 66bda153ae5..ffd819656a1 100644 --- a/mozilla/webtools/bonsai/CGI.pl +++ b/mozilla/webtools/bonsai/CGI.pl @@ -228,7 +228,8 @@ sub make_popup { } sub make_cgi_args { - my ($k,$v,$ret); + my ($k,$v); + my $ret = ""; for $k (sort keys %::FORM){ $ret .= ($ret eq "" ? '?' : '&'); diff --git a/mozilla/webtools/bonsai/SourceChecker.cgi b/mozilla/webtools/bonsai/SourceChecker.cgi index 0cac292f155..b678f081e2c 100755 --- a/mozilla/webtools/bonsai/SourceChecker.cgi +++ b/mozilla/webtools/bonsai/SourceChecker.cgi @@ -1,4 +1,4 @@ -#!/usr/bonsaitools/bin/perl -- +#!/usr/bonsaitools/bin/perl -w # -*- Mode: perl; indent-tabs-mode: nil -*- # # The contents of this file are subject to the Netscape Public License @@ -26,6 +26,9 @@ # ... # +use diagnostics; +use strict; + use CGI; use SourceChecker; @@ -35,7 +38,7 @@ use SourceChecker; # Global # -$query = new CGI; +my $query = new CGI; @@ -65,11 +68,11 @@ END_OF_TRAILER -$error_header = '
Error: $message
"; $error_header = ''; } @@ -119,7 +122,7 @@ sub print_query_building_form() sub do_add_good_words($) { - local $file = shift; + my $file = shift; while ( <$file> ) { @@ -131,7 +134,7 @@ sub do_add_good_words($) sub do_add_bad_words($) { - local $file = shift; + my $file = shift; while ( <$file> ) { @@ -143,7 +146,7 @@ sub do_add_bad_words($) sub do_add_good_english($) { - local $file = shift; + my $file = shift; while ( <$file> ) { @@ -155,7 +158,7 @@ sub do_add_good_english($) sub do_add_names($) { - local $file = shift; + my $file = shift; while ( <$file> ) { @@ -167,7 +170,7 @@ sub do_add_names($) sub handle_query() { - $dictionary_path = $query->param('dictionary'); + my $dictionary_path = $query->param('dictionary'); if ( ! $dictionary_path ) { print_error('You didn\'t supply a path to the dictionary file.'); @@ -177,8 +180,10 @@ sub handle_query() dbmopen %SourceChecker::token_dictionary, "$dictionary_path", 0666 || print_error("The dictionary you named could not be opened."); - $added_some_words = 0; + my $added_some_words = 0; + my ($file_of_good_english, $file_of_good_words, + $file_of_bad_words, $file_of_names); if ( $file_of_good_english = $query->param('ignore_english') ) { do_add_good_english($file_of_good_english); diff --git a/mozilla/webtools/bonsai/adminfuncs.pl b/mozilla/webtools/bonsai/adminfuncs.pl index 94bc952f094..a1ce02e2edc 100644 --- a/mozilla/webtools/bonsai/adminfuncs.pl +++ b/mozilla/webtools/bonsai/adminfuncs.pl @@ -16,6 +16,17 @@ # Corporation. Portions created by Netscape are Copyright (C) 1998 # Netscape Communications Corporation. All Rights Reserved. +use strict; +use diagnostics; + +# Shut up misguided -w warnings about "used only once". "use vars" just +# doesn't work for me. + +sub adminfuncs_pl_sillyness { + my $zz; + $zz = $::TreeID; +} + require 'globals.pl'; use Mail::Internet; @@ -46,7 +57,7 @@ sub SendHookMail { my (%substs, %headers, $body, $mail); local *MAIL; - $pathname = DataDir() . "/$filename"; + my $pathname = DataDir() . "/$filename"; return unless $hooklist; return unless -f $pathname; diff --git a/mozilla/webtools/bonsai/branchspam.cgi b/mozilla/webtools/bonsai/branchspam.cgi deleted file mode 100755 index d7a9f18a8d3..00000000000 --- a/mozilla/webtools/bonsai/branchspam.cgi +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bonsaitools/bin/perl -- -# -*- Mode: perl; indent-tabs-mode: nil -*- -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (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. - -# Query the CVS database. -# -$|=1; - -require 'CGI.pl'; - -print "Content-type: text/html - -"; - - -print " - -Questions, Comments, Feature requests? mail ltabb -
In the course of software development, it is necessary to form a branch -to do development on for a period of time. Sometimes you want to merge these -changes back into the trunk in one shot. Sometime you want to have the developers -merge the changes themselves, individually. This tool makes sure the developers -have merged their changes in individually. - -
The CVS Branch Spammer goes out and figures out what changes were made on -a branch and then looks to see if these changes where also made on the tip. It -formulates a mail message and send the mail to the indivual developers. The -individual developers look at the mail and reply that they have made their -changes in the tip. - -
To run this program answer the following questions and bonk the spam button. - - -
-
"; - diff --git a/mozilla/webtools/bonsai/branchspammer.cgi b/mozilla/webtools/bonsai/branchspammer.cgi deleted file mode 100755 index 0b64023c62b..00000000000 --- a/mozilla/webtools/bonsai/branchspammer.cgi +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bonsaitools/bin/perl -- -# -*- Mode: perl; indent-tabs-mode: nil -*- -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (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. - - -require 'lloydcgi.pl'; -require 'timelocal.pl'; -require 'cvsquery.pl'; - -$| = 1; - -print "Content-type: text/html - -"; - -$CHECKIN_DATA_FILE = 'data/checkinlog_m_src'; -$CHECKIN_INDEX_FILE = 'data/index_m_src'; - -# -# build a module map -# -$query_module = $form{'module'}; - -@query_dirs = split(/[;, \t]+/, $form{'dir'}); - -$query_date_type = $form{'date'}; -$query_date_min = time-(24*60*60*15); -$query_who ='' ; -$query_branch = $form{'branch'}; - - -print "";
-for $ci (@$result) {
- $ci->[$CI_LOG] = '';
- $s = join("|",@$ci);
- print "$s\n";
-}
-
diff --git a/mozilla/webtools/bonsai/countcheckins.cgi b/mozilla/webtools/bonsai/countcheckins.cgi
index fcccb7cff2c..533cfeb3a76 100755
--- a/mozilla/webtools/bonsai/countcheckins.cgi
+++ b/mozilla/webtools/bonsai/countcheckins.cgi
@@ -17,6 +17,9 @@
# Corporation. Portions created by Netscape are Copyright (C) 1998
# Netscape Communications Corporation. All Rights Reserved.
+use diagnostics;
+use strict;
+
require 'CGI.pl';
use vars qw($CloseTimeStamp);
diff --git a/mozilla/webtools/bonsai/cvsblame.cgi b/mozilla/webtools/bonsai/cvsblame.cgi
index 3803ce5ebd0..6d39b0258c4 100755
--- a/mozilla/webtools/bonsai/cvsblame.cgi
+++ b/mozilla/webtools/bonsai/cvsblame.cgi
@@ -1,4 +1,4 @@
-#!/usr/bonsaitools/bin/perl --
+#!/usr/bonsaitools/bin/perl -w
# cvsblame.cgi -- cvsblame with logs as popups and allowing html in comments.
# -*- Mode: perl; indent-tabs-mode: nil -*-
@@ -37,10 +37,25 @@
# mark - highlight a line
#
+use diagnostics;
+use strict;
+
+# Shut up misguided -w warnings about "used only once". "use vars" just
+# doesn't work for me.
+
+sub sillyness {
+ my $zz;
+ $zz = $::progname;
+ $zz = $::revision_ctime;
+ $zz = $::revision_log;
+}
+
require 'CGI.pl';
require 'cvsblame.pl';
use SourceChecker;
+
+
$| = 1;
# Cope with the cookie and print the header, first thing. That way, if
@@ -57,22 +72,22 @@ print "\n";
# Some Globals
#
-$Head = 'CVS Blame';
-$SubHead = '';
+my $Head = 'CVS Blame';
+my $SubHead = '';
-@src_roots = getRepositoryList();
+my @src_roots = getRepositoryList();
# Do not use layers if the client does not support them.
-$useLayers = 1;
-$user_agent = $ENV{HTTP_USER_AGENT};
+my $useLayers = 1;
+my $user_agent = $ENV{HTTP_USER_AGENT};
if (not $user_agent =~ m@^Mozilla/4.@ or $user_agent =~ /MSIE/) {
$useLayers = 0;
}
# Init sanitiazation source checker
#
-$sanitization_dictionary = $::FORM{'sanitize'};
-$opt_sanitize = defined $sanitization_dictionary;
+my $sanitization_dictionary = $::FORM{'sanitize'};
+my $opt_sanitize = defined $sanitization_dictionary;
if ( $opt_sanitize )
{
dbmopen %SourceChecker::token_dictionary, "$sanitization_dictionary", 0664;
@@ -80,32 +95,33 @@ if ( $opt_sanitize )
# Init byrd's 'feature' to allow html in comments
#
-$opt_html_comments = &html_comments_init();
+my $opt_html_comments = &html_comments_init();
# Handle the "file" argument
#
-$filename = '';
+my $filename = '';
$filename = $::FORM{'file'} if defined($::FORM{'file'});
if ($filename eq '')
{
&print_usage;
exit;
}
-($file_head, $file_tail) = $filename =~ m@(.*/)?(.+)@;
+my ($file_head, $file_tail) = $filename =~ m@(.*/)?(.+)@;
# Handle the "rev" argument
#
-$opt_rev = '';
-$opt_rev = $::FORM{'rev'} if defined($::FORM{'rev'} && $::FORM{'rev'} ne 'HEAD');
-$browse_revtag = "HEAD";
-$browse_revtag = $opt_rev if ($opt_rev =~ /[A-Za-z]/);
-$revision = '';
+$::opt_rev = '';
+$::opt_rev = $::FORM{'rev'} if defined($::FORM{'rev'} && $::FORM{'rev'} ne 'HEAD');
+my $browse_revtag = "HEAD";
+$browse_revtag = $::opt_rev if ($::opt_rev =~ /[A-Za-z]/);
+my $revision = '';
# Handle the "root" argument
#
-if (defined($root = $::FORM{'root'}) && $root ne '') {
+my $root = $::FORM{'root'};
+if (defined $root && $root ne '') {
$root =~ s|/$||;
validateRepository($root);
if (-d $root) {
@@ -122,6 +138,7 @@ if (defined($root = $::FORM{'root'}) && $root ne '') {
# Find the rcs file
#
+my $rcs_filename;
foreach (@src_roots) {
$root = $_;
$rcs_filename = "$root/$filename,v";
@@ -139,21 +156,22 @@ exit;
found_file:
+ my $rcs_path;
($rcs_path) = $rcs_filename =~ m@$root/(.*)/.+?,v@;
CheckHidden($rcs_filename);
-# Parse the rcs file ($opt_rev is passed as a global)
+# Parse the rcs file ($::opt_rev is passed as a global)
#
$revision = &parse_cvs_file($rcs_filename);
-$file_rev = $revision;
+my $file_rev = $revision;
# Handle the "line_nums" argument
#
-$opt_line_nums = 1;
+my $opt_line_nums = 1;
if (exists($::COOKIE{'line_nums'})) {
-$opt_line_nums = 1 if $::COOKIE{'line_nums'} eq 'on';
+ $opt_line_nums = 1 if $::COOKIE{'line_nums'} eq 'on';
}
if (exists($::FORM{'line_nums'})) {
$opt_line_nums = 0 if $::FORM{'line_nums'} =~ /off|no|0/i;
@@ -161,20 +179,24 @@ if (exists($::FORM{'line_nums'})) {
}
# Option to make links to included files
-$opt_includes = 0;
+my $opt_includes = 0;
$opt_includes = 1 if (exists($::FORM{'includes'}) &&
$::FORM{'includes'} =~ /on|yes|1/i);
$opt_includes = 1 if $opt_includes && $file_tail =~ /(.c|.h|.cpp)$/;
-@text = &extract_revision($revision);
-die "$progname: Internal consistency error" if ($#text != $#revision_map);
+my @text = &extract_revision($revision);
+die "$::progname: Internal consistency error" if ($#text != $#::revision_map);
+my $use_html = 0;
+$use_html = 1 if exists($::FORM{'use_html'}) && $::FORM{'use_html'} eq '1';
# Handle the "mark" argument
#
-$mark_arg = '';
+my %mark_line;
+my $mark_arg = '';
$mark_arg = $::FORM{'mark'} if defined($::FORM{'mark'});
-foreach $mark (split(',',$mark_arg)) {
+foreach my $mark (split(',',$mark_arg)) {
+ my ($begin, $end);
if (($begin, $end) = $mark =~ /(\d*)\-(\d*)/) {
$begin = 1 if $begin eq '';
$end = $#text + 1 if $end eq '' || $end > $#text + 1;
@@ -203,23 +225,24 @@ print q(
);
-foreach $path (split('/',$rcs_path)) {
+my $link_path;
+foreach my $path (split('/',$rcs_path)) {
-# Customize this translation
+ # Customize this translation
$link_path .= url_encode2($path).'/';
- $lxr_path = Fix_LxrLink($link_path);
+ my $lxr_path = Fix_LxrLink($link_path);
print "$path/ ";
}
print "$file_tail ";
print " (";
print "$browse_revtag:" unless $browse_revtag eq 'HEAD';
print $revision if $revision;
print ")";
-$lxr_path = Fix_LxrLink("$link_path$file_tail");
+my $lxr_path = Fix_LxrLink("$link_path$file_tail");
print qq(
@@ -246,26 +269,30 @@ print qq(
);
-$open_table_tag = '