Compare commits

..

4 Commits

Author SHA1 Message Date
andrew%redhat.com
5dbc79ab0f (1) sync with Red Hat internal development tree.
git-svn-id: svn://10.0.0.236/branches/RedHat_FEATURE_19981104_BRANCH@18784 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-27 17:25:38 +00:00
andrew%redhat.com
b0217f8573 (1) sync up with prod4 at Red Hat
git-svn-id: svn://10.0.0.236/branches/RedHat_FEATURE_19981104_BRANCH@16520 18797224-902f-48f8-a5cc-f745e15eee43
1998-12-16 18:02:02 +00:00
andrew%redhat.com
d24f82b4a1 (1) Initial import of Red Hat customizations.
git-svn-id: svn://10.0.0.236/branches/RedHat_FEATURE_19981104_BRANCH@14370 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-10 22:16:39 +00:00
(no author)
6780d9d35f This commit was manufactured by cvs2svn to create branch
'RedHat_FEATURE_19981104_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/RedHat_FEATURE_19981104_BRANCH@14311 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-09 23:19:39 +00:00
142 changed files with 8306 additions and 18627 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

View File

@@ -0,0 +1,474 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: CGI.pl,v 1.4.2.3 1999-01-27 17:25:19 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Andrew Anderson <andrew@redhat.com>
# <david.gardiner@unisa.edu.au>
# Contains some global routines used throughout the CGI scripts of Bugzilla.
use diagnostics;
use strict;
use Socket;
use CGI::Carp qw(fatalsToBrowser);
require 'globals.pl';
# Implementations of several of the below were blatently stolen from CGI.pm,
# by Lincoln D. Stein.
# Get rid of all the %xx encoding and the like from the given URL.
sub url_decode {
my ($todecode) = (@_);
$todecode =~ tr/+/ /; # pluses become spaces
$todecode =~ s/%([0-9a-fA-F]{2})/pack("c",hex($1))/ge;
return $todecode;
}
# Quotify a string, suitable for putting into a URL.
sub url_quote {
my($toencode) = (@_);
$toencode=~s/([^a-zA-Z0-9_\-.])/uc sprintf("%%%02x",ord($1))/eg;
return $toencode;
}
sub html_quote {
my ($var) = (@_);
$var =~ s/\&/\&amp;/g;
$var =~ s/</\&lt;/g;
$var =~ s/>/\&gt;/g;
return $var;
}
sub value_quote {
my ($var) = (@_);
$var =~ s/\&/\&amp;/g;
$var =~ s/</\&lt;/g;
$var =~ s/>/\&gt;/g;
$var =~ s/"/\&quot;/g;
return $var;
}
sub navigation_header {
my $buglist_cookie = $::cgi->cookie('BUGLIST');
if ($buglist_cookie) {
my @bugs = split(/:/, $::cgi->cookie('BUGLIST'));
my $cur = lsearch(\@bugs, $::cgi->param('id'));
print $::cgi->b('Bug List:') . " (@{[$cur + 1]} of @{[$#bugs + 1]})\n",
$::cgi->a({-href=>"show_bug.cgi?id=$bugs[0]"}, 'First'),
$::cgi->a({-href=>"show_bug.cgi?id=$bugs[$#bugs]"}, 'Last'),
"\n";
if ($cur > 0) {
print $::cgi->a({-href=>"show_bug.cgi?id=$bugs[$cur - 1]"}, 'Prev');
} else {
print $::cgi->i($::cgi->font({-color=>"#777777"}, 'Prev'));
}
if ($cur < $#bugs) {
$::next_bug = $bugs[$cur + 1];
print $::cgi->a({-href=>"show_bug.cgi?id=$::next_bug"}, 'Next');
} else {
print $::cgi->i($::cgi->font({-color=>"#777777"}, 'Next'));
}
}
print $::cgi->table({-cellspacing=>'0', -cellpadding=>'0', -border=>'0'},
$::cgi->TR(
$::cgi->td({-width=>'150', -valign=>'CENTER'},
$::cgi->a({-href=>"query.cgi"}, 'Query page')),
$::cgi->td({-width=>'150', -valign=>'CENTER'},
$::cgi->a({-href=>"enter_bug.cgi"}, 'Enter new bug')),
$::cgi->td({-width=>'250', -valign=>'CENTER', -align=>'LEFT'},
$::cgi->startform(-method=>'POST', -action=>"show_bug.cgi"),
$::cgi->submit(-name=>'submit', -value=>"Show"),
"&nbsp;bug #&nbsp;",
$::cgi->textfield(-name=>'id', -size=>'6',
-value=>'', -override=>"1"),
$::cgi->endform,
)
)
);
}
sub make_options {
my ($src,$default,$isregexp) = (@_);
my $last = "";
my $popup = "";
my $found = 0;
foreach my $item (@$src) {
if ($item eq "-blank-" || $item ne $last) {
if ($item eq "-blank-") {
$item = "";
}
$last = $item;
if ($isregexp ? $item =~ $default : $default eq $item) {
$popup .= " <OPTION SELECTED VALUE=\"" . url_quote($item) . "\">" . url_decode($item) . "\n";
$found = 1;
} else {
$popup .= " <OPTION VALUE=\"" . url_quote($item) . "\">" . url_decode($item) . "\n";
}
}
}
if (!$found && $default ne "") {
$popup .= " <OPTION SELECTED>$default\n";
}
return $popup;
}
sub make_popup {
my ($name,$src,$default,$listtype,$onchange) = (@_);
my $popup = "<SELECT NAME=\"$name\"";
if ($listtype > 0) {
$popup .= " SIZE=\"5\"";
if ($listtype == 2) {
$popup .= " MULTIPLE";
}
}
if (defined $onchange && $onchange ne "") {
$popup .= " onchange=$onchange";
}
$popup .= ">" . make_options($src, $default,
($listtype == 2 && $default ne ""));
$popup .= "</SELECT>";
return $popup;
}
sub PasswordForLogin {
my ($login) = (@_);
my $query = "select cryptpassword from profiles where login_name = " .
SqlQuote($login);
SendSQL($query);
my $result = FetchOneColumn();
if (!defined $result) {
$result = "";
}
return $result;
}
sub confirm_login {
my ($nexturl) = (@_);
my $printed_header = 0;
# Uncommenting the following lines can help debugging...
# print $::cgi->header(-type=>'text/html');
# print "login: ", $::cgi->cookie('Bugzilla_login'), "<BR>\n";
# print "cookie: ", $::cgi->cookie('Bugzilla_logincookie'), "<BR>\n";
# print $::cgi->dump;
ConnectToDatabase();
my $authdomain = "";
my $authorized = 0;
my $rem_host = $::cgi->remote_host();
my $Bugzilla_logincookie_cookie = $::cgi->cookie("Bugzilla_logincookie");
my $Bugzilla_login_param = $::cgi->param("Bugzilla_login");
my $Bugzilla_password_param = $::cgi->param("Bugzilla_password");
# This construct is assenine, but perl bitches about
# an unintialized variable unless it's done this way
my $Bugzilla_login_cookie = $::cgi->cookie("Bugzilla_login") ?
$::cgi->cookie("Bugzilla_login") : "";
# Apache 1.3.x users: this requires "HostNameLookups on" to work
if (defined(Param('authdomain')) && $rem_host) {
$authdomain = Param('authdomain');
if ( $Bugzilla_login_cookie =~ /$authdomain$/ ) {
my @authnets = split (/,/, Param('authnet'));
for my $authnet (@authnets) {
my $ip_addr = unpack("N4", inet_aton($rem_host));
my ($network, $netmask) = split("/", $authnet);
$network = unpack("N4", inet_aton($network));
$netmask = unpack("N4", inet_aton($netmask));
my $net = $network & $netmask;
my $xor = $ip_addr ^ $net;
my $and = $ip_addr | $net;
if ($and == $ip_addr) {
$authorized = 1;
}
}
} else {
# We got here because we don't have a login cookie yet.
$authorized = 1;
}
if (!$authorized) {
print $::cgi->header(-type=>'text/html');
PutHeader("Unauthorized host");
print "You have connedted as a user from ",
$::cgi->i($authdomain), ", but you are not in ",
$::cgi->i($authdomain), ", currently.", $::cgi->p,
"You must either create a new username to use ",
"from your current location, or you must connect ",
"from an authorized host.";
exit;
}
}
my ($login_cookie, $logincookie_cookie, $password_cookie, $logincookie);
my $loginok = 0;
$logincookie = $Bugzilla_logincookie_cookie ?
$Bugzilla_logincookie_cookie : '';
if ($Bugzilla_login_param) {
if ($Bugzilla_login_param !~ /^[^@, ]*@[^@, ]*\.[^@, ]*$/) {
print $::cgi->header(-type=>'text/html');
PutHeader("Invalid e-mail address entered");
print "The e-mail address you entered ",
"($::cgi->b($Bugzilla_login_param)) ",
"didn't match our minimal syntax checking for a legal email ",
"address. A legal address must contain exactly one '\@', ",
"and at least one '.' after the \@, and may not contain any ",
"commas or spaces.\n$::cgi->p\nPlease click ",
"$::cgi->b('back') and try again.\n",
exit;
}
my $realcryptpwd = PasswordForLogin($Bugzilla_login_param);
my $mailpassword = $::cgi->param("PleaseMailAPassword");
if ($mailpassword) {
my $realpwd;
if ($realcryptpwd eq "") {
$realpwd = InsertNewUser($Bugzilla_login_param);
} else {
SendSQL("select password from profiles where login_name = " .
SqlQuote($Bugzilla_login_param));
$realpwd = FetchOneColumn();
}
my $template = "
To use the wonders of bugzilla, you can use the following:
E-mail address: %s
Password: %s
To change your password, go to:
%schangepassword.cgi
(Your bugzilla and CVS password, if any, are not currently synchronized.
Top hackers are working around the clock to fix this, as you read this.)
";
my $msg = sprintf($template, $Bugzilla_login_param,
$realpwd, Param("urlbase"));
Mail($Bugzilla_login_param, "", "Your bugzilla password", $msg);
print $::cgi->header(-type=>'text/html');
PutHeader("Password has been emailed.");
print "The password for the e-mail address\n",
"$Bugzilla_login_param has been e-mailed to that address.\n",
$::cgi->p,
"When the e-mail arrives, you can click ",
$::cgi->b('back'),
"\nand enter your password in the form there.\n";
exit;
}
my $enteredcryptpwd =
crypt($Bugzilla_password_param, substr($realcryptpwd, 0, 2));
if ($realcryptpwd eq "" || $enteredcryptpwd ne $realcryptpwd) {
print $::cgi->header(-type=>'text/html');
PutHeader("Login failed.");
print "The username or password you entered is not valid.\n";
print "Please click ", $::cgi->b('back'), " and try again.\n";
exit;
}
# FIXME: make path a config item
$login_cookie = $::cgi->cookie(-name=>'Bugzilla_login',
-value=>$Bugzilla_login_param,
-path=>"/bugzilla/",
-expires=>"Sun, 30-Jun-2029 00:00:00 GMT");
my $query = "insert into logincookies " .
"(userid,cryptpassword,hostname) " .
"values (@{[DBNameToIdAndCheck($Bugzilla_login_param)]}, " .
"@{[SqlQuote($realcryptpwd)]}, " .
"@{[SqlQuote($rem_host)]})";
SendSQL($query);
SendSQL("select LAST_INSERT_ID()");
$logincookie = FetchOneColumn();
# FIXME: make path a config item
$logincookie_cookie = $::cgi->cookie(-name=>'Bugzilla_logincookie',
-value=>$logincookie,
-path=>"/bugzilla/",
-expires=>"Sun, 30-Jun-2029 00:00:00 GMT");
# This next one just cleans out any old bugzilla passwords that may
# be sitting around in the cookie files, from the bad old days when
# we actually stored the password there.
$password_cookie = $::cgi->cookie(-name=>'Bugzilla_password',
-value=>'',
-path=>'/',
-expires=>'now');
my $oldlogin_cookie = $::cgi->cookie(-name=>'Bugzilla_login',
-value=>'',
-path=>'/',
-expires=>'now');
my $oldlogincookie_cookie=$::cgi->cookie(-name=>'Bugzilla_logincookie',
-value=>'',
-path=>'/',
-expires=>'now');
# I sincerely hope that the order that the cookies gets processed is
# deterministic in the future, or this may break
print $::cgi->header(
-cookie=>[$oldlogin_cookie, $oldlogincookie_cookie,
$login_cookie, $logincookie_cookie, $password_cookie]);
$printed_header = 1;
$loginok = 1;
}
#print $::cgi->h4("loginok: $loginok");
#print $::cgi->h4("login: $Bugzilla_login_cookie");
#print $::cgi->h4("cookie: $Bugzilla_logincookie_cookie");
if (!$loginok && $Bugzilla_login_cookie && $Bugzilla_logincookie_cookie) {
SendSQL("select profiles.login_name = " .
SqlQuote($Bugzilla_login_cookie) .
" and profiles.cryptpassword = logincookies.cryptpassword " .
"and logincookies.hostname = " .
SqlQuote($rem_host) .
" from profiles,logincookies where logincookies.cookie = '" .
$Bugzilla_logincookie_cookie .
"' and profiles.userid = logincookies.userid");
$loginok = FetchOneColumn();
if (!defined $loginok) {
$loginok = 0;
}
}
if ($loginok ne "1") {
print $::cgi->header(-type=>'text/html');
PutHeader("Please log in.");
#print $Bugzilla_login_cookie . $::cgi->br . "\n";
#print $Bugzilla_logincookie_cookie . $::cgi->br . "\n";
print "I need a legitimate e-mail address and password to continue.\n";
if (!defined $nexturl || $nexturl eq "") {
# Sets nexturl to be argv0, stripping everything up to and
# including the last slash.
$0 =~ m:[^/]*$:;
$nexturl = $&;
}
print $::cgi->startform(-method=>'POST', -action=>"$nexturl"),
$::cgi->table(
$::cgi->TR(
$::cgi->td({-align=>'RIGHT'},
$::cgi->b('E-mail address:')),
$::cgi->td(
$::cgi->textfield(-name=>'Bugzilla_login',
-size=>"35"))
),
$::cgi->TR(
$::cgi->td({-align=>'RIGHT'},
$::cgi->b('Password:')),
$::cgi->td(
$::cgi->password_field(-name=>'Bugzilla_password',
-size=>"35"))
)
);
foreach my $param ($::cgi->param) {
print $::cgi->hidden(-name=>$param,
-value=>$::cgi->param("$param"),
-override=>"1");
}
print $::cgi->submit(-name=>'GoAheadAndLogIn', -value=>'Login'),
$::cgi->hr,
"If you don't have a password, or have forgotten it, ",
"then please fill in the e-mail address above and click here: ",
$::cgi->submit(-name=>'PleaseMailAPassword',
-value=>'E-mail me a password'),
$::cgi->endform,
$::cgi->end_html;
# This seems like as good as time as any to get rid of old
# crufty junk in the logincookies table. Get rid of any entry
# that hasn't been used in a month.
SendSQL("delete from logincookies where to_days(now()) - to_days(lastused) > 30");
exit;
} else {
print $::cgi->header('text/html') unless $printed_header;
}
# Update the timestamp on our logincookie, so it'll keep on working.
SendSQL("update logincookies set lastused = null where cookie = $logincookie");
}
sub PutHeader {
my ($title, $h1, $h2) = (@_);
if (!defined $h1) {
$h1 = $title;
}
if (!defined $h2) {
$h2 = "";
}
print $::cgi->start_html(-title=>$title,
-BGCOLOR=>"#FFFFFF",
-TEXT=>"#000000",
-LINK=>"#0000EE",
-VLINK=>"#551A8B",
-ALINK=>"#FF0000");
print PerformSubsts(Param("bannerhtml"), undef);
print $::cgi->table(
{'-border' => "0",
'-cellpadding' => "12",
'-cellspacing' => "0",
'-width' => "100%"},
$::cgi->TR(
$::cgi->td(
$::cgi->table(
{'-border' => "0",
'-cellpadding' => "0",
'-cellspacing' => "2"},
$::cgi->TR(
$::cgi->td(
{'-valign' => "TOP",
'-align' => "CENTER",
'-nowrap' => "1"},
$::cgi->font({'-size' => "+3"},
$::cgi->b($h1))
)
),
$::cgi->TR(
$::cgi->td(
{'-valign' => "TOP",
'-align' => "CENTER"},
$::cgi->b($h2))
)
)
),
$::cgi->td(Param("blurbhtml"))
)
);
}
############# Live code below here (that is, not subroutine defs) #############
$| = 1;
# Uncommenting this next line can help debugging.
# print $::cgi->header('text/html'), "Hi mom";
# print $::cgi->dump;
1;

View File

@@ -0,0 +1,93 @@
This file contains only important changes made to Bugzilla. If you
are updating from an older verseion, make sure that you check this file!
For a more complete list of what has changed, use Bonsai
(http://cvs-mirror.mozilla.org/webtools/bonsai/cvsqueryform.cgi) to
query the CVS tree. For example,
http://cvs-mirror.mozilla.org/webtools/bonsai/cvsquery.cgi?module=all&branch=HEAD&branchtype=match&dir=mozilla%2Fwebtools%2Fbugzilla&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot
will tell you what has been changed in the last week.
11/11/98 added Net::SMTP support, updated defparams.pl, and depricated
changedmail in favor of changedto, changedcc, changedsubj, and
changedbody, and whinemail in favor of whineto, whinecc, whinesubj, and
whinebody, respectively. Based on work by David Gardiner
<david.gardiner@unisa.edu.au>.
10/27/98 security check for legal products in place. bug charts are not
available as an option if collectstats.pl has never been run. all products
get daily stats collected now. README updated: Chart::Base is listed as
a requirement, instructions for using collectstats.pl included as
an optional step. also got silly and added optional quips to bug
reports.
10/20/98 Moved to DBI/DBD setup. This will require using the perl
DBI module and the MySQL DBD driver.
10/17/98 modified README installation instructions slightly.
10/15/98 Added a security mechanism so that you can define groups of
users, and what fields those users are allowed to edit. Two new
tables were added (security and groups), and the profiles table was
extended to support this. The security table is a list of "labels"
and a number that maps to a bit. The idea is that you query the
label, get the bit field, and compare that to the permissions
given to the user via the bitmap in the groups table.
Cleaned up some of the error forms to include the generic header.
10/13/98 Added a new table called "platforms". This is used to build
the platform entries based on the product selected. There is a
makeplatformtable.sh that must be run to create and populate the new
table.
10/7/98 Added a new table called "products". Right now, this is used
only to have a description for each product, and that description is
only used when initially adding a new bug. Anyway, you *must* create
the new table (which you can do by running the new makeproducttable.sh
script). If you just leave it empty, things will work much as they
did before, or you can add descriptions for some or all of your
products.
9/15/98 Everything has been ported to Perl. NO MORE TCL. This
transition should be relatively painless, except for the "params"
file. This is the file that contains parameters you've set up on the
editparams.cgi page. Before changing to Perl, this was a tcl-syntax
file, stored in the same directory as the code; after the change to
Perl, it becomes a perl-syntax file, stored in a subdirectory named
"data". See the README file for more details on what version of Perl
you need.
So, if updating from an older version of Bugzilla, you will need to
edit data/param, change the email address listed for
$::param{'maintainer'}, and then go revisit the editparams.cgi page
and reset all the parameters to your taste. Fortunately, your old
params file will still be around, and so you ought to be able to
cut&paste important bits from there.
Also, note that the "whineatnews" script has changed name (it now has
an extension of .pl instead of .tcl), so you'll need to change your
cron job.
And the "comments" file has been moved to the data directory. Just do
"cat comments >> data/comments" to restore any old comments that may
have been lost.
9/2/98 Changed the way password validation works. We now keep a
crypt'd version of the password in the database, and check against
that. (This is silly, because we're also keeping the plaintext
version there, but I have plans...) Stop passing the plaintext
password around as a cookie; instead, we have a cookie that references
a record in a new database table, logincookies.
IMPORTANT: if updating from an older version of Bugzilla, you must run
the following commands to keep things working:
./makelogincookiestable.sh
echo "alter table profiles add column cryptpassword varchar(64);" | mysql bugs
echo "update profiles set cryptpassword = encrypt(password,substring(rand(),3, 4));" | mysql bugs

View File

@@ -0,0 +1,151 @@
This is Bugzilla. See <http://www.mozilla.org/bugs/>.
==========
DISCLAIMER
==========
This is not very well packaged code. It's not packaged at all. Don't
come here expecting something you plop in a directory, twiddle a few
things, and you're off and using it. Work has to be done to get
there. We'd like to get there, but it wasn't clear when that would
be, and so we decided to let people see it first.
============
INSTALLATION
============
(This section stolen heavily from the Bonsai INSTALL document. It's
also probably incomplete. "We're accepting patches", especially to
this document!)
First, you need some other things:
1) MySQL database server.
2) Perl5.004 or greater, including MySQL support and the MySQL DBD perl
module, along with the following modules:
Date::Format
Chart::Base
GD
DBI
Net::SMTP (from the libnet module)
these are available from your nearest CPAN server, see
http://www.perl.com/CPAN.
ftp://ftp.cpan.org/pub/CPAN/authors/id/GBARR/TimeDate-1.08.tar.gz
ftp://ftp.cpan.org/pub/CPAN/authors/id/DBONNER/Chart-0.99.tar.gz
ftp://ftp.cpan.org/pub/CPAN/authors/id/LDS/GD-1.18.tar.gz
ftp://ftp.cpan.org/pub/CPAN/authors/id/GBARR/libnet-1.0605.tar.gz
ftp://ftp.cpan.org/pub/CPAN/authors/id/TIMB/DBI-1.02.tar.gz
3) Some kind of HTTP server so you could use CGI scripts
Earlier versions of Bugzilla required TCL. THIS IS NO LONGER TRUE.
All dependencies on TCL have been removed.
1.1 Getting and setting up MySQL database
Visit MySQL homepage at http://www.tcx.se and grab the latest
stable binary release of the server. Sure, you can get sources and
compile them yourself, but binaries are the easiest and the fastest
way to get it up and running. Follow instructions found in
manual. There is a section about installing binary-only
distributions.
You should create database "bugs". It may be a good idea to make it
writable by all users on your machine and change access level
later. This would save you a lot of time trying to guess whether it's
permissions or a mistake in the script that make things fail.
1.2 HTTP server
You have a freedom of choice here - Apache, Netscape or any other
server on UNIX would do. The only thing - to make configuration easier
you'd better run HTTP daemon on the same machine that you run MySQL
server on. Make sure that you can access 'bugs' database with user
id you're running the daemon with.
globals.pl: $::db = Mysql->Connect("localhost", "bugs", "nobody", "")
In globals.pl, the database connect call uses a mysql account
name "bugs" (third argument to Mysql->Connect) to access the
bugs database. You may have to hack the code to use "nobody"
or whatever your HTTP server is running as.
2. Tweaking the Tools
All scripts look in /usr/bonsaitools/bin for perl. Make
the appropriate links or modify the paths in each script.
Make sure the directory containing the binaries is writable by the
web server. Bugzilla keeps some temporary files here.
Create an empty file in that directory named "comments"; make sure
it is writable by the web server. Also, create empty files named
"nomail" and "mail".
3. Setting up database
First, run mysql, and tell it "create database bugs;".
Now, you should be run all six scripts named make*.sh. This creates the
database tables and populates them a teeny bit.
4. Setting the parameters
At this point, you ought to be able to go and browse some pages. But you'd
like to customize some things.
Create yourself an account. (Try to enter a new bug, and it will
prompt you for your login. Give it your email address, and have it
mail you your password.) Go visit the query page; that ought to force
the creation of the "data/params" file in your installation dir. Edit the
data/params file, and change the line that sets "$::param{'maintainer'}" to
have your email address as the maintainer. Go visit the query page
again; there should now be a link at the bottom that invites you to
edit the parameters. (If you have cookies turned off, you'll have to
go to editparams.cgi manually.)
Tweak the parameters to taste. Be careful.
5. Set up the whining cron job.
It's a good idea to set up a daily cronjob that does
cd <your-installation-dir> ; ./whineatnews.pl
This causes email that gets sent to anyone who has a NEW bug that
hasn't been touched for several days. For more info, see the
whinedays and whinemail parameters.
6. Modifying your running system
Bugzilla optimizes database lookups by storing all relatively static
information in the versioncache file, located in the data/
subdirectory under your installation directory (we said before it
needs to be writable, right?!)
If you make a change to the structural data in your database (the
versions table for example), or to the "constants" encoded in
defparams.pl, you will need to remove the cached content from the data
directory (by doing a "rm data/versioncache"), or your changes won't
show up!
That file gets automatically regenerated whenever it's more than an
hour old, so Bugzilla will eventually notice your changes by itself,
but generally you want it to notice right away, so that you can test
things.
7. Optional: Bug Graphs
Place collectstats.pl in your crontab once/day to take a snapshot
of the number of open, assigned and reopened bugs for every
product. The tool will create a data/mining directory and append
the count to a file named for the product. After at least two points
of data are available, you can view a graph from the Bug Reports page.

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@@ -0,0 +1,146 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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): Terry Weissman <terry@mozilla.org>
# Provides a silly 'back-door' mechanism to let me automatically insert
# bugs from the netscape bugsystem. Other installations of Bugzilla probably
# don't need to worry about this file any.
use diagnostics;
use strict;
require "CGI.pl";
# Shut up misguided -w warnings about "used only once":
use vars %::versions;
ConnectToDatabase();
print "Content-type: text/plain\n\n";
# while (my ($key,$value) = each %ENV) {
# print "$key=$value\n";
# }
my $host = $ENV{'REMOTE_ADDR'};
SendSQL("select passwd from backdoor where host = '$host'");
my $passwd = FetchOneColumn();
if (!defined $passwd || !defined $::FORM{'passwd'} ||
$passwd ne crypt($::FORM{'passwd'}, substr($passwd, 0, 2))) {
print "Who are you?\n";
print "Env:\n";
while (my ($key,$value) = each %ENV) {
print "$key=$value\n";
}
print "\nForm:\n";
while (my ($key,$value) = each %::FORM) {
print "$key=$value\n";
}
exit;
}
my $prod = $::FORM{'product'};
my $comp = $::FORM{'component'};
my $version = $::FORM{'version'};
GetVersionTable();
sub Punt {
my ($label, $value) = (@_);
my $maintainer = Param("maintainer");
print "I don't know how to move into Bugzilla a bug with a $label of $value.
If you really do need to do this, speak to $maintainer and maybe he
can teach me.";
exit;
}
# Do remapping of things from BugSplat world to Bugzilla.
if ($prod eq "Communicator") {
$prod = "Mozilla";
$version = "other";
}
# Validate fields, and whine about things that we apparently couldn't remap
# into something legal.
if (!defined $::components{$prod}) {
Punt("product", $prod);
}
if (lsearch($::components{$prod}, $comp) < 0) {
Punt("component", $comp);
}
if (lsearch($::versions{$prod}, $version) < 0) {
Punt("version", $comp);
}
$::FORM{'product'} = $prod;
$::FORM{'component'} = $comp;
$::FORM{'version'} = $version;
$::FORM{'long_desc'} =
"(This bug imported from BugSplat, Netscape's internal bugsystem. It
was known there as bug #$::FORM{'bug_id'}
http://scopus.netscape.com/bugsplat/show_bug.cgi?id=$::FORM{'bug_id'}
Imported into Bugzilla on " . time2str("%D %H:%M", time()) . ")
" . $::FORM{'long_desc'};
$::FORM{'reporter'} =
DBNameToIdAndCheck("$::FORM{'reporter'}\@netscape.com", 1);
$::FORM{'assigned_to'} =
DBNameToIdAndCheck("$::FORM{'assigned_to'}\@netscape.com", 1);
my @list = ('reporter', 'assigned_to', 'product', 'version', 'rep_platform',
'op_sys', 'bug_status', 'bug_severity', 'priority', 'component',
'short_desc', 'long_desc', 'creation_ts', 'delta_ts');
my @vallist;
foreach my $i (@list) {
push @vallist, SqlQuote($::FORM{$i});
}
my $query = "insert into bugs (" .
join(',', @list) .
") values (" .
join(',', @vallist) .
")";
SendSQL($query);
SendSQL("select LAST_INSERT_ID()");
my $zillaid = FetchOneColumn();
print "Created bugzilla bug $zillaid\n";
system("./processmail $zillaid < /dev/null > /dev/null 2> /dev/null &");

View File

@@ -0,0 +1,559 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: bug_form.pl,v 1.1.2.3 1999-01-27 17:25:20 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Andrew Anderson <andrew@redhat.com>
use diagnostics;
use strict;
#use vars '%::versions';
#use vars '@::legal_priority';
#use vars @::legal_severity;
#use vars @::legal_sources;
#use vars @::legal_components;
#use vars @::legal_platforms;
#use vars @::legal_resolution_no_dup;
#use vars @::legal_classes;
require "security.pl";
my $query = "
select
bug_id,
product,
version,
rep_platform,
op_sys,
bug_status,
resolution,
priority,
bug_severity,
component,
assigned_to,
reporter,
bug_file_loc,
short_desc,
class,
view,
date_format(creation_ts,'Y-m-d')
from bugs
where bug_id = '" . $::bug_id . "'";
my $view_query = "SELECT type_id FROM type where name = 'public' ";
SendSQL($view_query);
my $type = FetchOneColumn();
$view_query = " and view = " . $type;
if (CanIView("view")){
$view_query = "";
}
$query .= $view_query;
#print $::cgi->pre("$query");
SendSQL($query);
my %bug;
my @row = "";
if (@row = FetchSQLData()) {
#print $::cgi->h1("@row");
#PutHeader("Bugzilla bug $::bug_id", "Bugzilla Bug", $::bug_id);
PutHeader($::header, $::h1, $::h2);
# avoid those damn 'used only once' warnings
$::header = $::h1 = $::h2 = "";
navigation_header();
my $count = 0;
foreach my $field ("bug_id", "product", "version", "rep_platform",
"op_sys", "bug_status", "resolution", "priority",
"bug_severity", "component", "assigned_to", "reporter",
"bug_file_loc", "short_desc", "class", "view",
"creation_ts") {
$bug{"$field"} = shift @row;
#print $::cgi->h2($field . " : " . $bug{"$field"});
if (!defined $bug{$field}) {
$bug{$field} = "";
}
$count++;
}
print $::cgi->hr;
} else {
PutHeader("Query Error", "Bugzilla Bug", "$::bug_id not found");
navigation_header();
exit 0;
}
my $source;
SendSQL("SELECT sources.source FROM sources WHERE sources.bug_id = '" . $::bug_id . "'");
if ($source = FetchOneColumn()) {
$bug{'source'} = $source;
}
$bug{'assigned_to'} = DBID_to_name($bug{'assigned_to'});
$bug{'reporter'} = DBID_to_name($bug{'reporter'});
$bug{'long_desc'} = GetLongDescription($::bug_id);
GetVersionTable();
my $bug_status_html = Param('bugstatushtml');
#
# These should be read from the database ...
#
my $resolution_popup = $::cgi->hidden(-name=>'resolution',
-value=>$bug{'resolution'}) .
$bug{'resolution'};
my $version_popup = $::cgi->hidden(-name=>"version",
-value=>$bug{'version'}) .
$bug{'version'};
my $platform_popup = $::cgi->hidden(-name=>"rep_platform",
-value=>$bug{'rep_platform'}) .
$bug{'rep_platform'};
my $priority_popup = $::cgi->hidden(-name=>"priority",
-value=>$bug{'priority'}) .
$bug{'priority'};
my $class_row = "&nbsp;";
my $source_popup = $::cgi->hidden(-name =>"source",
-value=>$bug{'source'});
my $sev_popup = $::cgi->hidden(-name=>"bug_severity",
-value=>$bug{'bug_severity'}) .
$bug{'bug_severity'};
my $component_popup = $::cgi->hidden(-name=>"component",
-value=>$bug{'component'}) .
$bug{'component'};
my $cc_element = $::cgi->td({-colspan=>"5"},
"&nbsp;" . ShowCcList($::bug_id));
my $add_cc = $::cgi->startform(
'-method' => "POST",
'-action' => "process_bug.cgi") .
$::cgi->hidden(-name=>"component",
-value=>$bug{'component'}) .
$::cgi->hidden(-name=>"version",
-value=>$bug{'version'}) .
$::cgi->hidden(-name=>"product",
-value=>$bug{'product'}) .
$::cgi->hidden(-name=>"id",
-value=>$::bug_id).
$::cgi->hidden(-name=>"knob", -value=>"add_cc") .
$::cgi->submit(
'-name' => "Add me to the CC list").
$::cgi->endform;
my $rem_cc = $::cgi->startform(
'-method' => "POST",
'-action' => "process_bug.cgi").
$::cgi->hidden(-name=>"component",
-value=>$bug{'component'}) .
$::cgi->hidden(-name=>"version",
-value=>$bug{'version'}) .
$::cgi->hidden(-name=>"product",
-value=>$bug{'product'}).
$::cgi->hidden(-name=>"id",
-value=>$::bug_id).
$::cgi->hidden(-name=>"knob", -value=>"rem_cc").
$::cgi->submit(
'-name' => "Remove me from the CC list").
$::cgi->endform;
my $URLBlock = "";
my $SummaryBlock = $::cgi->td({-align=>"RIGHT"}, "<B>Summary:</B>");
my $StatusBlock = $::cgi->br;
if (CanIEdit("bug_status", $bug{'reporter'}, $bug{'bug_id'})) {
my $resolution = lsearch(\@::legal_resolution_no_dup, "");
if ($resolution >= 0) {
splice(@::legal_resolution_no_dup, $resolution, 1);
}
$resolution_popup = $::cgi->popup_menu(-name=>'resolution',
'-values'=>\@::legal_resolution_no_dup,
-default=>$bug{'resolution'});
}
if (CanIEdit("version", $bug{'reporter'}, $bug{'bug_id'})) {
$version_popup = $::cgi->popup_menu(-name=>'version',
'-values'=>$::versions{$bug{'product'}},
-default=>$bug{'version'});
}
if (CanIEdit("rep_platform", $bug{'reporter'}, $bug{'bug_id'})) {
$platform_popup = $::cgi->popup_menu(-name=>'platform',
'-values'=>$::legal_platforms{$bug{'product'}},
-default=>$bug{'rep_platform'});
}
if (CanIEdit("priority", $bug{'reporter'}, $bug{'bug_id'})) {
$priority_popup = $::cgi->popup_menu(-name=>'priority',
'-values'=>\@::legal_priority,
-default=>$bug{'priority'});
}
my $class_popup = $::cgi->popup_menu(-name=>'class',
'-values'=>\@::legal_classes,
-default=>$bug{'class'});
if ($bug{'bug_status'} ne "NEW") {
if (CanIEdit("class", $bug{'reporter'}, $bug{'bug_id'})) {
$class_row = $::cgi->td({-align=>"RIGHT"},
$::cgi->a({-href=>"$bug_status_html#class"},
$::cgi->b('Class:'))
) .
$::cgi->td({-align=>"LEFT"}, $class_popup);
} else {
$class_popup = $::cgi->hidden(-name=>"class",
-value=>$bug{'class'}) .
$bug{'class'};
$class_row = $::cgi->td({-align=>"RIGHT"}, "&nbsp;"),
$::cgi->td({-align=>"LEFT"}, $class_popup);
}
}
if (CanIEdit("source", $bug{'reporter'}, $bug{'bug_id'})) {
$source_popup = $::cgi->popup_menu(-name=>'source',
'-values'=>\@::legal_sources,
-default=>$bug{'source'});
}
if (CanIEdit("bug_severity", $bug{'reporter'}, $bug{'bug_id'})) {
$sev_popup = $::cgi->popup_menu(-name=>'bug_severity',
'-values'=>\@::legal_severity,
-default=>$bug{'bug_severity'});
}
if (CanIEdit("component", $bug{'reporter'}, $bug{'bug_id'})) {
my @components = @{$::components{$bug{"product"}}};
$component_popup = $::cgi->popup_menu(-name=>'component',
'-values'=>\@components,
-default=>$bug{'component'});
}
if (CanIEdit("cc", $bug{'reporter'}, $bug{'bug_id'})) {
$cc_element = $::cgi->td({-colspan=>"5"},
$::cgi->textfield(-name=>"cc",
-size=>"60",
-value=>ShowCcList($::bug_id)));
$add_cc = "";
$rem_cc = "";
}
if (CanIEdit("bug_file_loc", $bug{'reporter'}, $bug{'bug_id'})) {
$URLBlock = $bug{'bug_file_loc'};
if (defined $URLBlock && $URLBlock ne "none" &&
$URLBlock ne "NULL" && $URLBlock ne "") {
$URLBlock = $::cgi->td({-align=>"RIGHT"},
$::cgi->a({-href=>"$URLBlock"},
$::cgi->b("URL:"))) .
$::cgi->td({-colspan=>"6"},
$::cgi->textfield(-name=>"bug_file_loc",
-value=>"$bug{'bug_file_loc'}",
-size=>"60"));
} else {
$URLBlock = $::cgi->td({-align=>"RIGHT"}, $::cgi->b("URL:")) .
$::cgi->td({-colspan=>"6"},
$::cgi->textfield(-name=>"bug_file_loc",
-value=>'',
-size=>"60"));
}
} else {
if (defined $URLBlock && $URLBlock ne "none" &&
$URLBlock ne "NULL" && $URLBlock ne "") {
$URLBlock = $::cgi->td({-align=>"RIGHT"}, $::cgi->b("URL:"),
$::cgi->hidden(-name=>"bug_file_loc",
-value=>"$bug{'bug_file_loc'}")).
$::cgi->td({-colspan=>"6"},
$::cgi->a({-href=>"$bug{'bug_file_loc'}"},
"$bug{'bug_file_loc'}"));
}
}
if (CanIEdit("short_desc", $bug{'reporter'}, $bug{'bug_id'})) {
$SummaryBlock .= $::cgi->td({-colspan=>"6"},
$::cgi->textfield(-name=>"short_desc",
-value=>"$bug{'short_desc'}",
-size=>"60"));
} else {
$SummaryBlock .= $::cgi->td({-colspan=>"6"}, "&nbsp;$bug{'short_desc'}",
$::cgi->hidden(-name=>"short_desc",
-value=>
$::cgi->escapeHTML("$bug{'short_desc'}")));
}
my $AdditionalCommentsBlock = $::cgi->br .
$::cgi->b("Additional Comments:") .
$::cgi->br .
$::cgi->textarea(-wrap=>"HARD",
-name=>"comment",
-rows=>"5",
-cols=>"70",
-value=>'',
-override=>'1') .
$::cgi->br;
my $maildir;
if ( -d "data/maildir/$bug{'bug_id'}" ) {
$maildir = $::cgi->td({-colspan=>"4"}, "&nbsp;$bug{'assigned_to'}") .
$::cgi->td(
$::cgi->a({-href=>"data/maildir/$bug{'bug_id'}"},
"Bug #${bug{'bug_id'}} email"));
} else {
$maildir = $::cgi->td("&nbsp;$bug{'assigned_to'}") .
$::cgi->td({-colspan=>"2", -align=>"RIGHT"},
"No email for Bug #${bug{'bug_id'}}");
}
if (CanIEdit("view", $bug{'reporter'}, $bug{'bug_id'})) {
my %view_labels;
my @view_values;
my @view_row;
my $view_query = "SELECT type_id,name from type";
SendSQL($view_query);
while(@view_row = FetchSQLData()) {
$view_labels{$view_row[0]} = $view_row[1];
push(@view_values, $view_row[0]);
}
$maildir .= $::cgi->td({-align=>"RIGHT"}, "View:");
$maildir .= $::cgi->td({-align=>"LEFT"},
$::cgi->popup_menu(
'-name' => 'view',
'-values' => \@view_values,
'-labels' => \%view_labels,
'-default' => $bug{'view'}
)
);
} else {
$maildir .= $::cgi->td({-colspan=>"2"}, "&nbsp;");
}
print $::cgi->start_html(-title=>"Bug $::bug_id -- $bug{'short_desc'}"),
$::cgi->startform(-name=>"changeform",
-method=>"POST",
-action=>"process_bug.cgi"),
$::cgi->hidden(-name=>"id", -value=>"$::bug_id"),
$::cgi->hidden(-name=>"was_assigned_to", -value=>"$bug{'assigned_to'}"),
$::cgi->hidden(-name=>"product", -value=>"$bug{'product'}"),
$::cgi->table({-cellspacing=>"2", -cellpadding=>"2", -border=>"0"},
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"}, $::cgi->b("Bug#:")),
$::cgi->td("&nbsp;$bug{'bug_id'}"),
$::cgi->td({-align=>"RIGHT"},
$::cgi->a({-href=>"$bug_status_html#rep_platform"},
$::cgi->b("Architecture:"))
),
$::cgi->td("&nbsp;$platform_popup"),
$::cgi->td({-align=>"RIGHT"}, $::cgi->b("Version:")),
$::cgi->td("&nbsp;$version_popup")
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"}, $::cgi->b("Product:")),
$::cgi->td({-colspan=>"1"}, "&nbsp;$bug{'product'}"),
$::cgi->td({-align=>"RIGHT"}, $::cgi->b("Reporter:")),
$::cgi->td({-colspan=>"3"}, "&nbsp;$bug{'reporter'}")
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"},
$::cgi->a({-href=>"$bug_status_html"},
$::cgi->b("Status:"))
),
$::cgi->td("&nbsp;$bug{'bug_status'}"),
$::cgi->td({-align=>"RIGHT"},
$::cgi->a({-href=>"$bug_status_html#priority"},
$::cgi->b("Priority:"))
),
$::cgi->td("&nbsp;$priority_popup"),
$class_row
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"},
$::cgi->a({-href=>"$bug_status_html"},
$::cgi->b("Resolution:"))
),
$::cgi->td("&nbsp;$bug{'resolution'}"),
$::cgi->td({-align=>"RIGHT"},
$::cgi->a({-href=>"$bug_status_html#severity"},
$::cgi->b("Severity:"))
),
$::cgi->td("&nbsp;$sev_popup"),
$::cgi->td({-align=>"RIGHT"}, $::cgi->b("Component:")),
$::cgi->td("&nbsp;$component_popup")
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"},
$::cgi->a({-href=>"$bug_status_html#assigned_to"},
$::cgi->b("Assigned&nbsp;To:"))),
$maildir
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"}, $::cgi->b("Cc:&nbsp")),
$cc_element
),
$::cgi->TR($URLBlock),
$::cgi->TR($SummaryBlock)
),
$AdditionalCommentsBlock;
my $status = $bug{'bug_status'};
my @trans;
my $transition;
SendSQL("select trans from states where state = '$status'");
while (@row = FetchSQLData()) {
push(@trans, @row);
}
my @radio_values;
my %radio_labels;
my $default = "none";
my $tablerow;
my @tabledata;
if(CanIEdit("bug_status", $bug{'reporter'}, $bug{'bug_id'})) {
foreach $transition (@trans) {
if ($transition eq $status) {
push(@radio_values, "none");
$radio_labels{"none"} = "Leave as " .
$::cgi->b($status) . $::cgi->br;
}
if ($transition eq "VERIFIED" && $status ne "VERIFIED") {
push(@radio_values, "verify");
$radio_labels{"verify"} = $::cgi->b('VERIFY') .
" bug as $class_popup" . $::cgi->br;
}
if ($transition eq "ASSIGNED") {
if (CanIEdit("assigned_to", $bug{'reporter'}, $bug{'bug_id'})) {
my $assign_element = $::cgi->textfield(-name=>"assigned_to",
-size=>"32",
-value=>"$bug{'assigned_to'}");
push(@radio_values, "reassign");
$radio_labels{"reassign"} =
"Assign bug to $assign_element<BR>";
push(@radio_values, "reassignbycomponent");
$radio_labels{"reassignbycomponent"} =
"Assign bug to owner of selected component" . $::cgi->br;
}
}
if ($transition eq "RESOLVED") {
if (CanIEdit("resolution", $bug{'reporter'}, $bug{'bug_id'})) {
if ($bug{'resolution'} ne "") {
push(@radio_values, "clearresolution");
$radio_labels{"clearresolution"} =
"Clear the resolution (remove the current " .
"resolution of " . $::cgi->b($bug{'resolution'}) .
")" . $::cgi->br;
}
push (@radio_values, "resolve");
$radio_labels{"resolve"} = "<B>RESOLVE</B> bug, changing " .
$::cgi->a({-href=>"$bug_status_html"}, "resolution") .
" to " . $resolution_popup . $::cgi->br;
push(@radio_values, "duplicate");
$radio_labels{"duplicate"} =
"Resolve bug, mark it as duplicate of bug #" .
$::cgi->textfield(-name=>"dup_id", -size=>"6") . $::cgi->br;
}
}
if ($transition eq "REOPENED" and $status ne "REOPENED") {
push(@radio_values, "reopen");
$radio_labels{"reopen"} = "Reopen bug" . $::cgi->br;
# if the bug is resolved, and they add
# a comment, we need to reopen the bug
$default = "reopen";
}
if ($transition eq "CLOSED" and $status ne "CLOSED") {
push(@radio_values, "close");
$radio_labels{"close"} = "Mark bug as " .
$::cgi->b('CLOSED') . $::cgi->br;
}
}
if ($status ne "NEW" &&
CanIEdit("source", $bug{'reporter'}, $bug{'bug_id'})) {
push(@radio_values, "newsource");
$radio_labels{"newsource"} =
"Another report of this bug came from $source_popup" . $::cgi->br;
}
foreach my $radio (@radio_values) {
$tablerow = $::cgi->TR(
$::cgi->td({-valign=>"CENTER", -align=>"CENTER"},
$::cgi->radio_group(-name=>"knob",
'-values'=>["$radio"],
-default=>$default,
-linebreak=>"true",
-labels=>{"$radio" => " "}),
"&nbsp;"
),
$::cgi->td({-valign=>"CENTER", -align=>"LEFT"},
$radio_labels{$radio}
)
);
push(@tabledata, $tablerow);
}
print $::cgi->table({-border=>"0",
-cellpadding=>"0",
-cellspacing=>"0"},
@tabledata
);
} else {
print $::cgi->hidden(-name=>"knob", -value=>"none");
}
print $::cgi->table({'-border' => '0'},
$::cgi->TR(
$::cgi->td({'-valign' => 'top'},
$::cgi->submit(
'-name' => "submit",
'-value' => "Commit"
)
),
$::cgi->td({'-valign' => 'top'},
$::cgi->reset,
$::cgi->endform
),
$::cgi->td({'-valign' => 'top'},
$add_cc
),
$::cgi->td({'-valign' => 'top'},
$rem_cc
)
)
),
$::cgi->br,
$::cgi->font({-size=>"+1"},
$::cgi->a({-href=>"show_activity.cgi?id=$::bug_id"},
$::cgi->b("View Bug Activity")),
$::cgi->a({-href=>"long_list.cgi?buglist=$::bug_id"},
$::cgi->b("Format For Printing"))
),
$::cgi->br,
$::cgi->table(
$::cgi->TR(
$::cgi->td({-align=>"LEFT"}, $::cgi->b('Description:')),
$::cgi->td({-width=>"100%"}, "&nbsp;"),
$::cgi->td({-align=>"RIGHT"}, "Opened:&nbsp;$bug{'creation_ts'}")
)
),
$::cgi->hr,
$::cgi->pre($::cgi->escapeHTML("$bug{'long_desc'}")),
$::cgi->hr;
# To add back option of editing the long description, insert after the above
# long_list.cgi line:
# %::cgi->a({-href=>"edit_desc.cgi?id=$::bug_id"}, "Edit Long Description")
navigation_header();
print $::cgi->end_html;

View File

@@ -0,0 +1,180 @@
<!--
The contents of this file are subject to the Mozilla 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/MPL/
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 Bugzilla Bug Tracking System.
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): Terry Weissman <terry@mozilla.org>
Andrew Anderson <andrew@redhat.com>
-->
<? include "header.html" ?>
<H1 ALIGN="CENTER">A Bug's Life Cycle</H1>
The <B>status</B> and <B>resolution</B> field define and track the
life cycle of a bug.
<P>
<TABLE BORDER="1" CELLPADDING="4">
<TR ALIGN="CENTER" VALIGN="TOP">
<TD WIDTH="50%"><H1>STATUS</H1></TD>
<TD><H1>RESOLUTION</H1></TD>
</TR>
<TR VALIGN="TOP">
<TD>The <A NAME="status"><B>status</B></A> field indicates the general
health of a bug. Only certain status transitions are allowed.</TD>
<TD>The <A NAME="resolution"><B>resolution</B></A> field indicates what
happened to this bug.</TD>
</TR>
<TR VALIGN="TOP">
<TD>
<DL>
<DT><A NAME="new"><B>NEW</B></A>
<DD> This bug has recently been added to the list of bugs and must
be processed. Bugs in this state may be <B>VERIFIED</B>,
remain <B>NEW</B>, or resolved and marked <B>RESOLVED</B>.
<DT><A NAME="verified"><B>VERIFIED</B></A>
<DD> This bug has been verified as a bug. Bugs in this state may
be <B>ASSIGNED</B>, or remain <B>VERIFIED</B>.
<DT><A NAME="assigned"><B>ASSIGNED</B></A>
<DD> This bug is not yet resolved, but is assigned to the proper
person. From here bugs can be given to another person, or
resolved and become <B>RESOLVED</B>.
<DT><A NAME="reopened"><B>REOPENED</B></A>
<DD>This bug was once resolved, but the resolution was deemed
incorrect. For example, a <B>WORKSFORME</B> bug is
<B>REOPENED</B> when more information shows up and the bug is now
reproducible. From here bugs are either marked <B>ASSIGNED</B>
or <B>RESOLVED</B>.
</DL>
</TD>
<TD>
<DL>
<DD> No resolution yet. All bugs which are <B>NEW</B>,
<B>VERIFIED</B>, <B>ASSIGNED</B>, or <B>REOPENED</B> have the
resolution set to blank. All other bugs will be marked with
one of the following resolutions.
</DL>
</TD>
</TR>
<TR VALIGN="TOP">
<TD>
<DL>
<DT><A NAME="resolved"><B>RESOLVED</B></A>
<DD> A resolution has been found. From here bugs can be
<B>REOPENED</B>.
</DL>
</TD>
<TD>
<DL>
<DT><A NAME="fixed"><B>FIXED</B></A>
<DD> A fix for this bug has been found.
<DT><A NAME="discard"><B>DISCARD</B></A>
<DD> The problem described is not a bug.
<DT><A NAME="wontfix"><B>WONTFIX</B></A>
<DD> The problem described is a bug which will never be fixed.
<DT><A NAME="later"><B>LATER</B></A>
<DD> The problem described is a bug which will not be fixed in this
version of the product.
<DT><A NAME="remind"><B>REMIND</B></A>
<DD> The problem described is a bug which will probably not be fixed
in this version of the product, but might still be.
<DT><A NAME="duplicate"><B>DUPLICATE</B></A>
<DD> The problem is a duplicate of an existing bug. Marking a bug
duplicate requires the bug# of the duplicating bug and will at
least put that bug number in the description field.
<DT><A NAME="worksforme"><B>WORKSFORME</B></A>
<DD> All attempts at reproducing this bug were futile, reading the
code produces no clues as to why this behavior would occur. If
more information appears later, please re-assign the bug, for
now, file it.
</DL>
</TD>
</TR>
</TABLE>
<H1>Other Fields</H1>
<TABLE BORDER="1" CELLPADDING="4">
<TR>
<TH COLSPAN="2"><A NAME="severity">
<H2>Severity</H2></A>
</TH>
<TH COLSPAN="2"><a name="priority">
<h2>Priority</h2></a>
</TH>
</TR>
<TR>
<TD COLSPAN="2">This field describes the impact of a bug.</TD>
<TD COLSPAN="2">This field describes the importance and order in which
a bug should be fixed. The available priorities are:
</TD>
</TR>
<TR>
<TD><B>Security</B></TD>
<TD>security issue</TD>
<TD COLSPAN="2">&nbsp; </TD>
</TR>
<TR>
<TD><B>High</B></TD>
<TD>crashes, loss of data, severe memory leak</TD>
<TD><B>High</B></TD>
<TD>Most important</TD>
</TR>
<TR>
<TD><B>Normal</B></TD>
<TD>major loss of function</TD>
<TD><B>Normal</B></TD>
<TD>&nbsp; </TD>
</TR>
<TR>
<TD><B>Low</B></TD>
<TD>minor loss of function, or other problem where
easy workaround is present</TD>
<TD><B>low</B></TD>
<TD>Least important
</TR>
</TABLE>
<A NAME="rep_platform"><H2>Platform</H2></a>
This is the platform against which the bug was reported.
Legal platforms include:
<UL>
<LI> All (happens on all platforms; cross-platform bug)
<LI> i386
<LI> sparc
<LI> alpha
</UL>
<B>Note:</B> Selecting the option "All" does not select bugs assigned
against all platforms. It merely selects bugs that <B>occur</B> on
all platforms.
<A NAME="assigned_to"><H2>Assigned To</H2></a>
This is the person in charge of resolving the bug.
<A NAME="reporter"><H2>Reporter</H2></a>
This is the person who reported the bug.
<p>
The default status for queries is set to NEW, ASSIGNED and REOPENED. When
searching for bugs that have been resolved or verified, remember to set the
status field appropriately.
<? include "footer.html" ?>

View File

@@ -0,0 +1,738 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: buglist.cgi,v 1.10.2.3 1999-01-27 17:25:21 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Andrew Anderson <andrew@redhat.com>
use diagnostics;
use strict;
use CGI;
$::cgi = new CGI;
require "CGI.pl";
require "security.pl";
my $serverpush = 0;
# Put browsers that can do serverpush here -- MSIE and Lynx cannot,
# since Lynx will try to download this mime type we default to off
if ($::cgi->user_agent("Mozilla")) { $serverpush = 1; }
if ($serverpush) {
#print $::cgi->multipart_init(-boundary=>"thisrandomstring");
#print $::cgi->multipart_start(-type=>'text/html');
}
# Shut up misguided -w warnings about "used only once":
use vars @::legal_platforms,
@::versions,
@::legal_versions,
@::legal_product,
@::components,
@::legal_severity,
@::legal_priority,
@::default_column_list,
@::legal_resolution_no_dup;
ConnectToDatabase();
if ($::cgi->param('cmdtype') eq "") {
# This can happen if there's an old bookmark to a query...
$::cgi->param(-name=>'cmdtype', -value=>'doit', -override=>"1");
}
my $namedcmd = $::cgi->param('namedcmd');
my $newqueryname = $::cgi->param('newqueryname');
my $cookie = "";
my $query = "";
my $id = DBname_to_id($::cgi->cookie('Bugzilla_login'));
my $needheader = 0;
if (!$id) {
confirm_login();
} else {
$needheader = 1;
}
my $command = $::cgi->param('cmdtype');
CMD: for ($command) {
/^runnamed$/ && do {
my $query = "select query from queries where query_name = '" .
$namedcmd . "' and userid = $id";
SendSQL($query);
my $buffer = FetchOneColumn();
my $newcgi = new CGI($buffer);
$::cgi = $newcgi;
last CMD;
};
/^editnamed$/ && do {
my $query = "select query from queries where query_name = '" .
$namedcmd . "' and userid = $id";
SendSQL($query);
my $buffer = FetchOneColumn();
my $url = "query.cgi?" . $buffer;
print $::cgi->redirect(-uri=>"$url");
exit;
};
/^forgetnamed$/ && do {
$query = "delete from queries where query_name = '" .
$namedcmd . "' and userid = $id";
SendSQL($query);
print $::cgi->header(-type=>'text/html') if $needheader;
PutHeader("Forget what?");
print "OK, the <B>$namedcmd</B> query is gone.<P>";
print $::cgi->a({-href=>"query.cgi"}, "Go back to the query page.");
print $::cgi->end_html;
exit;
};
/^asnamed$/ && do {
print $::cgi->header(-type=>'text/html') if $needheader;
if ($::cgi->param('newqueryname') =~ /^[a-zA-Z0-9_ ]+$/) {
# make sure these don't get saved into the database
$::cgi->delete('Bugzilla_login');
$::cgi->delete('Bugzilla_password');
my $cmd = $::cgi->query_string();
$query = "select query from queries where userid = $id " .
"and query_name = '" . $newqueryname . "'";
SendSQL($query);
my $temp = FetchOneColumn();
if ($temp ne "") {
$query = "update queries set query = '" . $cmd .
"' where userid = $id and query_name = '" .
$newqueryname . "'";
} else {
$query = "insert into queries values ($id, '" .
$newqueryname . "', '" . $cmd . "')";
}
SendSQL($query);
PutHeader("OK, done.");
print "OK, you now have a new query named <B>$newqueryname</B>.\n";
print "<P>\n";
print $::cgi->a({-href=>"query.cgi"}, "Go back to the query page.");
print $::cgi->end_html;
} else {
PutHeader("Picky, picky.");
print "Query names can only have letters, digits, spaces, or ";
print "underbars. You entered \"<B>$newqueryname</B>\", which ";
print "doesn't cut it.\n<P>\n";
print "Click the <B>Back</B> button and type in a valid name ";
print "for this query.";
print $::cgi->end_html;
}
exit;
};
/^asdefault$/ && do {
print $::cgi->header(-type=>'text/html') if $needheader;
# make sure these don't get saved into the database
$::cgi->delete('Bugzilla_login');
$::cgi->delete('Bugzilla_password');
my $cmd = $::cgi->query_string();
$query = "select query from queries where userid = $id " .
"and query_name = 'defaultquery'";
SendSQL($query);
my $temp = FetchOneColumn();
if ($temp ne "") {
$query = "update queries set query = '" . $cmd .
"' where userid = $id and " .
"query_name = 'defaultquery'";
} else {
$query = "insert into queries values ($id, " .
"'defaultquery', '" . $cmd . "')";
}
SendSQL($query);
PutHeader("OK, default is set.");
print "OK, you now have a new default query.<P>";
print $::cgi->a({-href=>"query.cgi"},
"Go back to the query page, using the new default.");
exit;
};
}
sub DefCol {
my ($name, $k, $t, $s, $q) = (@_);
$::key{$name} = $k;
$::title{$name} = $t;
if (defined $s && $s ne "") {
$::sortkey{$name} = $s;
}
if (!defined $q || $q eq "") {
$q = 0;
}
$::needquote{$name} = $q;
}
DefCol("opendate", "date_format(bugs.creation_ts,'Y-m-d')", "Opened",
"bugs.creation_ts");
DefCol("changeddate", "date_format(bugs.delta_ts,'Y-m-d')", "Changed",
"bugs.delta_ts");
DefCol("severity", "substring(bugs.bug_severity, 1, 3)", "Sev",
"bugs.bug_severity");
DefCol("priority", "substring(bugs.priority, 1, 3)", "Pri", "bugs.priority");
DefCol("platform", "substring(bugs.rep_platform, 1, 3)", "Plt",
"bugs.rep_platform");
DefCol("owner", "assign.login_name", "Owner", "assign.login_name");
DefCol("reporter", "report.login_name", "Reporter", "report.login_name");
DefCol("status", "substring(bugs.bug_status,1,4)", "State", "bugs.bug_status");
DefCol("resolution", "substring(bugs.resolution,1,4)", "Result",
"bugs.resolution");
DefCol("summary", "substring(bugs.short_desc, 1, 60)", "Summary", "", 1);
DefCol("summaryfull", "bugs.short_desc", "Summary", "", 1);
DefCol("component", "substring(bugs.component, 1, 8)", "Comp",
"bugs.component");
DefCol("product", "substring(bugs.product, 1, 8)", "Product", "bugs.product");
DefCol("version", "substring(bugs.version, 1, 5)", "Vers", "bugs.version");
DefCol("os", "substring(bugs.op_sys, 1, 4)", "OS", "bugs.op_sys");
my @collist;
my $columnlist = $::cgi->cookie('COLUMNLIST');
if ($columnlist) {
@collist = split(/ /, $::cgi->cookie('COLUMNLIST'));
} else {
@collist = @::default_column_list;
}
my $dotweak = $::cgi->param('tweak');
if ($dotweak) {
confirm_login();
}
$query = "select bugs.bug_id";
foreach my $c (@collist) {
if (exists $::needquote{$c}) {
$query .= ",
\t$::key{$c}";
}
}
if ($dotweak) {
$query .= ",
bugs.product,
bugs.bug_status";
}
$query .= "
from bugs,
profiles assign,
profiles report,
versions projector
where bugs.assigned_to = assign.userid
and bugs.reporter = report.userid
and bugs.product = projector.program
and bugs.version = projector.value
";
my $view_query = "SELECT type_id FROM type WHERE name = 'public'";
SendSQL($view_query);
my $type = FetchOneColumn();
$view_query = "and bugs.view = '" . $type . "' ";
if (CanIView("view")){
$view_query = "";
}
$query .= $view_query;
# FIXME: should this be protected by a config option?
my $sql = $::cgi->param('sql');
if ($sql) {
$query .= "and (\n" . $::cgi->param('sql') . "\n)"
} else {
my @legal_fields = ("bug_id", "product", "version", "rep_platform", "op_sys",
"bug_status", "resolution", "priority", "bug_severity",
"assigned_to", "reporter", "bug_file_loc", "component");
foreach my $field ($::cgi->param) {
my $or = "";
if (lsearch(\@legal_fields, $field) != -1 && $::cgi->param($field) ne "") {
$query .= "\tand (\n";
if ($field eq "assigned_to" || $field eq "reporter") {
foreach my $p (split(/,/, $::cgi->param($field))) {
my $whoid = DBNameToIdAndCheck($p);
$query .= "\t\t${or}bugs.$field = $whoid\n";
$or = "or ";
}
} else {
my @arr = $::cgi->param($field);
foreach my $v (@arr) {
if ($v eq "(empty)") {
$query .= "\t\t${or}bugs.$field is null\n";
} else {
if ($v eq "---") {
$query .= "\t\t${or}bugs.$field = ''\n";
} else {
$query .= "\t\t${or}bugs.$field = " .
SqlQuote($v) . "\n";
}
}
$or = "or ";
}
}
$query .= "\t)\n";
}
}
}
if ($::cgi->param('changedin') ne "") {
my $c = trim($::cgi->param('changedin'));
if ($c ne "") {
if ($c !~ /^[0-9]*$/) {
PutHeader("Try Again");
print "The 'changed in last ___ days' field must be a simple ";
print "number. You entered \"$c\", which doesn't cut it.<P>";
print "Click the <B>Back</B> button and try again.";
print $::cgi->end_html;
exit;
}
$query .= "and to_days(now()) - to_days(bugs.delta_ts) <= $c ";
}
}
foreach my $f ("short_desc", "long_desc") {
if ($::cgi->param($f) ne "") {
my $s = SqlQuote(trim($::cgi->param($f)));
if ($s ne "") {
if ($::cgi->param($f . "_type") eq "regexp") {
$query .= "and $f regexp $s ";
} else {
$query .= "and instr($f, $s) ";
}
}
}
}
if (($::cgi->param('order') ne "") && ($::cgi->param('order') ne "")) {
$query .= "order by ";
ORDER: for ($::cgi->param('order')) {
/\./ && do {
# This (hopefully) already has fieldnames in it, so we're done.
last ORDER;
};
/Number/ && do {
$::cgi->param(-name=>'order',
-value=>"bugs.bug_id",
-override=>"1");
last ORDER;
};
/Import/ && do {
$::cgi->param(-name=>'order',
-value=>"bugs.priority",
-override=>"1");
last ORDER;
};
/Assign/ && do {
$::cgi->param(-name=>'order',
-value=>"assign.login_name, bugs.bug_status, priority, bugs.bug_id",
-override=>"1");
last ORDER;
};
# DEFAULT
$::cgi->param(-name=>'order',
-value=>"bugs.bug_status, priorities.rank, assign.login_name, bugs.bug_id",
-override=>"1");
}
$query .= $::cgi->param('order');
}
if ($serverpush) {
#print "Please stand by ... <p>\n";
#if ($::cgi->param('debug') ne "") {
# print "<pre>$query</pre>\n";
#}
}
SendSQL($query);
my $count = 0;
$::bugl = "";
sub pnl {
my ($str) = (@_);
$::bugl .= $str;
}
my $fields = $::cgi->query_string();
$fields =~ s/[&?]order=[^&]*//g;
$fields =~ s/[&?]cmdtype=[^&]*//g;
my $oldorder;
if ($::cgi->param('order') ne "") {
$oldorder = "," .$::cgi->param('order');
} else {
$oldorder = "";
}
if ($dotweak) {
pnl $::cgi->startform(-method=>'POST',
-action=>'process_bug.cgi',
-name=>'changeform');
}
my @tabledata;
push(@tabledata, $::cgi->TR({align=>"LEFT"}),
$::cgi->th(
$::cgi->a({href=>"buglist.cgi?$fields&order=bugs.bug_id"},
"ID")
)
);
my $tablestart =
$::cgi->table({cellspacing=>"0", cellpadding=>"2"}) .
$::cgi->TR({align=>"LEFT"}) .
$::cgi->th .
$::cgi->a({href=>"buglist.cgi?$fields&order=bugs.bug_id"}, "ID");
foreach my $c (@collist) {
if (exists $::needquote{$c}) {
if ($::needquote{$c}) {
$tablestart .= $::cgi->th({width=>"100%", valign=>"LEFT"});
} else {
$tablestart .= $::cgi->th({valign=>"LEFT"});
}
if (defined $::sortkey{$c}) {
$tablestart .= $::cgi->a(
{href=>"buglist.cgi?$fields&order=$::sortkey{$c}$oldorder"},
"$::title{$c}"
);
} else {
$tablestart .= $::title{$c};
}
}
}
my @row;
my %seen;
my @bugarray;
my %prodhash;
my %statushash;
while (@row = FetchSQLData()) {
my $bug_id = shift @row;
if (!defined $seen{$bug_id}) {
$seen{$bug_id} = 1;
$count++;
if ($count % 200 == 0) {
# Too big tables take too much browser memory...
pnl "</TABLE>$tablestart";
}
push @bugarray, $bug_id;
pnl "<TR VALIGN=\"TOP\" ALIGN=\"LEFT\"><TD>";
if ($dotweak) {
pnl "<input type=\"checkbox\" name=\"id_$bug_id\">";
}
pnl "<A HREF=\"show_bug.cgi?id=$bug_id\">";
pnl "$bug_id</A> ";
foreach my $c (@collist) {
my $value = shift @row;
my $nowrap = "";
if (exists $::needquote{$c} && $::needquote{$c}) {
$value = html_quote($value);
} else {
$value = "<nobr>$value</nobr>";
}
pnl "<td $nowrap>$value";
}
if ($dotweak) {
my $value = shift @row;
$prodhash{$value} = 1;
$value = shift @row;
$statushash{$value} = 1;
}
pnl "\n";
}
}
my $buglist = join(":", @bugarray);
if ($serverpush) {
#print $::cgi->multipart_end;
#print $::cgi->multipart_start(-type=>'text/plain');
}
my $toolong = 0;
if (length($buglist) < 4000) {
# FIXME: make path configurable
$cookie = $::cgi->cookie(-name=>'BUGLIST',
-path=>"/bugzilla/",
-value=>$buglist);
} else {
# FIXME: make path configurable
$cookie = $::cgi->cookie(-name=>'BUGLIST',
-path=>"/bugzilla/",
-value=>'');
$toolong = 1;
}
print $::cgi->header(-cookie=>"$cookie");
PutHeader("Bug List");
print $::cgi->b(time2str("%a %b %e %T %Z %Y", time()));
if (defined $::cgi->param('debug')) {
print "<PRE>$query</PRE>\n";
}
if ($toolong) {
print "<h2>This list is too long for bugzilla's little mind; the\n";
print "Next/Prev/First/Last buttons won't appear.</h2>\n";
}
# This is stupid. We really really need to move the quip list into the DB!
my $quip;
if (open (COMMENTS, "<data/comments")) {
my @cdata;
while (<COMMENTS>) {
push @cdata, $_;
}
close COMMENTS;
$quip = $cdata[int(rand($#cdata + 1))];
} else {
$quip = "Bugzilla would like to put a random quip here, but nobody has entered any.";
}
print $::cgi->hr . $::cgi->i($::cgi->a({href=>"newquip.html"}, "$quip"));
print $::cgi->hr({size=>"10"}) . "$tablestart\n";
print $::bugl;
print "</TABLE>\n";
if ($count == 0) {
print "Zarro Boogs found.\n";
} elsif ($count == 1) {
print "One bug found.\n";
} else {
print "$count bugs found.\n";
}
if ($dotweak) {
GetVersionTable();
my $JSCRIPT=<<END;
numelements = document.changeform.elements.length;
function SetCheckboxes(value) {
for (var i=0 ; i<numelements ; i++) {
item = document.changeform.elements[i];
item.checked = value;
}
}
document.write("<input type="button" value="Uncheck All" onclick="SetCheckboxes(false);"><input type="button" value="Check All" onclick="SetCheckboxes(true);">");
END
my $resolution_popup = $::cgi->popup_menu(-name=>"resolution",
'-values'=>@::legal_resolution_no_dup,
-defaults=>"FIXED");
my @prod_list = keys %prodhash;
my @list = @prod_list;
my @legal_versions;
my @legal_component;
if ($#prod_list == 1) {
@legal_versions = @{$::versions{$prod_list[0]}};
@legal_component = @{$::components{$prod_list[0]}};
}
my $version_popup = make_options(\@legal_versions, $::dontchange);
my $platform_popup = make_options($::legal_platforms{$prod_list[0]}, $::dontchange);
my $priority_popup = make_options(\@::legal_priority, $::dontchange);
my $sev_popup = make_options(\@::legal_severity, $::dontchange);
my $component_popup = make_options($::components{$::cgi->param('product')}, $::cgi->param('component'));
my $product_popup = make_options(\@::legal_product, $::dontchange);
my $bug_status_html = Param("bugstatushtml");
print $::cgi->hr,
$::cgi->table(
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"}, $::cgi->b("Product:")),
$::cgi->td($::cgi->popup_menu(-name=>"product",
'-values'=>@::legal_product)),
$::cgi->td({-align=>"RIGHT"}, $::cgi->b("Version:")),
$::cgi->td($::cgi->popup_menu(-name=>"version",
'-values'=>@::legal_versions))
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"},
$::cgi->a({-href=>"$bug_status_html#rep_platform"},
$::cgi->b("Platform:"))),
$::cgi->td($::cgi->popup_menu(-name=>"rep_platform",
'-values'=>@{$::legal_platforms{$prod_list[0]}})),
$::cgi->td({-align=>"RIGHT"},
$::cgi->a({-href=>"$bug_status_html#priority"},
$::cgi->b("Priority:"))),
$::cgi->td($::cgi->popup_menu(-name=>"priority",
'-values'=>$::legal_priority))
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"}, $::cgi->b("Component:")),
$::cgi->td($::cgi->popup_menu(-name=>"component",
-default=>$::cgi->param('component'),
'-values'=>@{$::components{$::cgi->param('product')}})),
$::cgi->td({-align=>"RIGHT"},
$::cgi->a({-href=>"$bug_status_html#severity"},
$::cgi->b("Severity:"))),
$::cgi->td($::cgi->popup_menu(-name=>"severity",
'-values'=>$::legal_severity))
),
),
$::cgi->hidden(-name=>"multiupdate", -value=>"Y"),
$::cgi->b("Additional Comments:"),
$::cgi->br,
$::cgi->textarea({-wrap=>"HARD"},
-name=>"comment",
-rows=>"5",
-cols=>"80"),
$::cgi->br;
# knum is which knob number we're generating, in javascript terms.
my $knum = 0;
print "
<INPUT TYPE=\"radio\" NAME=\"knob\" VALUE=\"none\" CHECKED>
Do nothing else<br>";
$knum++;
print $::cgi->radio_group(-name=>"knob",
-value=>"verify",
-default=>"-",
-linebreak=>'true',
-labels=>{"Verify bugs (change status to $::cgi->b('VERIFIED')"});
$knum++;
if (!defined $statushash{'CLOSED'} &&
!defined $statushash{'VERIFIED'} &&
!defined $statushash{'RESOLVED'}) {
print $::cgi->radio_group(-name=>"knob",
-value=>"clearresolution",
-default=>"-",
-linebreak=>'true',
-labels=>{"Clear the resolution"});
$knum++;
print $::cgi->radio_group(-name=>"knob",
-value=>"resolve",
-default=>"-",
-linebreak=>'true',
-labels=>{"Resolve bugs, changing $::cgi->a{-href=>$bug_status_html#resolution}, 'resolution' to $resolution_popup"});
$knum++;
}
if (!defined $statushash{'NEW'} &&
!defined $statushash{'ASSIGNED'} &&
!defined $statushash{'REOPENED'}) {
print $::cgi->radio_group(-name=>"knob",
-value=>"reopen",
-default=>"-",
-linebreak=>'true',
-labels=>{"Reopen bugs"});
$knum++;
}
my @statuskeys = keys %statushash;
if ($#statuskeys == 1) {
if (defined $statushash{'RESOLVED'}) {
print $::cgi->radio_group(-name=>"knob",
-value=>"verify",
-default=>"-",
-linebreak=>'true',
-labels=>{"Mark bugs as $::cgi->b('VERIFIED')"});
$knum++;
}
if (defined $statushash{'VERIFIED'}) {
print $::cgi->radio_group(-name=>"knob",
-value=>"close",
-default=>"-",
-linebreak=>'true',
-labels=>{"Mark bugs as $::cgi->b('CLOSED')"});
$knum++;
}
}
print $::cgi->radio_group(-name=>"knob",
-value=>"reassign",
-default=>"-",
-linebreak=>'true',
-labels=>{"$::cgi->a({-href=>$bug_status_html#assigned_to},
'Reassign') bugs to
$::cgi->textfield(-name=>'assigned_to',
-size=>'32',
-default=>$::cgi->cookie('Bugzilla_login'))"});
$knum++;
print $::cgi->radio_group(-name=>"knob",
-value=>"reassignbycomponent",
-default=>"-",
-linebreak=>'true',
-labels=>{"Reassign bugs to owner of selected component"});
$knum++;
print $::cgi->p,
$::cgi->font({-size=>"-1"},
"To make changes to a bunch of bugs at once:",
$::cgi->ol(
$::cgi->li("Put check boxes next to the " .
"bugs you want to change."),
$::cgi->li("Adjust above form elements. (It's " .
$::cgi->b("always") . "a good idea to " .
"add some comment explaining what you're doing.)"),
$::cgi->li("Click the below \"Commit\" button.")
)
),
$::cgi->submit(-name=>"submit", -value=>"Commit"),
$::cgi->endform;
}
if ($count > 0) {
print $::cgi->table(
$::cgi->TR(
$::cgi->td(
$::cgi->startform(-method=>"POST",
-action=>"long_list.cgi"),
$::cgi->hidden(-name=>'buglist', -value=>$buglist),
$::cgi->submit(-name=>"SUBMIT",
-value=>"Long Format"),
$::cgi->endform
),
$::cgi->td(
$::cgi->startform(-method=>"POST", -action=>"query.cgi"),
$::cgi->submit(-name=>"QUERY",
-value=>"Query Page"),
$::cgi->endform
),
$::cgi->td(
$::cgi->startform(-method=>"POST",
-action=>"colchange.cgi"),
$::cgi->hidden(-name=>'querystring',
-value=>$fields),
$::cgi->submit(-name=>"COLCHANGE",
-value=>"Change Columns"),
$::cgi->endform
)
)
);
if (!$dotweak && $count > 1) {
print $::cgi->a({-href=>"buglist.cgi?$fields&tweak=1"},
"Make changes to several of these bugs at once.") . "\n";
}
}
if ($serverpush) {
#print $::cgi->multipart_end;
}

View File

@@ -0,0 +1,97 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: changepassword.cgi,v 1.4.2.3 1999-01-27 17:25:22 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Andrew Anderson <andrew@redhat.com>
use CGI;
$::cgi = new CGI;
require "CGI.pl";
confirm_login();
if ($::cgi->param('submit')) {
if ($::cgi->param('pwd1') ne $::cgi->param('pwd2')) {
PutHeader("Try Again.");
print "The two passwords you entered did not match.\n";
print "Please click <b>Back</b> and try again.\n";
exit;
}
my $pwd = $::cgi->param('pwd1');
if ($pwd !~ /^[a-zA-Z0-9-_]*$/ || length($pwd) < 3 || length($pwd) > 15) {
PutHeader("Sorry; we're picky.");
print "Please choose a password that is between 3 and 15 characters " .
"long, and that contains only numbers, letters, hyphens, or " .
"underlines.\n<P>\nPlease click <b>Back</b> and try again.\n";
exit;
}
# Generate a random salt.
sub x {
my $sc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789./";
return substr($sc, int (rand () * 100000) % (length ($sc) + 1), 1);
}
my $salt = x() . x();
my $encrypted = crypt($pwd, $salt);
my $query = "update profiles set password='" . $pwd .
"',cryptpassword='" . $encrypted .
"' where login_name=" .
SqlQuote($::cgi->cookie(-name=>'Bugzilla_login'));
SendSQL($query);
$query = "update logincookies set cryptpassword = '" . $encrypted .
"' where cookie = '" .
$::cgi->cookie(-name=>'Bugzilla_logincookie') ."'";
SendSQL($query);
PutHeader("OK, done.");
print "Your new password has been set.\n<P>\n" .
$::cgi->a({href=>"query.cgi"}, "Back to query page.") . "\n";
} else {
PutHeader("Change your password");
print $::cgi->startform(-method=>"post") . "\n";
print $::cgi->table(
$::cgi->TR(
$::cgi->td({ALIGN=>"RIGHT"},
"Please enter the new password for " .
$::cgi->b($::cgi->cookie(-name=>"Bugzilla_login")). ":"),
$::cgi->td($::cgi->password_field(-name=>"pwd1",
-value=>'',
-override=>"1"))
),
$::cgi->TR(
$::cgi->td({ALIGN=>"RIGHT"},
"Re-enter your new password:"),
$::cgi->td($::cgi->password_field(-name=>"pwd2",
-value=>'',
-override=>"1"))
)
);
print $::cgi->submit(-name=>"submit", -value=>"Submit") .
$::cgi->endform . "\n";
}
print $::cgi->end_html . "\n";

View File

@@ -0,0 +1,111 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: colchange.cgi,v 1.4.2.3 1999-01-27 17:25:22 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Andrew Anderson <andrew@redhat.com>
use strict;
use diagnostics;
use CGI;
$::cgi = new CGI;
require "CGI.pl";
# The master list not only says what fields are possible, but what order
# they get displayed in.
my @masterlist = ("opendate", "changeddate", "severity", "priority",
"platform", "owner", "reporter", "status", "resolution",
"component", "product", "version", "summary", "summaryfull");
my @collist;
if ($::cgi->param('rememberedquery') ne "") {
if ($::cgi->param('resetit') ne "") {
@collist = @::default_column_list;
} else {
foreach my $i (@masterlist) {
if ($::cgi->param("column_$i") ne "") {
push @collist, $i;
}
}
}
my $list = join(" ", @collist);
# FIXME: make path a config option
my $cookie = $::cgi->cookie(-name=>"COLUMNLIST",
-value=>$list,
-path=>'/bugzilla/',
-expires=>"Sun, 30-Jun-2029 00:00:00 GMT");
my $rememberedquery = $::cgi->param('rememberedquery');
print $::cgi->redirect(-uri=>"buglist.cgi?$rememberedquery",
-cookie=>$cookie);
exit;
}
if ($::cgi->cookie('COLUMNLIST') ne "") {
@collist = split(/ /, $::cgi->cookie('COLUMNLIST'));
} else {
@collist = @::default_column_list;
}
print $::cgi->header('text/html');
PutHeader("Column Change");
my %desc;
foreach my $i (@masterlist) {
$desc{$i} = $i;
}
$desc{'summary'} = "Summary (first 60 characters)";
$desc{'summaryfull'} = "Full Summary";
my $query_string = $::cgi->query_string;
print "Check which columns you wish to appear on the list, and then click\n";
print "on submit.\n<P>\n";
print $::cgi->startform(-method=>"POST");
#print $::cgi->hidden(-name=>"rememberedquery",
# -value=>$query_string) . "\n";
print $::cgi->hidden(-name=>"rememberedquery",
-value=>$::cgi->param('querystring'),
-override=>"1") . "\n";
foreach my $i (@masterlist) {
if (lsearch(\@collist, $i) >= 0) {
print $::cgi->checkbox(-name=>"column_$i",
-label=>"$desc{$i}",
-checked=>'checked') . "<BR>\n";
} else {
print $::cgi->checkbox(-name=>"column_$i",
-label=>"$desc{$i}") . "<BR>\n";
}
}
print "<P>\n" . $::cgi->submit(-name=>"submit", -value=>"Submit") . "\n";
print $::cgi->endform . "\n";
print $::cgi->startform;
print $::cgi->hidden(-name=>"resetit",
-value=>"1",
-override=>"1") . "\n";
print $::cgi->submit(-name=>"submit", -value=>"Reset to Bugzilla default") . "\n";
print $::cgi->endform . "\n";

View File

@@ -0,0 +1,98 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: collectstats.pl,v 1.3.2.2 1999-01-27 17:25:23 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>,
# Harrison Page <harrison@netscape.com>
# Run me out of cron at midnight to collect Bugzilla statistics.
use diagnostics;
use strict;
use vars @::legal_product;
require "globals.pl";
ConnectToDatabase();
GetVersionTable();
foreach (@::legal_product) {
my $dir = "data/mining";
&check_data_dir ($dir);
&collect_stats ($dir, $_);
}
sub check_data_dir {
my $dir = shift;
if (! -d) {
mkdir $dir, 0777;
chmod 0777, $dir;
}
}
sub collect_stats {
my $dir = shift;
my $product = shift;
my $when = localtime (time);
my $query = <<FIN;
select count(bug_status) from bugs where
(bug_status='NEW' or bug_status='ASSIGNED' or bug_status='REOPENED')
and product='$product' group by bug_status
FIN
$product =~ s/\//-/gs;
my $file = join '/', $dir, $product;
my $exists = -f $file;
if (open DATA, ">>$file") {
SendSQL ($query);
my %count;
push my @row, &today;
while (my @n = FetchSQLData()) {
push @row, @n;
}
if (! $exists) {
print DATA <<FIN;
# Bugzilla daily bug stats
#
# do not edit me! this file is generated.
#
# fields: date|new|assigned|reopened
# product: $product
# created: $when
FIN
}
print DATA (join '|', @row) . "\n";
close DATA;
} else {
print "$0: $file, $!";
}
}
sub today {
my ($dom, $mon, $year) = (localtime(time))[3, 4, 5];
return sprintf "%04d%02d%02d", 1900 + $year, ++$mon, $dom;
}

View File

@@ -0,0 +1,288 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: defparams.pl,v 1.4.2.2 1999-01-27 17:25:23 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Andrew Anderson <andrew@redhat.com>
# This file defines all the parameters that we have a GUI to edit within
# Bugzilla.
use diagnostics;
use strict;
sub WriteParams {
foreach my $i (@::param_list) {
if (!defined $::param{$i}) {
$::param{$i} = $::param_default{$i};
}
}
mkdir("data", 0777);
chmod 0777, "data";
my $tmpname = "data/params.$$";
open(FID, ">$tmpname") || die "Can't create $tmpname";
my $v = $::param{'version'};
undef $::param{'version'}; # Don't write the version number out to
# the params file.
print FID GenerateCode('%::param');
$::param{'version'} = $v;
print FID "1;\n";
close FID;
rename $tmpname, "data/params" || die "Can't rename $tmpname to data/params";
chmod 0666, "data/params";
}
sub DefParam {
my ($id, $desc, $type, $default, $checker) = (@_);
push @::param_list, $id;
$::param_desc{$id} = $desc;
$::param_type{$id} = $type;
$::param_default{$id} = $default;
if (defined $checker) {
$::param_checker{$id} = $checker;
}
}
sub check_numeric {
my ($value) = (@_);
if ($value !~ /^[0-9]+$/) {
return "must be a numeric value";
}
return "";
}
@::param_list = ();
# OK, here are the definitions themselves.
#
# The type of parameters (the third parameter to DefParam) can be one
# of the following:
#
# t -- A short text entry field (suitable for a single line)
# l -- A long text field (suitable for many lines)
# b -- A boolean value (either 1 or 0)
# defenum -- This param defines an enum that defines a column in one of
# the database tables. The name of the parameter is of the form
# "tablename.columnname".
# This very first one is silly. At some point, "superuserness" should be an
# attribute of the person's profile entry, and not a single name like this.
#
# When first installing bugzilla, you need to either change this line to be
# you, or (better) edit the initial "params" file and change the entry for
# param(maintainer).
DefParam("maintainer",
"The email address of the person who maintains this installation of Bugzilla.",
"t",
'terry@mozilla.org');
DefParam("urlbase",
"The URL that is the common initial leading part of all Bugzilla URLs.",
"t",
"http://cvs-mirror.mozilla.org/webtools/bugzilla/",
\&check_urlbase);
sub check_urlbase {
my ($url) = (@_);
if ($url !~ m:^http.*/$:) {
return "must be a legal URL, that starts with http and ends with a slash.";
}
return "";
}
DefParam("usedespot",
"If this is on, then we are using the Despot system to control our database of users. Bugzilla won't ever write into the user database, it will let the Despot code maintain that. And Bugzilla will send the user over to Despot URLs if they need to change their password. Also, in that case, Bugzilla will treat the passwords stored in the database as being crypt'd, not plaintext.",
"b",
0);
DefParam("despotbaseurl",
"The base URL for despot. Used only if <b>usedespot</b> is turned on, above.",
"t",
"http://cvs-mirror.mozilla.org/webtools/despot/despot.cgi",
\&check_despotbaseurl);
sub check_despotbaseurl {
my ($url) = (@_);
if ($url !~ /^http.*cgi$/) {
return "must be a legal URL, that starts with http and ends with .cgi";
}
return "";
}
DefParam("authdomain",
"This defines a authorized domain. If a user's email address is in this domain, they must be using a computer from <I>authnet</I> in order to use bugzilla.",
"t",
"");
DefParam("authnet",
"This defines a set of authorized networks. If <I>authdomain</I> is defined, a user in that domain must be using a computer from these networks in order to use bugzilla.",
"t",
"");
DefParam("bannerhtml",
"The html that gets emitted at the head of every Bugzilla page.
Anything of the form %<i>word</i>% gets replaced by the defintion of that
word (as defined on this page).",
"l",
q{<TABLE BGCOLOR="#000000" WIDTH="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR><TD><A HREF="http://www.mozilla.org/"><IMG
SRC="http://www.mozilla.org/images/mozilla-banner.gif" ALT=""
BORDER=0 WIDTH=600 HEIGHT=58></A></TD></TR></TABLE>
<CENTER><FONT SIZE=-1>Bugzilla version %version%
</FONT></CENTER>});
DefParam("blurbhtml",
"A blurb that appears as part of the header of every Bugzilla page. This is a place to put brief warnings, pointers to one or two related pages, etc.",
"l",
"This is <B>Bugzilla</B>: the Mozilla bug system. For more
information about what Bugzilla is and what it can do, see
<A HREF=http://www.mozilla.org/>mozilla.org</A>'s
<A HREF=http://www.mozilla.org/bugs/><B>bug pages</B></A>.");
DefParam("bugstatushtml",
"This is the filename for the help file on bug status",
"t",
"bug_status.html");
DefParam("helphtml",
"This is the filename for the help file for the query page",
"t",
"help.html");
DefParam("fromaddress",
"This is the 'from' address used for all outgoing mail from bugzilla",
"t",
"bugzilla\@localhost");
DefParam("changedto",
"This is the default 'to' list for changedbody",
"t",
"",);
DefParam("changedcc",
"This is the default 'cc' list for changedbody",
"t",
"",);
DefParam("changedsubj",
q{This is the default subject for changedbody, %bugid% gets replaced
by the bug number, %neworchanged% is either "New" or "Changed",
depending on whether this mail is reporting a new bug or changes
made to an existing one. %summary% gets replaced by the summary
of this bug.},
"t",
'[Bug %bugid%] %neworchanged% - %summary%',);
DefParam("changedbody",
q{The email that gets sent to people when a bug changes. %bugid% gets
replaced by the bug number. %diffs% gets replaced by the diff text
from the old version to the new version of this bug. %neworchanged%
is either "New" or "Changed", depending on whether this mail is
reporting a new bug or changes made to an existing one. %summary%
gets replaced by the summary of this bug. %<i>anythingelse</i>% gets
replaced by the definition of that parameter (as defined on this page).},
"l",
"
%urlbase%show_bug.cgi?id=%bugid%
%diffs%");
DefParam("whinedays",
"The number of days that we'll let a bug sit untouched in a NEW state before our cronjob will whine at the owner.",
"t",
7,
\&check_numeric);
DefParam("whineto",
"The default to address for whinebody",
"t",
"");
DefParam("whinecc",
"The default cc address for whinebody",
"t",
"");
DefParam("whinesubj",
"The default subject for whinebody",
"t",
"");
DefParam("whinebody",
"The email that gets sent to anyone who has a NEW bug that hasn't been touched for more than <b>whinedays</b>. Within this text, %email% gets replaced by the offender's email address. %<i>anythingelse</i>% gets replaced by the definition of that parameter (as defined on this page).<p> It is a good idea to make sure this message has a valid From: address, so that if the mail bounces, a real person can know that there are bugs assigned to an invalid address.",
"l",
q{
[This e-mail has been automatically generated.]
You have one or more bugs assigned to you in the Bugzilla
bugsystem (%urlbase%) that require
attention.
All of these bugs are in the NEW state, and have not been touched
in %whinedays% days or more. You need to take a look at them, and
decide on an initial action.
Generally, this means one of three things:
(1) You decide this bug is really quick to deal with (like, it's INVALID),
and so you get rid of it immediately.
(2) You decide the bug doesn't belong to you, and you reassign it to someone
else. (Hint: if you don't know who to reassign it to, make sure that
the Component field seems reasonable, and then use the "Reassign bug to
owner of selected component" option.)
(3) You decide the bug belongs to you, but you can't solve it this moment.
Just use the "Accept bug" command.
To get a list of all NEW bugs, you can use this URL (bookmark it if you like!):
%urlbase%buglist.cgi?bug_status=NEW&assigned_to=%email%
Or, you can use the general query page, at
%urlbase%query.cgi.
Appended below are the individual URLs to get to all of your NEW bugs that
haven't been touched for a week or more.
You will get this message once a day until you've dealt with these bugs!
});
DefParam("defaultquery",
"This is the default query that initially comes up when you submit a bug. It's in URL parameter format, which makes it hard to read. Sorry!",
"t",
"bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&product=Mozilla&order=%22Importance%22");
1;

View File

@@ -0,0 +1,115 @@
#!/usr/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: doeditgroups.cgi,v 1.1.2.3 1999-01-27 17:25:24 andrew%redhat.com Exp $
#
# Contributor(s): Andrew Anderson <andrew@redhat.com>
use diagnostics;
use strict;
use CGI;
$::cgi = new CGI;
require "CGI.pl";
confirm_login();
if (Param("maintainer") ne $::cgi->cookie(-name=>'Bugzilla_login')) {
print "<H1>Sorry, you aren't the maintainer of this system.</H1>\n";
print "And so, you aren't allowed to edit the parameters of it.\n";
exit;
}
PutHeader("Saving groups");
SendSQL("select groupid, groupname, flags from groups order by groupid asc");
my @line;
my @groups;
while (@line = FetchSQLData()) {
push(@groups, join(":", @line));
}
SendSQL("select field, flag from security");
my @flags;
my @fields;
while (@line = FetchSQLData()) {
push(@flags, join(":", @line));
push(@fields, $line[0]);
}
my @updates;
my $curIndex = 0;
my $newflags = 0;
my $doupdate = 0;
foreach my $group (@groups) {
$newflags = $doupdate = 0;
(my $groupid, my $groupname, my $flags) = split(/:/, $group);
my $curItem = "$groupid" . "-groupid";
if ($::cgi->param($curItem) ne "") {
foreach my $field (@fields) {
$curItem = $groupid . "-" . $field;
if ($::cgi->param($curItem) ne "") {
#print "$curItem: $::cgi->param($curItem)<BR>";
$newflags += $::cgi->param($curItem);
}
}
$updates[$curIndex] = "update groups set ";
my $curItem = $groupid . "-groupname";
if (int($flags) != int($newflags)) {
$updates[$curIndex] .= "flags = '$newflags' ";
$doupdate = 1;
} elsif ($::cgi->param($curItem) ne $groupname) {
$updates[$curIndex] .= "groupname = '$::cgi->param($curItem)' ";
$doupdate = 1;
} elsif ((int($flags) != ($newflags)) &&
($::cgi->param($curItem) ne $groupname)) {
$updates[$curIndex] .= "flags = '$newflags', ".
"groupname = '$::cgi->param($curItem)";
$doupdate = 1;
}
$updates[$curIndex] .= "where groupid = '$groupid'";
if($doupdate) {
#print "adding $updates[$curIndex]<BR>\n";
$curIndex++;
} else {
#print "deleting $updates[$curIndex]<BR>\n";
undef $updates[$curIndex];
}
}
}
if($#updates) {
foreach my $update (@updates) {
#print "<PRE>$update</PRE>\n";
SendSQL($update) if ($update ne "");
}
print "<P>OK, done.<P>\n";
} else {
print "<P>Nothing to update.<P>\n";
}
print $::cgi->a({-href=>"editgroups.cgi"}, "Edit the groups some more.") .
$::cgi->br .
$::cgi->a({-href=>"query.cgi"}, "Go back to the query page.");

View File

@@ -0,0 +1,70 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: doeditowners.cgi,v 1.1.2.3 1999-01-27 17:25:24 andrew%redhat.com Exp $
#
# Contributor(s): Sam Ziegler <sam@ziegler.org>
# Andrew Anderson <andrew@redhat.com>
use diagnostics;
use strict;
use CGI;
$::cgi = new CGI;
require "CGI.pl";
confirm_login();
if (Param("maintainer") ne $::cgi->cookie('Bugzilla_login')) {
print "<H1>Sorry, you aren't the maintainer of this system.</H1>\n";
print "And so, you aren't allowed to edit the parameters of it.\n";
exit;
}
PutHeader("Saving new owners");
SendSQL("select program, value, initialowner from components order by program, value");
my @line;
my @updates;
my $curIndex = 0;
my $cgiItem;
while (@line = FetchSQLData()) {
my $curItem = "$line[0]_$line[1]";
my $cgiItem = $::cgi->param($curItem);
if ($cgiItem ne "") {
$cgiItem =~ s/\r\n/\n/;
if ($cgiItem ne "$line[2]") {
print "$line[0] : $line[1] is now owned by $cgiItem.<BR>\n";
$updates[$curIndex++] = "update components set initialowner = '$cgiItem' where program = '$line[0]' and value = '$line[1]'";
}
}
}
foreach my $update (@updates) {
#print $::cgi->pre($update);
SendSQL($update);
}
print "OK, done.<P>\n",
$::cgi->a({-href=>"editowners.cgi"}, "Edit the owners some more."),
$::cgi->br,
$::cgi->a({-href=>"query.cgi"}, "Go back to the query page.");

View File

@@ -0,0 +1,79 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: doeditparams.cgi,v 1.2.2.3 1999-01-27 17:25:24 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Andrew Anderson <andrew@redhat.com>
use diagnostics;
use strict;
use CGI;
$::cgi = new CGI;
require "CGI.pl";
require "defparams.pl";
# Shut up misguided -w warnings about "used only once":
use vars %::param,
%::param_default,
@::param_list;
confirm_login();
if (Param("maintainer") ne $::cgi->cookie('Bugzilla_login')) {
PutHeader("Denied!");
print $::cgi->h1("Sorry, you aren't the maintainer of this system.");
print "And so, you aren't allowed to edit the parameters of it.\n";
print $::cgi->end_html;
exit;
}
PutHeader("Saving new parameters");
my $cgiItem;
foreach my $i (@::param_list) {
# print "Processing $i...<BR>\n";
if ($::cgi->param("reset-$i") ne "") {
$::cgi->param(-name=>$i, -value=>$::param_default{$i}, -override=>"1");
}
$cgiItem = $::cgi->param($i);
$cgiItem =~ s/\r\n/\n/; # Get rid of windows-style line endings.
if ($cgiItem ne Param($i)) {
if (defined $::param_checker{$i}) {
my $ref = $::param_checker{$i};
my $ok = &$ref($cgiItem);
if ($ok ne "") {
print "New value for $i is invalid: $ok<p>\n";
print "Please hit <b>Back</b> and try again.\n";
exit;
}
}
print "Changed $i.<BR>\n";
$::param{$i} = $::cgi->param($i);
}
}
WriteParams();
print "OK, done.<P>\n",
$::cgi->a({-href=>"editparams.cgi"}, "Edit the params some more.");
$::cgi->a({-href=>"query.cgi"}, "Go back to the query page.");

View File

@@ -0,0 +1,115 @@
#!/usr/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: editgroups.cgi,v 1.1.2.3 1999-01-27 17:25:25 andrew%redhat.com Exp $
#
# Contributor(s): Andrew Anderson <andrew@redhat.com>
# Code derived from editparams.cgi
use diagnostics;
use strict;
use CGI;
$::cgi = new CGI;
require "CGI.pl";
confirm_login();
if (Param("maintainer") ne $::cgi->cookie(-name=>'Bugzilla_login')) {
PutHeader("Sorry, you aren't the maintainer of this system.\n");
print "And so, you aren't allowed to edit the parameters of it.\n";
exit;
}
my @line;
my $group;
my $counter = 1;
my $rowbreak = "</TR>" . $::cgi->TR($::cgi->td({-colspan=>"5"}, "<HR>"));
PutHeader("Edit Group Permissions");
print "This lets you edit the group permissions of bugzilla.\n";
print $::cgi->startform(-method=>"POST", -action=>"doeditgroups.cgi");
print "<TABLE BORDER=\"0\">\n";
SendSQL("select groupid, groupname, flags from groups order by groupid asc");
my @groups;
while (@line = FetchSQLData()) {
push(@groups, join(":", @line));
}
SendSQL("select field, flag from security");
my @flags;
while (@line = FetchSQLData()) {
push(@flags, join(":", @line));
}
foreach $group (@groups) {
(my $groupid, my $groupname, my $groupflag) = split(":", $group);
print $::cgi->TR(
$::cgi->td({-align=>"LEFT", -valign=>"TOP", -colspan=>"2"},
$::cgi->hidden(-name=>"${groupid}-groupid",
-value=>"$groupid"),
"$groupid:"
),
$::cgi->td({-valign=>"TOP", -colspan=>"4"},
$::cgi->textfield(-name=>"${groupid}-groupname",
-size=>"20",
-value=>"$groupname"),
$::cgi->hidden(-name=>"${groupid}-groupflag",
-value=>"$groupflag"),
)
);
print "<TR>\n";
foreach my $secline (@flags) {
(my $field, my $secflag) = split(":", $secline);
my $fieldname = $groupid . "-" . $field;
# Alas, CGI.pm's checkbox support can't duplicate this
print "<TD ALIGN=\"RIGHT\">$field:<INPUT TYPE=\"CHECKBOX\" " .
"NAME=\"$fieldname\" VALUE=\"$secflag\"";
print "CHECKED" if (int($secflag) & int($groupflag));
print "></TD>";
if ($counter > 4) {
print "</TR>\n<TR>\n";
$counter = 0;
}
$counter++;
}
$counter = 1;
print $rowbreak;
}
print "</TABLE>\n" .
$::cgi->submit(-name=>"submit", -value=>"Submit changes") .
$::cgi->endform .
$::cgi->p;
$::cgi->a({-href=>"query.cgi"},
"Skip all this, and go back to the query page.");

View File

@@ -0,0 +1,82 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: editowners.cgi,v 1.1.2.3 1999-01-27 17:25:25 andrew%redhat.com Exp $
#
# Contributor(s): Sam Ziegler <sam@ziegler.org>
# Andrew Anderson <andrew@redhat.com>
# Code derived from editparams.cgi
use diagnostics;
use strict;
use CGI;
$::cgi = new CGI;
require "CGI.pl";
confirm_login();
if (Param("maintainer") ne $::cgi->cookie('Bugzilla_login')) {
print $::cgi->h1("Sorry, you aren't the maintainer of this system");
print "And so, you aren't allowed to edit the parameters of it.\n";
exit;
}
my $rowbreak = $::cgi->TR($::cgi->td({-colspan=>"2"}, $::cgi->hr));
SendSQL("select program, value, initialowner from components order by program, value");
my @line;
my @table_array;
my $table_line;
my $curProgram = "";
while (@line = FetchSQLData()) {
if ($line[0] ne "$curProgram") {
push(@table_array, $rowbreak);
$table_line = $::cgi->TR(
$::cgi->th({-align=>"RIGHT", -valign=>"TOP"},
"$line[0]")
);
push(@table_array, $table_line);
$curProgram = $line[0];
}
$table_line = $::cgi->TR(
$::cgi->td({-valign=>"TOP"}, "$line[1]"),
$::cgi->td(
$::cgi->textfield(-size=>"80",
-name=>"$line[0]_$line[1]",
-value=>"$line[2]"))
);
push(@table_array, $table_line);
}
PutHeader("Edit Component Owners");
print "This lets you edit the owners of the program components of bugzilla.\n",
$::cgi->start_form(-action=>"doeditowners.cgi"),
$::cgi->table(@table_array),
$::cgi->submit(-name=>"submit", -value=>"Submit changes"),
$::cgi->endform,
$::cgi->p,
$::cgi->a({-href=>"query.cgi"},
"Skip all this, and go back to the query page"),
$::cgi->end_html;

View File

@@ -0,0 +1,133 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: editparams.cgi,v 1.4.2.3 1999-01-27 17:25:26 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Andrew Anderson <andrew@redhat.com>
use diagnostics;
use strict;
use CGI;
$::cgi = new CGI;
require "CGI.pl";
require "defparams.pl";
# Shut up misguided -w warnings about "used only once":
use vars @::param_desc,
@::param_list;
confirm_login();
if (Param("maintainer") ne $::cgi->cookie('Bugzilla_login')) {
PutHeader("Denied!");
print $::cgi->h1("Sorry, you aren't the maintainer of this system.");
print "And so, you aren't allowed to edit the parameters of it.\n";
print $::cgi->end_html;
exit;
}
PutHeader("Edit parameters");
print "This lets you edit the basic operating parameters of bugzilla.\n";
print "Be careful!\n";
print "<P>\n";
print "Any item you check Reset on will get reset to its default value.\n";
print $::cgi->start_form(-method=>"POST", -action=>"doeditparams.cgi");
my @table_array;
my $table_row;
my $rowbreak = $::cgi->TR($::cgi->td({-colspan=>"2"}, $::cgi->hr));
push(@table_array, $rowbreak);
foreach my $i (@::param_list) {
$table_row = $::cgi->TR(
$::cgi->th({-align=>"RIGHT", -valign=>"TOP"}, "$i:"),
$::cgi->td($::param_desc{$i}));
push(@table_array, $table_row);
$table_row = $::cgi->TR(
$::cgi->td({-valign=>"TOP"},
$::cgi->checkbox(-name=>"reset-$i", -label=>"Reset")));
push(@table_array, $table_row);
my $value = Param($i);
SWITCH: for ($::param_type{$i}) {
/^t$/ && do {
$table_row = $::cgi->textfield(-name=>"$i",
-size=>"80",
'-value'=>"$value",
-override=>"1");
push(@table_array, $table_row);
last SWITCH;
};
/^l$/ && do {
$table_row = $::cgi->textarea({-wrap=>"HARD"},
-name=>"$i",
-rows=>"10",
-cols=>"80",
'-value'=>"$value");
push(@table_array, $table_row);
last SWITCH;
};
/^b$/ && do {
my $default;
if ($value) {
$default = 'on';
} else {
$default = 'off';
}
$table_row = $::cgi->radio_group(-name=>"$i",
'-values'=>['on', 'off'],
-default=>$default);
push(@table_array, $table_row);
last SWITCH;
};
# DEFAULT
$table_row = $::cgi->font({-color=>"RED"},
$::cgi->blink("Unknown param type $::param_type{$i}!"));
push(@table_array, $table_row);
}
push(@table_array, $rowbreak);
}
$table_row = $::cgi->TR(
$::cgi->th({-align=>"RIGHT", -valign=>"TOP"}, "version:"),
$::cgi->td("What version of Bugzilla this is. This can't " .
"be modified here, but " . $::cgi->tt("%version%") .
" can be used as a parameter in places that " .
"understand such parameters.")
),
$::cgi->TR(
$::cgi->td("&nbsp;"),
$::cgi->td(Param('version'))
);
push(@table_array, $rowbreak);
print
$::cgi->table(@table_array),
$::cgi->reset,
$::cgi->submit(-name=>"submit", -value=>"Submit changes"),
$::cgi->endform;
$::cgi->p,
$::cgi->a({-href=>"query.cgi"},
"Skip all this, and go back to the query page.");

View File

@@ -0,0 +1,385 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: enter_bug.cgi,v 1.8.2.3 1999-01-27 17:25:26 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Andrew Anderson <andrew@redhat.com>
use diagnostics;
use strict;
use CGI;
$::cgi = new CGI;
require "CGI.pl";
require "security.pl";
# Shut up misguided -w warnings about "used only once":
use vars
@::legal_severity,
@::legal_sources,
@::legal_opsys,
@::legal_platforms,
@::legal_priority;
my $product = $::cgi->param('product');
confirm_login();
my $product_param = $::cgi->param('product');
if (!$product_param) {
GetVersionTable();
my @prodlist = keys %::versions;
if ($#prodlist != 0) {
PutHeader("Enter Bug");
my @tabledata;
my $tablerow;
foreach my $p (sort (@prodlist)) {
if (defined $::proddesc{$p}) {
$tablerow = $::cgi->TR(
$::cgi->td({-align=>"RIGHT", -valign=>"TOP"},
$::cgi->startform(-name=>"$p",
-action=>"enter_bug.cgi"),
$::cgi->hidden(-name=>'product',
-value=>"$p",
-override=>'1'),
$::cgi->submit(-value=>"$p"),
":"
),
$::cgi->td({-valign=>"CENTER"},
$::proddesc{$p}),
$::cgi->endform
);
} else {
$tablerow = $::cgi->TR(
$::cgi->td({-align=>"RIGHT", -valign=>"TOP"},
$::cgi->startform(-name=>"$p",
-action=>"enter_bug.cgi"),
$::cgi->hidden(-name=>'product',
-value=>"$p",
-override=>'1'),
$::cgi->submit(-value=>"$p"),
":"
),
$::cgi->td({-valign=>"TOP"},
"&nbsp;"),
$::cgi->endform
);
}
push(@tabledata, $tablerow);
$tablerow = '';
}
print
$::cgi->h2("First, you must pick a product on which to enter a bug"),
$::cgi->table(@tabledata),
$::cgi->end_html;
exit;
}
$::cgi->param(-name=>'product', -value=>"$prodlist[0]", -override=>"1");
}
sub formvalue {
my ($name, $default) = (@_);
if ($::cgi->param($name) ne "") {
return $::cgi->param($name);
}
if (defined $default) {
return $default;
}
return "";
}
sub pickplatform {
my $value = $::cgi->param("rep_platform");
if ($value ne "") {
return $value;
}
my $browser = $::cgi->user_agent();
for ($browser) {
/Mozilla.*\(X11/ && do {return "X-Windows";};
/Mozilla.*\(Windows/ && do {return "PC";};
/Mozilla.*\(Macintosh/ && do {return "Macintosh";};
/Mozilla.*\(Win/ && do {return "PC";};
# default
return "PC";
}
}
sub pickversion {
my $version = $::cgi->param('version');
my $browser = $::cgi->user_agent();
if (!$version) {
if ($browser =~ m@Mozilla[ /]([^ ]*)@) {
$version = $1;
}
}
if (lsearch($::versions{$product}, $version) >= 0) {
return $version;
} else {
my $versioncookie = $::cgi->cookie("VERSION-$product");
if ($versioncookie) {
if (lsearch($::versions{$product},
$::cgi->cookie("VERSION-$product")) >= 0) {
return $::cgi->cookie("VERSION-$product");
}
}
}
return $::versions{$product}->[0];
}
sub pickarch {
my $arch = $::cgi->param('arch');
if (!$arch) {
my $browser = $::cgi->user_agent();
if ($browser =~ m#Mozilla.*\(.*;.*;.* (.*)\)#) {
$arch = $1;
}
}
if( $arch =~ /i.86/ ) {
$arch = "i386";
}
if (lsearch($::legal_platforms{$product}, $arch) < 0) {
$arch = "";
}
return $arch;
}
sub pickcomponent {
my $result = $::cgi->param('component');
if ($result ne "" && lsearch($::components{$product}, $result) < 0) {
$result = "";
}
return $result;
}
sub pickos {
my $op_sys = $::cgi->param('op_sys');
if ($op_sys) {
return $op_sys;
}
my $browser = $::cgi->user_agent();
for ($browser) {
/Mozilla.*\(.*;.*; IRIX.*\)/ && do {return "IRIX";};
/Mozilla.*\(.*;.*; 32bit.*\)/ && do {return "Windows 95";};
/Mozilla.*\(.*;.*; 16bit.*\)/ && do {return "Windows 3.1";};
/Mozilla.*\(.*;.*; 68K.*\)/ && do {return "System 7.5";};
/Mozilla.*\(.*;.*; PPC.*\)/ && do {return "System 7.5";};
/Mozilla.*\(.*;.*; OSF.*\)/ && do {return "OSF/1";};
/Mozilla.*\(.*;.*; Linux.*\)/ && do {return "Linux";};
/Mozilla.*\(.*;.*; SunOS 5.*\)/ && do {return "Solaris";};
/Mozilla.*\(.*;.*; SunOS.*\)/ && do {return "SunOS";};
/Mozilla.*\(.*;.*; SunOS.*\)/ && do {return "SunOS";};
/Mozilla.*\(.*;.*; BSD\/OS.*\)/ && do {return "BSDI";};
/Mozilla.*\(Win16.*\)/ && do {return "Windows 3.1";};
/Mozilla.*\(Win95.*\)/ && do {return "Windows 95";};
/Mozilla.*\(WinNT.*\)/ && do {return "Windows NT";};
# default
return "other";
}
}
GetVersionTable();
my $assign_element = $::cgi->textfield(-name=>'assigned_to',
-value=>$::cgi->param('assigned_to'));
my $cc_element = $::cgi->textfield(-name=>'cc',
-size=>"45",
-value=>$::cgi->param('cc'));
my $priority_popup = $::cgi->popup_menu(-name=>'priority',
'-values'=>\@::legal_priority,
-default=>'normal');
my $sev_popup = $::cgi->popup_menu(-name=>'bug_severity',
'-values'=>\@::legal_severity,
-default=>'normal');
my $opsys_popup = $::cgi->popup_menu(-name=>'op_sys',
'-values'=>\@::legal_opsys,
-default=>pickos());
die "Product table empty" if ($::components{"$product"} eq "");
my @component_count = @{$::components{"$product"}};
my $component_popup = "";
if ($#component_count > 1) {
$component_popup = $::cgi->scrolling_list(-name=>'component',
-size=>"5",
'-values'=>$::components{$product},
-default=>$::cgi->param('component'));
} else {
$component_popup = $::cgi->scrolling_list(-name=>'component',
-size=>"5",
'-values'=>$::components{$product},
-default=>$component_count[0]);
}
my $platforms_popup = $::cgi->popup_menu(-name=>'rep_platform',
'-values'=>$::legal_platforms{$product},
-default=>pickarch());
PutHeader ("Enter Bug");
my $release_element = $::cgi->textfield(-name=>'release',
-size=>"5",
-value=>$::cgi->param('release'));
my $source_value = "bug reporting address and mailing lists";
my $source_cell;
if(CanIView("source")) {
$source_cell =
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"}, $::cgi->b("Source:")),
$::cgi->td({-colspan=>"5"},
$::cgi->popup_menu(-name=>'source',
'-values'=>\@::legal_sources,
-default=>'support mail')
)
);
} else {
$source_cell =
$::cgi->TR(
$::cgi->td({-colspan=>"6"},
$::cgi->hidden(-name=>"source", -value=>$source_value))
);
}
my $view_cell;
if(CanIView("view")) {
my %view_labels;
my @view_values;
my @view_row;
my $view_query = "SELECT type_id,name from type";
SendSQL($view_query);
while(@view_row = FetchSQLData()) {
$view_labels{$view_row[0]} = $view_row[1];
push(@view_values, $view_row[0]);
}
$view_cell = $::cgi->td({-align=>"RIGHT"}, $::cgi->b("View:")) .
$::cgi->td({-align=>"LEFT"},
$::cgi->popup_menu(
'-name' => 'view',
'-values' => \@view_values,
'-labels' => \%view_labels,
'-default' => '1'
)
);
} else {
$view_cell = $::cgi->td({-colspan=>"2"},
$::cgi->hidden(-name=>'view', -value=>'1'));
}
my $assigned_cell;
my $bug_status_html = Param("bugstatushtml");
if(CanIView("assigned_to")) {
$assigned_cell = $::cgi->TR(
$::cgi->td({-align=>"RIGHT"},
$::cgi->a({-href=>"$bug_status_html#assigned_to"},
$::cgi->b("Assigned To:"))),
$::cgi->td({-colspan=>"5"}, $assign_element,
"(Leave blank to assign to default owner)")
);
}
print $::cgi->startform(-name=>'enterForm', -action=>'post_bug.cgi'),
$::cgi->hidden(-name=>'bug_status', -value=>'NEW'),
$::cgi->hidden(-name=>'reporter',
-value=>$::cgi->cookie('Bugzilla_login')),
$::cgi->hidden(-name=>'product', -value=>$product),
$::cgi->table({-cellspacing=>"2", -cellpadding=>"0", -border=>"0"},
$::cgi->TR(
$::cgi->td({-align=>"RIGHT", -valign=>"TOP"},
$::cgi->b("Product:")),
$::cgi->td({-valign=>"TOP", -colspan=>"5"},
$product)
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT", -valign=>"TOP"},
$::cgi->b("Version:")),
$::cgi->td(Version_element(pickversion(), $product)),
$::cgi->td({-align=>"RIGHT", -valign=>"TOP"},
$::cgi->b("Component:")),
$::cgi->td({-colspan=>"3"}, $component_popup)
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"},
$::cgi->a({-href=>"$bug_status_html#priority"},
$::cgi->b("Priority:"))),
$::cgi->td($priority_popup),
$::cgi->td({-align=>"RIGHT"},
$::cgi->a({-href=>"$bug_status_html#severity"},
$::cgi->b("Severity:"))),
$::cgi->td($sev_popup)
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"},
$::cgi->a({-href=>"$bug_status_html#rep_platform"},
$::cgi->b("Architecture:"))),
$::cgi->td($platforms_popup),
$source_cell,
$view_cell,
$assigned_cell
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"},
$::cgi->b("Cc:")),
$::cgi->td({-colspan=>"5"}, $cc_element),
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"},
$::cgi->b("URL:")),
$::cgi->td({-colspan=>"5"},
$::cgi->textfield(-name=>'bug_file_loc',
-size=>'60',
-value=>$::cgi->param('bug_file_loc')))
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"},
$::cgi->b("Summary:")),
$::cgi->td({-colspan=>"5"},
$::cgi->textfield(-name=>'short_desc',
-size=>'60',
-value=>$::cgi->param('short_desc')))
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"},
$::cgi->b("Description:")),
$::cgi->td({-colspan=>"5"},
$::cgi->textarea(-wrap=>"HARD",
-name=>'comment',
-rows=>'10',
-cols=>'60',
-default=>$::cgi->param('comment')))
),
$::cgi->TR(
$::cgi->td("&nbsp;"),
$::cgi->td({-colspan=>"5"},
$::cgi->submit(-name=>'submit', -value=>" Commit "),
"&nbsp;&nbsp;&nbsp;&nbsp;",
$::cgi->reset(-name=>'reset'),
"&nbsp;&nbsp;&nbsp;&nbsp;",
$::cgi->submit(-name=>'maketemplate',
-value=>"Remember values as bookmarkable template"))
),
),
$::cgi->hidden(-name=>"form_name", -value=>"enter_bug"),
$::cgi->endform,
$::cgi->end_html;

View File

@@ -0,0 +1,606 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: globals.pl,v 1.9.2.3 1999-01-27 17:25:27 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Andrew Anderson <andrew@redhat.com>
# Contains some global variables and routines used throughout bugzilla.
use diagnostics;
use strict;
use DBI;
use English;
use Net::SMTP;
my $mailhost = 'localhost'; # change this to your SMTP server
# Change this to your specific database
$::driver = "mysql";
my $database = "bugs";
my $host = "localhost";
my $dsn = "DBI:" . $::driver . ":database=$database;host=$host";
my $user = "bugs";
my $pass = "";
use Date::Format; # For time2str().
# Contains the version string for the current running Bugzilla.
$::param{'version'} = '2.1rC';
$::dontchange = "--do_not_change--";
$::chooseone = "--Choose_one:--";
sub ConnectToDatabase {
if (!defined $::db) {
$::db = DBI->connect($dsn, $user, $pass)
|| die "Can't connect to database server: " . $DBI::errstr;
}
}
sub SendSQL {
#print "<PRE>SendSQL</PRE>\n";
my ($str) = (@_);
$::currentquery = $::db->prepare($str);
$::currentquery->execute
|| die "$str: ", $DBI::errstr;
}
sub MoreSQLData {
#print "<PRE>MoreSQLData</PRE>\n";
if (defined @::fetchahead) {
return 1;
}
if (@::fetchahead = $::currentquery->fetchrow_array) {
return 1;
}
return 0;
}
sub FetchSQLData {
#print "<PRE>FetchSQLData</PRE>\n";
if (defined @::fetchahead) {
my @result = @::fetchahead;
undef @::fetchahead;
return @result;
}
return $::currentquery->fetchrow_array;
}
sub FetchOneColumn {
my @row = FetchSQLData();
return $row[0];
}
@::legal_opsys = ("Windows 3.1", "Windows 95", "Windows NT", "System 7",
"System 7.5", "7.1.6", "AIX", "BSDI", "HP-UX", "IRIX",
"Linux", "OSF/1", "Solaris", "SunOS", "other");
@::default_column_list = ("severity", "priority", "owner",
"status", "resolution", "summary");
sub AppendComment {
my ($bugid,$who,$comment) = (@_);
#print $::cgi->h1("bugid: $bugid, who: $who, comment: $comment");
$comment =~ s/\r\n/\n/; # Get rid of windows-style line endings.
if ($comment =~ /^\s*$/) { # Nothin' but whitespace.
return;
}
SendSQL("select long_desc from bugs where bug_id = $bugid");
my $desc = FetchOneColumn();
my $now = time2str("%D %H:%M", time());
$desc .= "\n\n------- Additional Comments From $who $now -------\n";
$desc .= $comment;
SendSQL("update bugs set long_desc=" . SqlQuote($desc) .
" where bug_id=$bugid");
}
sub AppendCC {
my ($oldid, $newid) = (@_);
my $who;
SendSQL("SELECT who FROM cc WHERE bug_id = '$oldid'");
while(($who) = FetchSQLData()) {
# out with the old,
SendSQL("DELETE FROM cc WHERE bug_id = '$oldid' and who = '$who'");
# and in with the new
SendSQL("INSERT INTO cc VALUES ('$newid', '$who')");
}
# and don't forget the reporter of the old bug
SendSQL("SELECT reporter FROM bugs WHERE bug_id = '$oldid'");
($who) = FetchOneColumn();
SendSQL("INSERT INTO cc VALUES ('$newid', '$who')");
}
sub lsearch {
my ($list,$item) = (@_);
my $count = 0;
foreach my $i (@$list) {
if ($i eq $item) {
return $count;
}
$count++;
}
return -1;
}
sub Product_element {
my ($prod,$onchange) = (@_);
return make_popup("product", keys %::versions, $prod, 1, $onchange);
}
sub Component_element {
my ($comp,$prod,$onchange) = (@_);
my $componentlist;
if (! defined $::components{$prod}) {
$componentlist = [];
} else {
$componentlist = $::components{$prod};
}
my $defcomponent;
if ($comp ne "" && lsearch($componentlist, $comp) >= 0) {
$defcomponent = $comp;
} else {
$defcomponent = $componentlist->[0];
}
return make_popup("component", $componentlist, $defcomponent, 1, "");
}
sub Version_element {
my ($vers, $prod, $onchange) = (@_);
my $versionlist;
if (!defined $::versions{$prod}) {
$versionlist = [];
} else {
$versionlist = $::versions{$prod};
}
my $defversion = $versionlist->[0];
if (lsearch($versionlist,$vers) >= 0) {
$defversion = $vers;
}
return make_popup("version", $versionlist, $defversion, 1, $onchange);
}
sub Platform_element {
my ($arch, $prod, $onchange) = (@_);
my $archlist;
if (!defined $::platforms{$prod}) {
$archlist = [];
} else {
$archlist = $::platforms{$prod};
}
my $defarch = $archlist->[0];
if (lsearch($archlist,$arch) >= 0) {
$defarch = $arch;
}
return make_popup("platforms", $archlist, $defarch, 1, $onchange);
}
# Generate a string which, when later interpreted by the Perl compiler, will
# be the same as the given string.
sub PerlQuote {
my ($str) = (@_);
return SqlQuote($str);
# The below was my first attempt, but I think just using SqlQuote makes more
# sense...
# $result = "'";
# $length = length($str);
# for (my $i=0 ; $i<$length ; $i++) {
# my $c = substr($str, $i, 1);
# if ($c eq "'" || $c eq '\\') {
# $result .= '\\';
# }
# $result .= $c;
# }
# $result .= "'";
# return $result;
}
# Given the name of a global variable, generate Perl code that, if later
# executed, would restore the variable to its current value.
sub GenerateCode {
my ($name) = (@_);
my $result = $name . " = ";
if ($name =~ /^\$/) {
my $value = eval($name);
if (ref($value) eq "ARRAY") {
$result .= "[" . GenerateArrayCode($value) . "]";
} else {
$result .= PerlQuote(eval($name));
}
} elsif ($name =~ /^@/) {
my @value = eval($name);
$result .= "(" . GenerateArrayCode(\@value) . ")";
} elsif ($name =~ '%') {
$result = "";
foreach my $k (sort { uc($a) cmp uc($b)} eval("keys $name")) {
$result .= GenerateCode("\$" . substr($name, 1) .
"{'" . $k . "'}");
}
return $result;
} else {
die "Can't do $name -- unacceptable variable type.";
}
$result .= ";\n";
return $result;
}
sub GenerateArrayCode {
my ($ref) = (@_);
my @list;
foreach my $i (@$ref) {
push @list, PerlQuote($i);
}
return join(',', @list);
}
sub GenerateVersionTable {
ConnectToDatabase();
SendSQL("select value, program from versions order by value desc");
my @line;
my %varray;
my %carray;
my %parray;
while (@line = FetchSQLData()) {
my ($v,$p1) = (@line);
if (!defined $::versions{$p1}) {
$::versions{$p1} = [];
}
push @{$::versions{$p1}}, $v;
$varray{$v} = 1;
}
SendSQL("select value, program from components order by value");
while (@line = FetchSQLData()) {
my ($c,$p) = (@line);
if (!defined $::components{$p}) {
$::components{$p} = [];
}
my $ref = $::components{$p};
push @$ref, $c;
$carray{$c} = 1;
}
SendSQL("select product, description from products");
while (@line = FetchSQLData()) {
my ($p, $d) = (@line);
$::proddesc{$p} = $d;
}
SendSQL("select value, program from platforms");
while (@line = FetchSQLData()) {
my ($a,$p) = (@line);
if (!defined $::legal_platforms{$p}) {
$::legal_platforms{$p} = [];
}
my $ref = $::legal_platforms{$p};
push @$ref, $a;
$parray{$a} = 1;
}
my $cols = LearnAboutColumns("sources");
@::legal_sources = SplitEnumType($cols->{"source,type"});
$cols = LearnAboutColumns("bugs");
@::log_columns = @{$cols->{"-list-"}};
foreach my $i ("bug_id", "creation_ts", "delta_ts", "long_desc") {
my $w = lsearch(\@::log_columns, $i);
if ($w >= 0) {
splice(@::log_columns, $w, 1);
}
}
@::legal_classes = SplitEnumType($cols->{"class,type"});
@::legal_priority = SplitEnumType($cols->{"priority,type"});
@::legal_severity = SplitEnumType($cols->{"bug_severity,type"});
@::legal_bug_status = SplitEnumType($cols->{"bug_status,type"});
@::legal_resolution = SplitEnumType($cols->{"resolution,type"});
@::legal_resolution_no_dup = @::legal_resolution;
my $w = lsearch(\@::legal_resolution_no_dup, "DUPLICATE");
if ($w >= 0) {
splice(@::legal_resolution_no_dup, $w, 1);
}
my @list = sort { uc($a) cmp uc($b)} keys(%::versions);
@::legal_product = @list;
mkdir("data", 0777);
chmod 0777, "data";
my $tmpname = "data/versioncache.$$";
open(FID, ">$tmpname") || die "Can't create $tmpname: $ERRNO";
print FID GenerateCode('@::log_columns');
print FID GenerateCode('%::versions');
foreach my $i (@list) {
if (!defined $::components{$i}) {
$::components{$i} = "";
}
}
@::legal_versions = sort {uc($b) cmp uc($a)} keys(%varray);
print FID GenerateCode('@::legal_versions');
print FID GenerateCode('%::components');
@::legal_components = sort {uc($a) cmp uc($b)} keys(%carray);
print FID GenerateCode('@::legal_components');
@::legal_platforms = sort {uc($a) cmp uc($b)} keys(%parray);
print FID GenerateCode('%::legal_platforms');
foreach my $i('product', 'priority', 'severity', 'bug_status',
'resolution', 'resolution_no_dup') {
print FID GenerateCode('@::legal_' . $i);
}
print FID GenerateCode('%::proddesc');
print FID GenerateCode('@::legal_sources');
print FID GenerateCode('@::legal_classes');
print FID "1;\n";
close FID;
rename $tmpname, "data/versioncache" || die "Can't rename $tmpname to versioncache";
chmod 0666, "data/versioncache";
}
# Returns the modification time of a file.
sub ModTime {
my ($filename) = (@_);
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks)
= stat($filename);
return $mtime;
}
# This proc must be called before using legal_product or the versions array.
sub GetVersionTable {
my $mtime = ModTime("data/versioncache");
if (!defined $mtime || $mtime eq "") {
$mtime = 0;
}
if (time() - $mtime > 3600) {
GenerateVersionTable();
}
require 'data/versioncache';
if (!defined %::versions) {
GenerateVersionTable();
do 'data/versioncache';
if (!defined %::versions) {
die "Can't generate version info; tell terry.";
}
}
}
sub InsertNewUser {
my ($username) = (@_);
my $password = "";
for (my $i=0 ; $i<8 ; $i++) {
$password .= substr("abcdefghijklmnopqrstuvwxyz", int(rand(26)), 1);
}
SendSQL("SELECT groupid FROM groups where groupname = 'default'");
my $gid = FetchOneColumn();
SendSQL("insert into profiles (login_name, password, cryptpassword, groupid) values (@{[SqlQuote($username)]}, '$password', encrypt('$password'), $gid)");
return $password;
}
sub DBID_to_name {
my ($id) = (@_);
if (!defined $::cachedNameArray{$id}) {
SendSQL("select login_name from profiles where userid = $id");
my $r = FetchOneColumn();
if ($r eq "") {
$r = "__UNKNOWN__";
}
$::cachedNameArray{$id} = $r;
}
return $::cachedNameArray{$id};
}
sub DBname_to_id {
my ($name) = (@_);
my $sqlname = SqlQuote($name);
SendSQL("select userid from profiles where login_name = @{[SqlQuote($name)]}");
my $r = FetchOneColumn();
if (!defined $r || $r eq "") {
return 0;
}
return $r;
}
sub DBNameToIdAndCheck {
my ($name, $forceok) = (@_);
my $result = DBname_to_id($name);
if ($result > 0) {
return $result;
}
if ($forceok) {
InsertNewUser($name);
$result = DBname_to_id($name);
if ($result > 0) {
return $result;
}
print "Yikes; couldn't create user $name. Please report problem to " .
Param("maintainer") ."\n";
} else {
PutHeader("Invalid Username");
print "The name '". $::cgi->tt($name) ."' is not a valid username.\n" .
"Please hit the <B>Back</B> button and try again.\n";
}
exit(0);
}
sub GetLongDescription {
my ($id) = (@_);
SendSQL("select long_desc from bugs where bug_id = $id");
return FetchOneColumn();
}
sub ShowCcList {
my ($num) = (@_);
my @ccids;
my @row;
SendSQL("select who from cc where bug_id = $num");
while (@row = FetchSQLData()) {
push(@ccids, $row[0]);
}
my @result = ();
foreach my $i (@ccids) {
push @result, DBID_to_name($i);
}
return join(',', @result);
}
# Fills in a hashtable with info about the columns for the given table in the
# database. The hashtable has the following entries:
# -list- the list of column names
# <name>,type the type for the given name
sub LearnAboutColumns {
my ($table) = (@_);
my %a;
SendSQL("show columns from $table");
my @list = ();
my @row;
while (@row = FetchSQLData()) {
my ($name,$type) = (@row);
$a{"$name,type"} = $type;
push @list, $name;
}
$a{"-list-"} = \@list;
return \%a;
}
# If the above returned a enum type, take that type and parse it into the
# list of values. Assumes that enums don't ever contain an apostrophe!
sub SplitEnumType {
my ($str) = (@_);
my @result = ();
if ($str =~ /^enum\((.*)\)$/) {
my $guts = $1 . ",";
while ($guts =~ /^\'([^\']*)\',(.*)$/) {
push @result, $1;
$guts = $2;
}
}
return @result;
}
sub SqlQuote {
my ($temp) = (@_);
return $::db->quote($temp);
}
sub Param {
my ($value) = (@_);
if (defined $::param{$value}) {
return $::param{$value};
}
# Um, maybe we haven't sourced in the params at all yet.
if (stat("data/params")) {
# Write down and restore the version # here. That way, we get around
# anyone who maliciously tries to tweak the version number by editing
# the params file. Not to mention that in 2.0, there was a bug that
# wrote the version number out to the params file...
my $v = $::param{'version'};
require "data/params";
$::param{'version'} = $v;
}
if (defined $::param{$value}) {
return $::param{$value};
}
# Well, that didn't help. Maybe it's a new param, and the user
# hasn't defined anything for it. Try and load a default value
# for it.
require "defparams.pl";
WriteParams();
if (defined $::param{$value}) {
return $::param{$value};
}
# We're pimped.
die "Can't find param named $value";
}
sub PerformSubsts {
my ($str, $substs) = (@_);
$str =~ s/%([a-z]*)%/(defined $substs->{$1} ? $substs->{$1} : Param($1))/eg;
return $str;
}
sub Mail {
my ($to, $cc, $subject, $msg) = (@_);
my $smtp;
my $fromaddr = "From: " . Param("fromaddress") . "\n";
$smtp = Net::SMTP->new($mailhost);
$smtp->mail(Param("fromaddress"));
if($to ne "") {
for my $i (split(",", $to)) {
$smtp->to($i);
}
}
if($cc ne "") {
for my $j (split(",", $cc)) {
$smtp->to("$j");
}
}
$smtp->data();
$smtp->datasend("$fromaddr");
$smtp->datasend("To: $to\n");
$smtp->datasend("Subject: $subject\n");
$smtp->datasend("X-Mailer: Perl SMTP Module\n");
$smtp->datasend("X-Loop: " . Param("fromaddress") . "\n");
$smtp->datasend("\n");
$smtp->datasend($msg);
$smtp->dataend();
$smtp->quit;
}
# Trim whitespace from front and back.
sub trim {
($_) = (@_);
s/^\s*//g;
s/\s*$//g;
return $_;
}
1;

View File

@@ -0,0 +1,60 @@
<!--
The contents of this file are subject to the Mozilla 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/MPL/
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 Bugzilla Bug Tracking System.
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): Terry Weissman <terry@mozilla.org>
-->
<? include "header.html" ?>
<H1>A Clue</H1>
This form will allow you to call up a subset of the bug list.
You should be able to add the URL of the resulting list to
your bookmark file in order to preserve queries.
<P>
The way the query works, if you have nothing checked in a box,
then all values for that field are legal, for example if you checked nothing
in any of the boxes, you would get the entire bug list.
<P>
The default value of this form should correspond roughly to a "personal"
bug list.
<HR>
<H2>Running queries not supported by the pretty boxes</H2>
There is a hacky way to do some searches that aren't supported by the
form. The buglist script will build queries based on the URL, so
you can add other criteria.
<P>
For example, if you wanted to see all bugs reported against the X platform
and assigned to jwz, you could ask for all bugs assign to jwz, then
edit the URL in the "Location" box, adding the clause "&rep_platform=X-Windows"
to the URL.
<P>
Here is a list of some of the field names you could use for additional
unsupported searches ...
<PRE>
version
rep_platform
op_sys
bug_file_loc
short_desc
</PRE>
<? include "footer.html" ?>

View File

@@ -0,0 +1,80 @@
<HTML>
<!--
The contents of this file are subject to the Mozilla 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/MPL/
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 Bugzilla Bug Tracking System.
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): Terry Weissman <terry@mozilla.org>
-->
<TITLE>How to Mail to bugzilla</TITLE>
<H1>THIS DOESN'T WORK RIGHT NOW. Coming someday.</H1>
Mailing to "bugzilla" will be piped through a script which examines
your message, stripping out control lines, and passing the rest of the
message in as the description of a new bug. The control lines look like: <P>
<PRE>
@FIELD-LABEL VALUE
LABEL Legal Values
Priority critical major normal minor trivial
Type BUG RFE
Product Cheddar
Platform PC X-Windows Macintosh All
Area CODE JAVA TEST BUILD UI PERF
Version version 2.0b1 2.0b2 2.0b2 2.0b4 2.1a0 2.1a1 2.1b0 2.1b1 2.1b2
OS Windows 3.1 Windows 95 Windows NT System 7 System 7.5
AIX BSDI HP-UX IRIX Linux OSF/1 Solaris SunOS other
Summary -anything-
URL -anything-
Assign someone in eng
and
@description
This tells the bug parse to stop looking for control lines,
allowing the bug description to contain lines which start with @
</PRE>
There are default values for all these fields. If you don't specify a
Summary, the subject of the mail message is used. <P>
If you specify an illegal value, the default value is used, the
bug is assigned to you, and the answerback message will describe
the error. <P>
After the bug is posted, you will get mail verifying the posting
and informing you of the bug number if you wish to fix any
mistakes made by the auto-processor. <P>
EXAMPLE: <P>
<PRE>
% Mail bugzilla
Subject: WinFE crashes with GPF when I pour beer on my keyboard
@priority critical
@platform PC
@assign troy
After the beer bash I emptied the rest of the keg onto my keyboard
and my sharp build of Navigator got a GPF.
.
</PRE>

View File

@@ -0,0 +1,69 @@
<!--
The contents of this file are subject to the Mozilla 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/MPL/
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 Bugzilla Bug Tracking System.
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): Terry Weissman <terry@mozilla.org>
Andrew Anderson <andrew@redhat.com>
-->
<?include "header.html" ?>
<TABLE BORDER=0 CELLPADDING=12 CELLSPACING=0 WIDTH="100%">
<TR>
<TD>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=2>
<TR><TD VALIGN=TOP ALIGN=CENTER NOWRAP>
<FONT SIZE="+3"><B><NOBR>Main Page</NOBR></B></FONT>
</TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER>
<B></B>
</TD></TR>
</TABLE>
</TD>
<TD>
This is <B>Bugzilla</B>: the Red Hat bug system. For more
information about what Bugzilla is and what it can do, see
<A HREF="http://www.mozilla.org/">mozilla.org</A>'s
<A HREF="http://www.mozilla.org/bugs/"><B>bug pages</B></A>.
</TD></TR></TABLE>
<body>
<p>
Go to the <A HREF="query.cgi">query page</A>.<BR>
Enter a <A HREF="enter_bug.cgi">new bug</A>.<BR>
Submit a <A HREF="redhat-faq.phtml#howdoipatch">patch</A>.<BR>
Having problems using bugzilla? Look at the
<A HREF="redhat-faq.phtml">FAQ</A>,
or email <A HREF="mailto:bugzilla-owner@redhat.com">bugzilla-owner@redhat.com</A><BR>
<FORM METHOD="GET" ACTION="show_bug.cgi">
<INPUT TYPE="SUBMIT" VALUE="Show"> bug # <INPUT NAME=id SIZE=6>
</FORM>
</TD>
</TABLE>
<?include "footer.html" ?>

View File

@@ -0,0 +1,131 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: long_list.cgi,v 1.4.2.3 1999-01-27 17:25:27 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Andrew Anderson <andrew@redhat.com>
use diagnostics;
use strict;
use CGI;
$::cgi = new CGI;
require "CGI.pl";
require "security.pl";
print $::cgi->header('-type' => 'text/html');
my $generic_query = "
select
bugs.bug_id,
bugs.product,
bugs.version,
bugs.rep_platform,
bugs.op_sys,
bugs.bug_status,
bugs.bug_severity,
bugs.priority,
bugs.resolution,
assign.login_name,
report.login_name,
bugs.component,
bugs.bug_file_loc,
bugs.short_desc,
bugs.class,
bugs.view
from bugs,profiles assign,profiles report
where assign.userid = bugs.assigned_to
and report.userid = bugs.reporter and
";
&ConnectToDatabase;
my $view_html;
my $class_html;
my $view_query = "SELECT type_id, name FROM type WHERE name = 'public'";
SendSQL($view_query);
(my $type_id, my $type_name) = FetchSQLData();
$view_query = "and bugs.view = " . $type_id . " ";
if(CanIView("view")){
$view_query = "";
$view_html = $::cgi->td($::cgi->b("View:"), $type_name);
} else {
$view_html = $::cgi->td("&nbsp;");
}
my $buglist = $::cgi->param('buglist');
my @bugs = split(/:/, $buglist);
foreach my $bug (@bugs) {
my $query = $generic_query . " bugs.bug_id = " . $bug . " " . $view_query;
SendSQL($query);
my @row;
if (@row = FetchSQLData()) {
my ($id, $product, $version, $platform, $opsys, $status, $severity,
$priority, $resolution, $assigned, $reporter, $component, $url,
$shortdesc, $class) = (@row);
PutHeader("Full Text Bug Listing",
html_quote($shortdesc),
$::cgi->param('id'));
if(CanIView("class")){
$class_html = $::cgi->td("<B>Class:</B> $class");
} else {
$class_html = $::cgi->td("&nbsp;");
}
print $::cgi->img({'-src' => "1x1.gif",
'-width' => "1",
'-height' => "80",
'-align' => "LEFT"});
my $href = "show_bug.cgi?id=" . $id;
my $firstrow = $::cgi->TR(
$::cgi->td($::cgi->b("Bug#:"),
$::cgi->a({-href=>$href}, $id)),
$::cgi->td($::cgi->b("Product:"), $product),
$::cgi->td($::cgi->b("Version:"), $version),
$::cgi->td($::cgi->b("Platform:"), $platform));
my $secondrow = $::cgi->TR(
$::cgi->td($::cgi->b("Resolution:"), $resolution),
$::cgi->td($::cgi->b("Assigned To:"), $assigned),
$::cgi->td({'-colspan' => "2"},
$::cgi->b("Reported By:"), $reporter));
my $thirdrow = $::cgi->TR(
$::cgi->td($::cgi->b("Component:")),
$::cgi->td($component),
$view_html,
$class_html);
my $fourthrow = $::cgi->TR($::cgi->td({'-colspan' => "6"},
$::cgi->b("URL:"), $url));
my $fifthrow = $::cgi->TR(
$::cgi->td($::cgi->b("Summary:")),
$::cgi->td({'-colspan' => "5"}, $shortdesc));
my $sixthrow = $::cgi->TR($::cgi->td({'-colspan' => "5"},
$::cgi->b("Description:")));
print $::cgi->table({'-width' => "100%"},
$firstrow, $secondrow, $thirdrow,
$fourthrow, $fifthrow, $sixthrow,
);
my $long_desc = GetLongDescription($bug);
print $::cgi->pre($long_desc);
print $::cgi->hr;
}
}

View File

@@ -0,0 +1,49 @@
#!/bin/sh
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: makeactivitytable.sh,v 1.1.4.1 1999-01-27 17:25:28 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table bugs_activity
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table bugs_activity (
bug_id mediumint not null,
who mediumint not null,
when datetime not null,
field varchar(64) not null,
oldvalue tinytext,
newvalue tinytext,
index (bug_id),
index (when)
);
show columns from bugs_activity;
show index from bugs_activity;
OK_ALL_DONE

View File

@@ -0,0 +1,74 @@
#!/bin/sh
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: makebugtable.sh,v 1.1.4.3 1999-01-27 17:25:28 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Andrew Anderson <andrew@redhat.com>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table bugs;
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table bugs (
bug_id mediumint not null auto_increment primary key,
group_id mediumint not null,
assigned_to mediumint not null,
bug_file_loc text,
patch_file_loc text,
bug_severity enum("security", "high", "normal", "low") not null,
bug_status enum("NEW", "VERIFIED", "ASSIGNED", "REOPENED", "RESOLVED") not null,
view tinyint,
creation_ts datetime,
delta_ts timestamp,
short_desc mediumtext,
long_desc mediumtext,
op_sys tinytext,
priority enum("high", "normal", "low") not null,
product varchar(255) not null,
rep_platform enum("All", "alpha", "m68k", "i386", "mips", "sparc", "sparc64", "ppc", "arm", "Other"),
reporter mediumint not null,
version varchar(16) not null,
release varchar(16) not null,
component varchar(50) not null,
resolution enum("", "FIXED", "DISCARD", "WONTFIX", "LATER", "REMIND", "DUPLICATE", "WORKSFORME") not null,
class enum("install/upgrade", "packaging", "functionality", "security", "documentation") not null,
index (assigned_to),
index (delta_ts),
index (bug_severity),
index (bug_status),
index (priority),
index (product),
index (reporter),
index (version),
index (component),
index (resolution)
);
show columns from bugs;
show index from bugs;
OK_ALL_DONE

View File

@@ -0,0 +1,42 @@
#!/bin/sh
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: makecctable.sh,v 1.1.4.1 1999-01-27 17:25:28 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table cc
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table cc (
bug_id mediumint not null,
who mediumint not null
);
show columns from cc;
show index from cc;
OK_ALL_DONE

View File

@@ -0,0 +1,553 @@
#!/bin/sh
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: makecomponenttable.sh,v 1.17.2.2 1999-01-27 17:25:29 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table components
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table components (
value tinytext not null,
program tinytext not null,
initialowner tinytext not null
);
insert into components (value, program, initialowner) values ('AfterStep', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('AnotherLevel', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ElectricFence', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ImageMagick', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('MAKEDEV', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('SVGATextMode', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('SysVinit', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('WindowMaker', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('X11R6', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('XFree86', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('Xaw3d', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('Xconfigurator', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('aboot', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('acm', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('adjtimex', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('am', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('anonftp', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('aout', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('apache', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('apmd', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ash', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('at', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('aumix', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('autoconf', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('autofs', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('automake', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('awesfx', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('basesystem', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('bash', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('bc', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('bdflush', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('biff', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('bin86', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('bind', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('binutils', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('bison', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('blt', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('bootp', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('bootparamd', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('bootpc', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('bsd', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('byacc', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('bzip2', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('caching', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('cdecl', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('cdp', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('chkconfig', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('christminster', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('cleanfeed', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('clock', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('colour', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('comanche', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('control', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('cpio', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('cproto', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('cracklib', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('crontabs', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ctags', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('cvs', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('cxhextris', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('dev', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('dhcp', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('dhcpcd', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('dialog', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('diffstat', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('dip', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('dosemu', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('dump', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('e2fsprogs', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ed', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ee', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('efax', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('egcs', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('eject', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('elftoaout', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('elm', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('emacs', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('etcskel', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('exmh', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ext2ed', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('faces', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('faq', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('fetchmail', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('file', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('filesystem', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('fileutils', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('findutils', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('finger', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('flex', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('flying', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('fort77', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('fortune', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ftp', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('fvwm', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('fvwm2', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('fwhois', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gated', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gawk', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gcc', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gd', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gdb', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gdbm', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gettext', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('getty_ps', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ghostscript', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('giflib', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gimp', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('git', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('glibc', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('glint', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gmp', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gnome', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gnuchess', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gnuplot', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gperf', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gpm', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('grep', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('groff', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gsl', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gtk+', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('guavac', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('guile', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gv', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gzip', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('hdparm', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('helptool', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('howto', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ical', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('imap', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('imlib', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('indent', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('indexhtml', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('initscripts', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('inn', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('install', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('intimed', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ircii', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('isapnptools', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ispell', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('jed', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('joe', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('kaffe', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('kbd', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('kbdconfig', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('kernel', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('kernelcfg', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ld.so', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ldconfig', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('less', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('lha', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('libc', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('libelf', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('libg++', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('libgr', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('libjpeg', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('libpng', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('libtermcap', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('libtool', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('linuxconf', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('logrotate', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('lout', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('lpg', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('lpr', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('lrzsz', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('lslk', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('lsof', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ltrace', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('lynx', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('m4', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('macutils', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mailcap', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mailx', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('make', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('man', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('man-pages', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('maplay', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mars', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mawk', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mc', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('metamail', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mgetty', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mikmod', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mingetty', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('minicom', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('minlabel', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mkbootdisk', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mkdosfs', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mkinitrd', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mkisofs', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mkkickstart', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mktemp', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mkxauth', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mod_perl', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mod_php', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mod_php3', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('modemtool', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('modutils', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('moonclock', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mount', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mouseconfig', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mpage', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mt', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mtools', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('multimedia', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mutt', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mxp', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mysterious', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('nc', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ncftp', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ncompress', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ncpfs', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ncurses', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ncurses3', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('nenscript', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('net', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('netcfg', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('netkit', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('netscape', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('newt', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('nfs', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('nls', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('nmh', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ntalk', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('open', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('p2c', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('paradise', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('patch', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('pdksh', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('perl', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('pidentd', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('pine', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('pinfocom', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('playmidi', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('pmake', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('popt', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('portmap', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('postgresql', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ppp', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('printtool', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('procinfo', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('procmail', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('procps', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('psacct', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('psmisc', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('pwdb', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('python', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('pythonlib', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('quickstrip', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('quota', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('raidtools', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('rcs', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('rdate', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('rdist', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('readline', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('redhat', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('rhbackup', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('rhl', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('rhmask', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('rhs', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('rhsound', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('rootfiles', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('routed', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('rpm', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('rsh', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('rsync', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('rusers', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('rwall', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('rxvt', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('sag', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('samba', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('sash', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('scottfree', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('screen', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('sed', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('sendmail', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('setconsole', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('setserial', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('setuptool', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('seyon', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('sgml', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('sh', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('shadow', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('shapecfg', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('sharutils', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('silo', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('slang', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('sliplogin', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('slrn', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('sndconfig', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('sox', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('spice', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('spider', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('squid', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('stat', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('statserial', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('strace', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('svgalib', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('swatch', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('symlinks', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('sysklogd', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('taper', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('tar', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('tcltk', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('tcp_wrappers', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('tcpdump', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('tcsh', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('telnet', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('termcap', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('termfiles_sparc', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('tetex', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('texinfo', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('tftp', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('time', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('timeconfig', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('timed', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('timetool', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('tin', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('tmpwatch', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('traceroute', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('tracker', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('transfig', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('tree', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('trn', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('trojka', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('tunelp', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ucd', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('umb', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('unarj', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('units', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('unzip', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('urw', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('usermode', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('usernet', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('util', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('uucp', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('vga_cardgames', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('vga_gamespack', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('vim', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('vlock', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('wget', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('wmakerconf', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('wmconfig', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('words', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('wu', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('x3270', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xanim', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xbanner', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xbill', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xbl', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xboard', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xboing', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xchomp', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xcpustate', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xdaliclock', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xdemineur', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xearth', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xevil', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xfig', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xfishtank', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xfm', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xgalaga', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xgammon', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xgopher', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xinitrc', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xjewel', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xlander', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xlispstat', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xloadimage', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xlockmore', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xmailbox', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xmorph', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xntp3', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xosview', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xpaint', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xpat2', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xpdf', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xpilot', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xpm', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xpuzzles', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xrn', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xscreensaver', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xsnow', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xsysinfo', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xterm', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xtoolwait', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xtrojka', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xv', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xwpe', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xwpick', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xxgdb', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xzip', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('yp', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ypbind', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ypserv', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ytalk', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('zgv', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('zip', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('zlib', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('zsh', 'Red Hat Linux', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('bugzilla', 'bugzilla', 'andrew@redhat.com');
insert into components (value, program, initialowner) values ('rhcn', 'Red Hat Contrib|Net', 'adevries@redhat.com');
insert into components (value, program, initialowner) values ('analog', 'Red Hat Secure Web Server', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('secureweb', 'Red Hat Secure Web Server', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gd', 'Red Hat Secure Web Server', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gdbm', 'Red Hat Secure Web Server', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('glibc', 'Red Hat Secure Web Server', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('htdig', 'Red Hat Secure Web Server', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('info', 'Red Hat Secure Web Server', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mod_perl', 'Red Hat Secure Web Server', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mod_php', 'Red Hat Secure Web Server', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mod_php3', 'Red Hat Secure Web Server', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('netscape', 'Red Hat Secure Web Server', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('squid', 'Red Hat Secure Web Server', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('texinfo', 'Red Hat Secure Web Server', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('rpm', 'Red Hat Secure Web Server', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('perl', 'Red Hat Secure Web Server', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('perl-Apache-ASP', 'Red Hat Secure Web Server', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('perl-Data-Dumper', 'Red Hat Secure Web Server', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('perl-MD5', 'Red Hat Secure Web Server', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('perl-MLDBM', 'Red Hat Secure Web Server', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xspringies', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xsession', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xquote', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xmountains', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xmmix', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xmcd', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xmbase-grok', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xinvest', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xfpovray', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xforms', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xfinans', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xephem', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xemacs', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xcoral', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xcdroast', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xbmbrowser', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('xattax', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('wmtime', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('wmnet', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('wmmon', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('wine', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('wget', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('webxref', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('weblint', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('vt', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ver', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('twin', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('trafshow', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('tkrat', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('tkirc', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('tkgoodstuff', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('tgif', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('swish', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('sudo', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('siag', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('scotty', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('sceda', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('sane', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('safedelete', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('sabre', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('rsync', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('pvm', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('povray', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('plan', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('pilot-link', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('pcb', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('netwonlink', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('netwatch', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('nedit', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mrtg', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mpr', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mirror', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mikmod', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('mgp', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('lyx', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('lincity', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('libpcap', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('lclint', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('karpski', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('icewm', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('hexcalc', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('gd', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('dotfile', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('dlh', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('dfm', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('ddd', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('clobberd', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('cbb', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('beav', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('amanda', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('acidwarp', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('Xbae', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('WindowMaker', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('WMRack', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('TkZip', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('SoundStudio', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('OffiX-devel', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('OffiX-Trash', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('OffiX-Printer', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('OffiX-Files', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('OffiX-Execute', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('OffiX-Editor', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('OffiX-Clipboard', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('Mesa', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('FileRunner', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('BitchX', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('lesstif', 'Red Hat Powertools', 'dkl@redhat.com');
insert into components (value, program, initialowner) values ('9wm', 'Red Hat Powertools', 'dkl@redhat.com');
show columns from components;
show index from components;
OK_ALL_DONE

View File

@@ -0,0 +1,50 @@
#!/bin/sh
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: makegrouptable.sh,v 1.1.2.2 1999-01-27 17:25:30 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table groups
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table groups (
groupid mediumint not null primary key,
groupname varchar(255) not null,
flags mediumint not null,
goodfor bigint not null
);
insert into groups values (1, 'default', 0, 1800);
insert into groups values (2, 'support', 263, 86400);
insert into groups values (3, 'devel', 65535, 31536000);
insert into groups values (4, 'qa', 262143, 31536000);
insert into groups values (5, 'unlimited', 262143, 1800);
insert into groups values (6, 'comsup', 0, 86400);
insert into groups values (7, 'labs', 65535, 31536000);
show columns from groups;
show index from groups;
OK_ALL_DONE

View File

@@ -0,0 +1,42 @@
#!/bin/sh
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: makelogincookiestable.sh,v 1.1.2.1 1999-01-27 17:25:30 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql bugs > /dev/null 2>/dev/null << OK_ALL_DONE
drop table logincookies;
OK_ALL_DONE
mysql bugs << OK_ALL_DONE
create table logincookies (
cookie mediumint not null auto_increment primary key,
userid mediumint not null,
cryptpassword varchar(64),
hostname varchar(128),
lastused timestamp,
index(lastused)
);
show columns from logincookies;
show index from logincookies;
OK_ALL_DONE

View File

@@ -0,0 +1,42 @@
#!/bin/sh
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: makeproducttable.sh,v 1.5.2.2 1999-01-27 17:25:30 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table products;
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table products (
product tinytext not null,
description mediumtext not null
);
insert into products (product, description) values ("Red Hat Linux", "For bugs about Red Hat Linux");
insert into products (product, description) values ("Red Hat Powertools", "For bugs about Red Hat Powertools");
insert into products (product, description) values ("Red Hat Secure Web Server", "For bugs about Red Hat Secure Web Server");
insert into products (product, description) values ("Red Hat Contrib|Net", "For bugs about Red Hat Contrib|Net");
insert into products (product, description) values ("bugzilla", "For bugs about bugzilla");

View File

@@ -0,0 +1,46 @@
#!/bin/sh
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: makeprofilestable.sh,v 1.2.2.2 1999-01-27 17:25:31 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table profiles
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table profiles (
userid mediumint not null auto_increment primary key,
login_name varchar(255) not null,
password varchar(16),
cryptpassword varchar(64),
realname varchar(255),
groupid mediumint,
index(login_name)
);
show columns from profiles;
show index from profiles;
OK_ALL_DONE

View File

@@ -0,0 +1,59 @@
#!/bin/sh
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: makesecuritytable.sh,v 1.1.2.3 1999-01-27 17:25:31 andrew%redhat.com Exp $
#
# Contributor(s): Andrew Anderson <andrew@redhat.com>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table security
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table security (
field varchar(255) not null primary key,
flag mediumint not null
);
insert into security values ('priority', 1);
insert into security values ('bug_severity', 2);
insert into security values ('comments', 4);
insert into security values ('cc', 8);
insert into security values ('assigned_to', 16);
insert into security values ('bug_status', 32);
insert into security values ('version', 64);
insert into security values ('component', 128);
insert into security values ('rep_platform', 256);
insert into security values ('release', 512);
insert into security values ('bug_file_loc', 1024);
insert into security values ('short_desc', 2048);
insert into security values ('long_desc', 4096);
insert into security values ('resolution', 8192);
insert into security values ('internal', 16384);
insert into security values ('accept', 32768);
insert into security values ('class', 65536);
insert into security values ('source', 131072);
show columns from security;
show index from security;
OK_ALL_DONE

View File

@@ -0,0 +1,53 @@
#!/bin/sh
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: makeversiontable.sh,v 1.8.2.2 1999-01-27 17:25:32 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table versions
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table versions (
value tinytext not null,
program tinytext not null
);
insert into versions (value, program) values ("5.2", "Red Hat Linux");
insert into versions (value, program) values ("5.1", "Red Hat Linux");
insert into versions (value, program) values ("5.0", "Red Hat Linux");
insert into versions (value, program) values ("4.2", "Red Hat Linux");
insert into versions (value, program) values ("5.1", "Red Hat Powertools");
insert into versions (value, program) values ("2.0", "Red Hat Secure Web Server");
insert into versions (value, program) values ("1.0", "Red Hat Contrib|Net");
insert into versions (value, program) values ("2.1r", "bugzilla");
select * from versions;
show columns from versions;
show index from versions;
OK_ALL_DONE

View File

@@ -0,0 +1,41 @@
#!/usr/bonsaitools/bin/perl
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: new_comment.cgi,v 1.2.2.2 1999-01-27 17:25:32 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Andrew Anderson <andrew@redhat.com>
use strict;
use diagnostics;
use CGI;
my $cgi = new CGI;
my $c=$cgi->param("comment");
open(COMMENTS, ">>data/comments");
print COMMENTS "$c\n";
close(COMMENTS);
print $cgi->header(-type=>'text/html'),
$cgi->start_html(-title=>"The Word Of Confirmation"),
$cgi->h1("Done"),
$c,
$cgi->end_html;

View File

@@ -0,0 +1,34 @@
<HTML>
<!--
The contents of this file are subject to the Mozilla 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/MPL/
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 Bugzilla Bug Tracking System.
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): Terry Weissman <terry@mozilla.org>
-->
<TITLE>I'm So Pretty and Witty And Wise</TITLE>
<H2>Add your own clever headline.</h2>
The buglist picks a random quip for the headline, and
you can extend the quip list. Type in something clever or
funny or boring and bonk on the button.
<HR>
<FORM METHOD=POST ACTION="new_comment.cgi">
<INPUT SIZE=80 NAME="comment"><BR>
<INPUT TYPE="submit" VALUE="Add This Quip"></FORM>
</HR>
For the impatient, you can
<A HREF="data/comments">view the whole quip list</A>.

View File

@@ -0,0 +1,166 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: post_bug.cgi,v 1.2.2.3 1999-01-27 17:25:33 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Andrew Anderson <andrew@redhat.com>
use diagnostics;
use strict;
use CGI;
$::cgi = new CGI;
require "CGI.pl";
confirm_login();
my $platform = $::cgi->param('product');
my $version = $::cgi->param('version');
my $platform_cookie = $::cgi->cookie(-name=>"PLATFORM",
-value=>"$platform",
#-path=>'/bugzilla/',
-expires=>"Sun, 30-Jun-2029 00:00:00 GMT");
my $version_cookie = $::cgi->cookie(-name=>"VERSION-$platform",
-value=>"$version",
#-path=>'/bugzilla/',
-expires=>"Sun, 30-Jun-2029 00:00:00 GMT");
if ($::cgi->param('maketemplate') ne "") {
PutHeader("Bookmarks are your friend.", "Template constructed.");
my $url = "enter_bug.cgi?$::cgi->query_string";
print "If you put a bookmark <A HREF=\"$url\">to this link</A>, it will\n";
print "bring up the submit-a-new-bug page with the fields initialized\n";
print "as you've requested.\n";
exit;
}
PutHeader("Posting Bug -- Please wait", "Posting Bug", "One moment please...");
umask 0;
ConnectToDatabase();
if ($::cgi->param('component') eq "") {
print "You must choose a component that corresponds to this bug. If\n";
print "necessary, just guess. But please hit the <B>Back</B> button\n";
print "and choose a component.\n";
print $::cgi->end_html;
exit 0
}
my $forceAssignedOK = 0;
if ($::cgi->param('assigned_to') eq "") {
SendSQL("select initialowner from components where program=" .
SqlQuote($::cgi->param('product')) .
" and value=" . SqlQuote($::cgi->param('component')));
my $data = FetchOneColumn();
$::cgi->param(-name=>'assigned_to', -value=>$data, -override=>"1");
$forceAssignedOK = 1;
}
my $assign = $::cgi->param('assigned_to');
$::cgi->param(-name=>'assigned_to',
-value=>DBNameToIdAndCheck($assign, $forceAssignedOK),
-override=>"1");
my $report = ($::cgi->param('Bugzilla_login') ne "") ? $::cgi->param('Bugzilla_login')
: $::cgi->cookie('Bugzilla_login');;
$::cgi->param(-name=>'reporter',
-value=>DBNameToIdAndCheck($report),
-override=>"1");
my @bug_fields = ("reporter", "product", "version", "rep_platform",
"bug_severity", "priority", "op_sys", "assigned_to",
"bug_status", "short_desc", "component", "bug_file_loc",
"view");
my $query = "insert into bugs (\n" . join(",\n", @bug_fields) . ",
group_id, creation_ts, long_desc )
values (
";
foreach my $field (@bug_fields) {
$query .= SqlQuote($::cgi->param($field)) . ",\n";
}
my $gid_query = "SELECT groupid FROM profiles " .
"WHERE userid = '" . $::cgi->param('reporter') . "'";
#print $::cgi->pre("$gid_query");
SendSQL($gid_query);
my $gid = FetchOneColumn();
#print $::cgi->pre("gid = $gid) . $cgi->br . "\n";
$query .= "$gid, ";
my $view_query;
my $view_id;
my $view_name;
#if ($::cgi->param('view') ne "") {
# $view_query = "SELECT type_id FROM type WHERE name = '" .
# $::cgi->param('view') . "'";
# SendSQL($view_query);
# ($view_id, $view_name) = FetchSQLData();
# $query .= "'$view_id' ,";
#} else {
# $view_query = "SELECT type_id FROM type WHERE name = 'public'";
# SendSQL($view_query);
# ($view_id, $view_name) = FetchSQLData();
# $query .= "'$view_id', ";
#}
$query .= "now(), " . SqlQuote($::cgi->param('comment')) . " )\n";
#print $::cgi->param("$query") . "\n";
my %ccids;
if ($::cgi->param('cc') ne "") {
foreach my $person (split(/[ ,]/, $::cgi->param('cc'))) {
if ($person ne "") {
$ccids{DBNameToIdAndCheck($person)} = 1;
}
}
}
#print $::cgi->param("$query") . "\n";
SendSQL($query);
SendSQL("select LAST_INSERT_ID()");
my $id = FetchOneColumn();
foreach my $person (keys %ccids) {
SendSQL("insert into cc (bug_id, who) values ($id, $person)");
}
print $::cgi->h2("Changes Submitted"),
$::cgi->a({-href=>"show_bug.cgi?id=$id"}, "Show BUG# $id"),
$::cgi->br,
$::cgi->a({-href=>"query.cgi"}, "Back To Query Page"),
$::cgi->br,
$::cgi->a({-href=>"enter_bug.cgi?product=" . $::cgi->param('product')},
"Enter a new bug");
system("./processmail $id < /dev/null > /dev/null 2> /dev/null &");
exit;

View File

@@ -0,0 +1,390 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: process_bug.cgi,v 1.6.2.3 1999-01-27 17:25:33 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
use diagnostics;
use strict;
use CGI;
$::cgi = new CGI;
require "CGI.pl";
require "security.pl";
# Shut up misguided -w warnings about "used only once":
use vars %::versions,
%::components;
confirm_login();
GetVersionTable();
if ($::cgi->param('product') ne $::dontchange) {
my $prod = $::cgi->param('product');
my $vok = lsearch($::versions{$prod}, $::cgi->param('version')) >= 0;
my $cok = lsearch($::components{$prod}, $::cgi->param('component')) >= 0;
if (!$vok || !$cok) {
print
$::cgi->h1("Changing product means changing version and component."),
"You have chosen a new product, and now the version and/or\n",
"component fields are not correct. (Or, possibly, the bug did\n",
"not have a valid component or version field in the first place.)\n",
"Anyway, please set the version and component now.<p>\n",
$::cgi->start_form,
$::cgi->table(
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"}, $::cgi->b('Product:')),
$::cgi->td($prod)
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"}, $::cgi->b('Version:')),
$::cgi->td(Version_element($::cgi->param('version'), $prod))
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"}, $::cgi->b('Component:')),
$::cgi->td(
Component_element($::cgi->param('component'), $prod))
)
);
foreach my $i ($::cgi->param) {
if ($i ne 'version' && $i ne 'component') {
print $::cgi->hidden(-name=>"$i",
-value=>$::cgi->param($i),
-override=>"1") . "\n";
}
}
print
$::cgi->submit(-name=>"submit", -value=>"Commit"),
$::cgi->end_form,
$::cgi->hr,
$::cgi->a({-href=>"query.cgi"},
"Cancel all this and go back to the query page.");
exit;
}
}
my @idlist;
if ($::cgi->param('id')) {
push @idlist, $::cgi->param('id');
} else {
foreach my $i ($::cgi->param) {
if ($i =~ /^id_/) {
push @idlist, substr($i, 3);
}
}
}
my $who = $::cgi->cookie('Bugzilla_login');
$::bug_id = $::cgi->param('id');
$::query = "update bugs\nset";
$::comma = "";
umask(0);
sub DoComma {
$::query .= "$::comma\n ";
$::comma = ",";
}
sub ChangeStatus {
my ($str) = (@_);
if ($str ne $::dontchange &&
CanIEdit("bug_status", $who, $::cgi->param('id'))) {
DoComma();
$::query .= "bug_status = '$str'";
}
}
sub ChangeResolution {
my ($str) = (@_);
if ($str ne $::dontchange &&
CanIEdit("resolution", $who, $::cgi->param('id'))) {
DoComma();
$::query .= "resolution = '$str'";
}
}
ConnectToDatabase();
foreach my $field ("rep_platform", "priority", "bug_severity", "url",
"summary", "component", "bug_file_loc", "short_desc",
"product", "version", "component", "class", "view") {
if ($::cgi->param($field) && $::cgi->param($field) ne $::dontchange
&& CanIEdit($field, $who, $::cgi->param('id'))) {
DoComma();
$::query .= "$field = " . SqlQuote($::cgi->param($field));
}
}
my $knob = $::cgi->param('knob');
SWITCH: for ($knob) {
/^none$/ && do {
last SWITCH;
};
/^add_cc$/ && do {
my $whoid = DBNameToIdAndCheck($who);
my $cc_query = "SELECT bug_id FROM cc " .
"WHERE bug_id = '$::bug_id' and who = '$whoid'";
SendSQL($cc_query);
$cc_query = FetchOneColumn();
if ($cc_query) {
PutHeader("Nice try");
print "You are already on the CC list of bug $::bug_id";
} else {
PutHeader("Added to CC list");
SendSQL("INSERT INTO cc VALUES ($::bug_id, '$whoid')");
print "You have been added to the CC list of bug $::bug_id";
}
exit 0;
};
/^rem_cc$/ && do {
my $whoid = DBNameToIdAndCheck($who);
my $cc_query = "SELECT bug_id FROM cc " .
"WHERE bug_id = '$::bug_id' and who = '$whoid'";
SendSQL($cc_query);
$cc_query = FetchOneColumn();
if ($cc_query) {
$cc_query = "DELETE FROM cc " .
"WHERE bug_id = '$::bug_id' and who = '$whoid'";
SendSQL($cc_query);
PutHeader("Removed from CC list");
print "You have been removed from the CC list of bug $::bug_id";
} else {
PutHeader("Nice try");
print "You are not on the CC list of bug $::bug_id";
}
exit 0;
};
/^accept$/ && do {
ChangeStatus('ASSIGNED');
last SWITCH;
};
/^clearresolution$/ && do {
ChangeResolution('');
last SWITCH;
};
/^resolve$/ && do {
ChangeStatus('RESOLVED');
ChangeResolution($::cgi->param('resolution'));
last SWITCH;
};
/^reassign$/ && do {
ChangeStatus('ASSIGNED');
DoComma();
my $newid = DBNameToIdAndCheck($::cgi->param('assigned_to'));
$::query .= "assigned_to = $newid";
last SWITCH;
};
/^reassignbycomponent$/ && do {
if ($::cgi->param('component') eq $::dontchange) {
print "You must specify a component whose owner should get\n";
print "assigned these bugs.\n";
exit 0;
}
ChangeStatus('ASSIGNED');
SendSQL("select initialowner from components where program=" .
SqlQuote($::cgi->param('product')) . " and value=" .
SqlQuote($::cgi->param('component')));
my $newname = FetchOneColumn();
my $newid = DBNameToIdAndCheck($newname, 1);
DoComma();
$::query .= "assigned_to = $newid";
last SWITCH;
};
/^reopen$/ && do {
ChangeStatus('REOPENED');
ChangeResolution('');
last SWITCH;
};
/^verify$/ && do {
ChangeStatus('VERIFIED');
last SWITCH;
};
/^close$/ && do {
ChangeStatus('CLOSED');
last SWITCH;
};
/^duplicate$/ && do {
ChangeStatus('RESOLVED');
ChangeResolution('DUPLICATE');
my $num = trim($::cgi->param('dup_id'));
if ($num !~ /^[0-9]*$/) {
print "You must specify a bug number of which this bug is a\n";
print "duplicate. The bug has not been changed.\n";
exit;
}
if ($num == $::bug_id) {
PutHeader("Nice try.");
print "But it doesn't really make sense to mark a\n";
print "bug as a duplicate of itself, does it?\n";
exit;
}
AppendComment($num, $who,
"\n\n*** Bug $::bug_id has been marked as a duplicate of this bug. ***\n\n" .
GetLongDescription($::bug_id));
$::cgi->param(-name=>'comment',
-value=>$::cgi->param('comment') .
"\n\n*** This bug has been marked as a duplicate of $num ***",
-override=>"1");
AppendCC($::bug_id, $num);
system("./processmail $num < /dev/null > /dev/null 2> /dev/null &");
last SWITCH;
};
/^newsource$/ && do {
my $source_query;
if (($::cgi->param('source')) &&
($::cgi->param('source') ne $::dontchange) &&
(CanIEdit('source', $who, $::cgi->param('id')))) {
$source_query = "insert into sources (bug_id, source) ".
" values ('" . $::cgi->param('id') . "', '" .
($::cgi->param('source')) ."')";
SendSQL($source_query);
}
last SWITCH;
};
# default
print "Unknown action '" . $::cgi->param('knob') . "'!\n";
exit;
}
if ($#idlist < 0) {
PutHeader("Nothing to modify");
print "You apparently didn't choose any bugs to modify.\n",
$::cgi->p,
"Click ", $::cgi->b("Back"), " and try again\n";
exit;
}
if ($::comma eq "" &&
($::cgi->param('comment') eq "" ||
$::cgi->param('comment') =~ /^\s*$/)) {
PutHeader("Nothing was changed");
print "You apparently did not change anything on the selected bugs.\n",
$::cgi->p, "Click ", $::cgi->b("Back"), " and try again.\n";
exit;
}
my $basequery = $::query;
sub SnapShotBug {
my ($id) = (@_);
SendSQL("select " . join(',', @::log_columns) .
" from bugs where bug_id = '" . $id . "'");
return FetchSQLData();
}
foreach my $id (@idlist) {
SendSQL("lock tables bugs write, bugs_activity write, cc write, profiles write, groups write");
my @oldvalues = SnapShotBug($id);
my $query = "$basequery\nwhere bug_id = '" . $id . "'";
#print $::cgi->pre($query) . "\n";
if ($::comma ne "") {
SendSQL($query);
}
if ($::cgi->param('comment') ne "") {
my $pass_comment = $::cgi->param('comment');
AppendComment($id, $who, $pass_comment);
}
if ($::cgi->param('cc') && ShowCcList($id) ne $::cgi->param('cc')) {
my %ccids;
foreach my $person (split(/[ ,]/, $::cgi->param('cc'))) {
if ($person ne "") {
my $cid = DBNameToIdAndCheck($person, 1);
$ccids{$cid} = 1;
}
}
SendSQL("delete from cc where bug_id = '" . $id . "'");
foreach my $ccid (keys %ccids) {
SendSQL("insert into cc (bug_id, who) values ($id, $ccid)");
}
}
my @newvalues = SnapShotBug($id);
my $whoid;
my $timestamp;
foreach my $col (@::log_columns) {
my $old = shift @oldvalues;
my $new = shift @newvalues;
if ($old ne $new) {
if (!defined $whoid) {
$whoid = DBNameToIdAndCheck($who);
$query = "select delta_ts from bugs where bug_id = '" .
$id . "'";
SendSQL($query);
$timestamp = FetchOneColumn();
}
if ($col eq 'assigned_to') {
$old = DBID_to_name($old);
$new = DBID_to_name($new);
}
$col = SqlQuote($col);
$old = SqlQuote($old);
$new = SqlQuote($new);
my $q = "insert into bugs_activity (bug_id,who,when,field,oldvalue,newvalue) values ($id,$whoid,$timestamp,$col,$old,$new)";
# print "$::cgi->pre($q)";
SendSQL($q);
}
}
# avoid those damn 'used only once' warnings
$::header = $::h1 = $::h2 = "";
my $bug_id = $::cgi->param('id');
$::header = "Changes submitted for bug $bug_id";
$::h1 = "Changes Submitted";
$::h2 = $bug_id;
#PutHeader("Changes submitted for bug " . $::cgi->param('id'),
# "Changes Submitted", $::cgi->param('id'));
#if ($::cgi->param('id')) {
# navigation_header();
#}
#print "$::cgi->hr\n$cgi->p\n",
# $::cgi->a({-href=>"show_bug.cgi?id=$id"}, "Back To BUG# $id"),
# $::cgi->br,
# $::cgi->a({-href=>"enter_bug.cgi"}, "Enter a new bug") . "\n";
SendSQL("unlock tables");
system("./processmail $id < /dev/null > /dev/null 2> /dev/null &");
}
#if (defined $::next_bug) {
# $::cgi->hidden(-name=>'id', -value=>$::next_bug, -override=>"1");
# print "$::cgi->hr\n";
#
# navigation_header();
do "bug_form.pl";
#} else {
# print "<BR><A HREF=\"query.cgi\">Back To Query Page</A>\n";
# print $::cgi->br .
# $::cgi->a({-href->"query.cgi"}, "Back to query page) . "\n";
#}

View File

@@ -0,0 +1,295 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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): Terry Weissman <terry@mozilla.org>
# David Gardiner <david.gardiner@unisa.edu.au>
# Andrew Anderson <andrew@redhat.com>
# To recreate the shadow database, run "processmail regenerate" .
use diagnostics;
use strict;
use FileHandle;
use IPC::Open2;
require "globals.pl";
$| = 1;
umask(0);
$::lockcount = 0;
sub Lock {
if ($::lockcount <= 0) {
$::lockcount = 0;
if (!open(LOCKFID, ">>data/maillock")) {
mkdir "data", 0777;
chmod 0777, "data";
open(LOCKFID, ">>data/maillock") || die "Can't open lockfile.";
}
my $val = flock(LOCKFID,2);
if (!$val) { # '2' is magic 'exclusive lock' const.
print "Lock failed: $val\n";
}
chmod 0666, "data/maillock";
}
$::lockcount++;
}
sub Unlock {
$::lockcount--;
if ($::lockcount <= 0) {
flock(LOCKFID,8); # '8' is magic 'unlock' const.
close LOCKFID;
}
}
sub FileSize {
my ($filename) = (@_);
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks)
= stat($filename);
if (defined $size) {
return $size;
}
return -1;
}
sub Different {
my ($file1, $file2) = (@_);
my $size1 = FileSize($file1);
my $size2 = FileSize($file2);
if ($size1 != $size2) {
return 1;
}
open(FID1, "<$file1") || die "Can't open $file1";
open(FID2, "<$file2") || die "Can't open $file2";
my $d1;
my $d2;
if (read(FID1, $d1, $size1) ne $size1) {
die "Can't read $size1 bytes from $file1";
}
if (read(FID2, $d2, $size2) ne $size2) {
die "Can't read $size2 bytes from $file2";
}
close FID1;
close FID2;
return ($d1 ne $d2);
}
sub DescCC {
my ($cclist) = (@_);
if (scalar(@$cclist) <= 0) {
return "";
}
return "Cc: " . join(", ", @$cclist) . "\n";
}
sub GetBugText {
my ($id) = (@_);
undef %::bug;
my @collist = ("bug_id", "product", "version", "rep_platform", "op_sys",
"bug_status", "resolution", "priority", "bug_severity",
"assigned_to", "reporter", "bug_file_loc", "short_desc",
"component");
my $query = "select " . join(", ", @collist) .
" from bugs where bug_id = $id";
SendSQL($query);
my @row;
if (!(@row = FetchSQLData())) {
return "";
}
foreach my $field (@collist) {
$::bug{$field} = shift @row;
if (!defined $::bug{$field}) {
$::bug{$field} = "";
}
}
$::bug{'assigned_to'} = DBID_to_name($::bug{'assigned_to'});
$::bug{'reporter'} = DBID_to_name($::bug{'reporter'});
$::bug{'long_desc'} = GetLongDescription($id);
my @cclist;
@cclist = split(/,/, ShowCcList($id));
if(Param("changedcc") ne "") {
push(@cclist,Param("changedcc"));
}
$::bug{'cclist'} = \@cclist;
return "Bug\#: $id
Product: $::bug{'product'}
Version: $::bug{'version'}
Platform: $::bug{'rep_platform'}
OS/Version: $::bug{'op_sys'}
Status: $::bug{'bug_status'}
Resolution: $::bug{'resolution'}
Severity: $::bug{'bug_severity'}
Priority: $::bug{'priority'}
Component: $::bug{'component'}
AssignedTo: $::bug{'assigned_to'}
ReportedBy: $::bug{'reporter'}
URL: $::bug{'bug_file_loc'}
" . DescCC($::bug{'cclist'}) . "Summary: $::bug{'short_desc'}
$::bug{'long_desc'}
";
}
sub fixaddresses {
my ($list) = (@_);
my @result;
my %seen;
foreach my $i (@$list) {
if (!defined $::nomail{$i} && !defined $seen{$i}) {
push @result, $i;
$seen{$i} = 1;
}
}
return join(", ", @result);
}
sub Log {
my ($str) = (@_);
Lock();
open(FID, ">>data/maillog") || die "Can't write to data/maillog";
print FID time2str("%D %H:%M", time()) . ": $str\n";
close FID;
Unlock();
}
ConnectToDatabase();
Lock();
# foreach i [split [read_file -nonewline "okmail"] "\n"] {
# set okmail($i) 1
# }
if (open(FID, "<data/nomail")) {
while (<FID>) {
$::nomail{trim($_)} = 1;
}
close FID;
}
my $regenerate = 0;
if (($#ARGV >= 1) && ($ARGV[0] eq "regenerate")) {
$regenerate = 1;
$#ARGV = -1;
SendSQL("select bug_id from bugs order by bug_id");
my @row;
while (@row = FetchSQLData()) {
push @ARGV, $row[0];
}
}
foreach my $i (@ARGV) {
my $old = "shadow/$i";
my $new = "shadow/$i.tmp.$$";
my $diffs = "shadow/$i.diffs.$$";
my $verb = "Changed";
if (!stat($old)) {
mkdir "shadow", 0777;
chmod 0777, "shadow";
open(OLD, ">$old") || die "Couldn't create null $old";
close OLD;
$verb = "New";
}
my $text = GetBugText($i);
if ($text eq "") {
die "Couldn't find bug $i.";
}
open(FID, ">$new") || die "Couldn't create $new";
print FID $text;
close FID;
if (Different($old, $new)) {
my $diffcmd = Param("diffcmd");
my $diffopt = Param("diffopt");
my $pid = open2(\*Reader, \*Writer, "$diffcmd $diffopt $old $new");
open(DIFF, ">$diffs");
while(<Reader>) { print DIFF $_; }
close(DIFF);
close(Reader);
close(Writer);
my $tolist = "";
my $cclist = fixaddresses($::bug{'cclist'});
my $logstr = "Bug $i changed";
if(Param("changedto") ne "") {
$tolist = Param("changedto");
$tolist = fixaddresses([$tolist, $::bug{'assigned_to'}, $::bug{'reporter'}]);
} else {
$tolist = fixaddresses([$::bug{'assigned_to'}, $::bug{'reporter'}]);
}
if ($tolist ne "" || $cclist ne "") {
my %substs;
$substs{"to"} = $tolist;
$substs{"cc"} = $cclist;
$substs{"bugid"} = $i;
$substs{"diffs"} = "";
open(DIFFS, "<$diffs") || die "Can't open $diffs";
while (<DIFFS>) {
$substs{"diffs"} .= $_;
}
close DIFFS;
$substs{"neworchanged"} = $verb;
$substs{"summary"} = $::bug{'short_desc'};
my $subj = PerformSubsts(Param("changedsubj"), \%substs);
my $msg = PerformSubsts(Param("changedbody"), \%substs);
if (!$regenerate) {
Mail($tolist, $cclist, $subj, $msg);
$logstr = "$logstr; mail sent to $tolist $cclist";
}
}
unlink($diffs);
Log($logstr);
}
rename($new, $old) || die "Can't rename $new to $old";
chmod 0666, $old;
if ($regenerate) {
print "$i ";
}
}
exit;

View File

@@ -0,0 +1,494 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: query.cgi,v 1.12.2.3 1999-01-27 17:25:34 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Andrew Anderson <andrew@redhat.com>
use diagnostics;
use strict;
use CGI;
$::cgi = new CGI;
require "CGI.pl";
# Shut up misguided -w warnings about "used only once":
use vars @::legal_resolution,
@::legal_product,
@::legal_bug_status,
@::legal_priority,
@::legal_components,
@::legal_versions,
@::legal_severity;
my $gologin = $::cgi->param('GoAheadAndLogin');
if ($gologin) {
# We got here from a login page, probably from relogin.cgi
# We better make sure the password is legit.
confirm_login();
}
my %default;
my %type;
foreach my $name ("bug_status", "resolution", "assigned_to", "rep_platforms",
"priority", "bug_severity", "product", "reporter", "op_sys",
"component", "version", "view", "order") {
$default{$name} = [];
$type{$name} = 'false';
}
&GetVersionTable;
# Hack alert -- this handles the case when no product is selected, and
# we need to build a platform list to handle any possible query
if (scalar(@{$default{'product'}}) == 0) {
my @platforms;
foreach my $platformkey (sort(keys(%::legal_platforms))) {
my $platformarr = $::legal_platforms{"$platformkey"};
foreach my $platform (@{$platformarr}) {
if (!grep { /$platform/ } @{$::legal_platforms{'empty'}}) {
push(@{$::legal_platforms{'empty'}}, $platform);
}
}
}
}
&ConnectToDatabase;
my %namelist = ();
my @oldqueries;
my $dbquery = "";
my $id = "";
my $login = $::cgi->cookie('Bugzilla_login');
if ($login) {
$id = DBNameToIdAndCheck($login);
# This is as good a place as any to clean up old query cookies
my @cookies = $::cgi->cookie();
foreach my $cookie (@cookies) {
if ($cookie =~ /^QUERY_/ || $cookie =~ /^DEFAULTQUERY$/) {
my $oldquery = "";
my $value = $::cgi->cookie($cookie);
if ($cookie =~ /^DEFAULTQUERY$/) {
$oldquery = $::cgi->cookie(-name=>$cookie,
-value=>'', -path=>"/",
-expires=>"now");
push(@oldqueries, $oldquery);
$oldquery = $::cgi->cookie(-name=>$cookie,
-value=>'', -path=>"/bugzilla/",
-expires=>"now");
push(@oldqueries, $oldquery);
$cookie = "defaultquery";
} else {
$oldquery = $::cgi->cookie(-name=>$cookie,
-value=>'', -path=>"/",
-expires=>"now");
push(@oldqueries, $oldquery);
$oldquery = $::cgi->cookie(-name=>$cookie,
-value=>'', -path=>"/bugzilla/",
-expires=>"now");
push(@oldqueries, $oldquery);
$cookie = substr($cookie, 6);
}
$dbquery = "insert into queries values ($id, '" .
$cookie . "', '" . $value . "')";
SendSQL($dbquery);
}
}
$dbquery = "select query_name, query from queries where userid = $id";
SendSQL($dbquery);
while (my @row = FetchSQLData()) {
my ($query_name, $query) = (@row);
$namelist{$query_name} = $query;
}
}
my $nobuglist_cookie = $::cgi->cookie(-name=>'BUGLIST',
-value=>'',
-path=>"/bugzilla/",
-expires=>"now");
push(@oldqueries, $nobuglist_cookie);
print $::cgi->header(-type=>'text/html',
-cookie=>\@oldqueries);
$namelist{'defaultquery'} = Param('defaultquery')
unless $namelist{'defaultquery'};
my $buffer = "";
# this gets set in buglist.cgi
$::cgi->delete("QUERY");
if (($buffer = $::cgi->query_string()) eq "") {
$buffer = $namelist{'defaultquery'};
}
# There's got to be a better way to do this
foreach my $item (split(/\&/, $buffer)) {
my @el = split(/=/, $item);
my $name = $el[0];
my $value;
if ($#el > 0) {
$value = url_decode($el[1]);
} else {
$value = "";
}
#print $::cgi->h2("name: $name, value: $value");
if (defined $default{$name}) {
if (scalar($default{$name}) > 0) {
my @olddefault = @{$default{$name}};
$default{$name} = [$value, @olddefault];
$type{$name} = 'true';
} else {
$default{$name} = [$value];
}
}
#print "default: @{$default{$name}}" if defined $default{$name};
}
my $who = $::cgi->textfield(-name=>'assigned_to',
-size=>'45',
-override=>'1',
-value=>@{$default{'assigned_to'}});
my $reporter = $::cgi->textfield(-name=>'reporter',
-size=>'45',
-override=>'1',
-value=>@{$default{'reporter'}});
# Muck the "legal product" list so that the default one is always first (and
# is therefore visibly selected.
# Commented out, until we actually have enough products for this to matter.
# set w [lsearch $legal_product @{$default{"product"}}]
# if {$w >= 0} {
# set legal_product [concat @{$default{"product"}} [lreplace $legal_product $w $w]]
# }
PutHeader("Bugzilla Query Page", "Query Page");
# Oy, what a hack.
# This strips out '' (or no resolution)
my @local_legal_resolution;
foreach my $res (@::legal_resolution) {
if ($res ne "") {
push(@local_legal_resolution, $res);
}
}
my $bug_status_html = Param("bugstatushtml");
my $help_html = Param("helphtml");
my @type_values = ['substr', 'regex'];
my %type_labels;
my $type_default = 'substr';
$type_labels{'substr'} = 'Substring';
$type_labels{'regex'} = 'Regex';
delete($namelist{'defaultquery'});
my $named_query = '';
# yes @queries = keys(%namelist) would be more efficient here, but
# since we are deleting members of the list, we might end up with
# an empty hash reference in the array -- so we do it the long way
# just to be sure
my @queries = ();
foreach my $name (keys %namelist) {
#print $::cgi->h4("key: $name, name: $namelist{$name}")
# if ($namelist{$name});
push(@queries, $name) if ($namelist{$name});
}
if (scalar(@queries) > 0) {
$named_query = $::cgi->TR(
$::cgi->td(
$::cgi->radio_group(-name=>'cmdtype',
'-values'=>['editnamed'],
-default=>'-',
-linebreak=>'true',
-labels=>{'editnamed' =>
'Load the remembered query:'})
. "\n",
$::cgi->radio_group(-name=>'cmdtype',
'-values'=>['runnamed'],
-default=>'-',
-linebreak=>'true',
-labels=>{'runnamed' =>
'Run the remembered query:'})
. "\n",
$::cgi->radio_group(-name=>'cmdtype',
'-values'=>['forgetnamed'],
-default=>'-',
-linebreak=>'true',
-labels=>{'forgetnamed' =>
'Forget the remembered query:'})
. "\n"
),
$::cgi->td({-valign=>"CENTER"},
$::cgi->popup_menu(-name=>'namedcmd',
'-values'=>\@queries)
)
);
}
my @prod_array = [];
if (scalar(@{$default{'product'}}) > 1) {
foreach my $prod (@{$default{'product'}}) {
@prod_array = $::legal_platforms{$prod};
}
} else {
@prod_array = $::legal_platforms{'empty'};
}
my $formaction = "buglist.cgi";
print $::cgi->startform(
'-action' => $formaction);
my $tableheader =
$::cgi->TR(
$::cgi->th({"-align" => "LEFT"},
$::cgi->a({"-href" => "$bug_status_html"},
"Status:")),
$::cgi->th({"-align" => "LEFT"},
$::cgi->a({"-href" => "$bug_status_html"},
"Resolution:")),
$::cgi->th({"-align" => "LEFT"},
$::cgi->a({"-href" => "$bug_status_html\#rep_platform"},
"Platform:")),
$::cgi->th({"-align" => "LEFT"},
$::cgi->a({"-href" => "$bug_status_html\#priority"},
"Priority:")),
$::cgi->th({"-align" => "LEFT"},
$::cgi->a({"-href" => "$bug_status_html\#severity"},
"Severity:"))
);
my @defaultbug_status = exists($default{'bug_status'}) ? @{$default{'bug_status'}} : [];
my $bug_status = $::cgi->td({"-align" => "LEFT", "-valign" => "TOP"},
$::cgi->scrolling_list('-name' => "bug_status",
'-values' => \@::legal_bug_status,
'-default' => \@defaultbug_status,
'-size' => "7",
'-multiple' => $type{'bug_status'})), $::cgi->p;
my @defaultresolution = exists($default{'resolution'}) ? @{$default{'resolution'}} : [];
my $resolution = $::cgi->td({"-align"=>"LEFT", "-valign"=>"TOP"},
$::cgi->scrolling_list('-name' => "resolution",
'-values' => \@local_legal_resolution,
'-default' => @defaultresolution,
'-size' => "7",
'-multiple' => $type{'resolution'})), $::cgi->p;
my @defaultrep_platform = exists($default{'rep_platform'}) ? @{$default{'rep_platform'}} : [];
my $platform = $::cgi->td({"-align"=>"LEFT", "-valign"=>"TOP"},
$::cgi->scrolling_list('-name' => "rep_platform",
'-values' => @prod_array,
'-default' => @defaultrep_platform,
'-size' => "7",
'-multiple' => $type{'rep_platform'}));
my @defaultpriority = exists($default{'priority'}) ? @{$default{'priority'}} : [];
my $priority = $::cgi->td({"-align"=>"LEFT", "-valign"=>"TOP"},
$::cgi->scrolling_list('-name' => "priority",
'-values' => \@::legal_priority,
'-default' => @defaultpriority,
'-size' => "7",
'-multiple' => "$type{'priority'}")), $::cgi->p;
my @defaultbug_severity = exists($default{'bug_severity'}) ? @{$default{'bug_severity'}} : [];
my $severity = $::cgi->td({"-align"=>"LEFT", "-valign"=>"TOP"},
$::cgi->scrolling_list('-name' => "bug_severity",
'-values' => \@::legal_severity,
'-default' => \@defaultbug_severity,
'-size' => "7",
'-multiple' => "$type{'bug_severity'}")), $::cgi->p;
print $::cgi->table(
$tableheader,
$::cgi->TR(
$bug_status,
$resolution,
$platform,
$priority,
$severity
)
);
print $::cgi->p,
$::cgi->table(
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"},
$::cgi->a({-href=>"$bug_status_html#assigned_to"},
$::cgi->b("Assigned To:"))
),
$::cgi->td("$who")
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"},
$::cgi->a({-href=>"$bug_status_html#reporter"},
$::cgi->b("Reporter:"))
),
$::cgi->td("$reporter")
)
);
print $::cgi->p,
"Changed in the last ",
$::cgi->textfield(-name=>"changedin", -size=>"2"),
" days.",
$::cgi->p;
my @defaultversion = @{$default{'version'}};
my @defaultcomponent = @{$default{'component'}};
print $::cgi->table(
$::cgi->TR(
$::cgi->th({-align=>"LEFT"}, "Program:"),
$::cgi->th({-align=>"LEFT"}, "Version:"),
$::cgi->th({-align=>"LEFT"}, "Component:"),
),
$::cgi->TR(
$::cgi->td({-align=>"LEFT", -valign=>"TOP"},
$::cgi->scrolling_list(-name=>"product",
'-values'=>\@::legal_product,
'-size'=>"5",
'-default'=>$default{'product'},
'-multiple'=>$type{'product'})),
$::cgi->p,
$::cgi->td({-align=>"LEFT", -valign=>"TOP"},
$::cgi->scrolling_list(-name=>"version",
'-values'=>\@::legal_versions,
'-size'=>"5",
'-default'=>\@defaultversion,
'-multiple'=>$type{'version'})),
$::cgi->p,
$::cgi->td({-align=>"LEFT", -valign=>"TOP"},
$::cgi->scrolling_list(-name=>"component",
'-values'=>\@::legal_components,
'-size'=>"5",
'-default'=>\@defaultcomponent,
'-multiple'=>$type{'component'})),
$::cgi->p
)
),
$::cgi->table(
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"}, "Summary:"),
$::cgi->td($::cgi->textfield(-name=>"short_desc", -size=>"30")),
$::cgi->td(
$::cgi->radio_group(-name=>"short_desc_type",
'-values'=>@type_values,
-default=>$type_default,
-labels=>\%type_labels))
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"}, "Description:"),
$::cgi->td($::cgi->textfield(-name=>"long_desc", -size=>"30")),
$::cgi->td(
$::cgi->radio_group(-name=>"long_desc_type",
'-values'=>@type_values,
-default=>$type_default,
-labels=>\%type_labels))
)
),
$::cgi->p,
$::cgi->table({-border=>'0'},
$::cgi->TR(
$::cgi->td(
$::cgi->radio_group(-name=>'cmdtype',
'-values'=>['doit'],
-default=>'doit',
-linebreak=>'true',
-labels=>{'doit' => 'Run this query'})
. "\n"
),
$::cgi->td("&nbsp;")
),
$named_query,
$::cgi->TR(
$::cgi->td(
$::cgi->radio_group(-name=>'cmdtype',
'-values'=>['asdefault'],
-default=>'-',
-linebreak=>'true',
-labels=>{'asdefault' =>
'Remember this as the default query'})
. "\n"
),
$::cgi->td("&nbsp;")
),
$::cgi->TR(
$::cgi->td(
$::cgi->radio_group(-name=>'cmdtype',
'-values'=>['asnamed'],
-default=>'-',
-linebreak=>'true',
-labels=>{'asnamed' =>
'Remember this query, and name it:'})
. "\n"
),
$::cgi->td(
# FIXME: make this size limited to the size of query_name
$::cgi->textfield(-name=>'newqueryname')
)
)
),
$::cgi->p,
$::cgi->b("Sort By:"),
"&nbsp;&nbsp;";
my @orderdefault = @{$default{'order'}};
print $::cgi->popup_menu(
'-name'=>'order',
'-values'=>['Bug Number', 'Importance', 'Assignee'],
'-default'=>@orderdefault),
$::cgi->submit(-name=>'submit', -value=>'Submit'),
"&nbsp;&nbsp;",
$::cgi->reset(-value=>'Reset back to the default query'),
$::cgi->hidden(-name=>"form_name", -value=>"query"),
$::cgi->endform,
$::cgi->br,
"Give me a ",
$::cgi->a({-href=>"$help_html"}, "clue"),
" about how to use this form.",
$::cgi->p;
my $logincookie = $::cgi->cookie('Bugzilla_login');
if ($logincookie) {
if ($::cgi->cookie('Bugzilla_login') eq Param("maintainer")) {
print $::cgi->a({-href=>"editparams.cgi"},
"Edit Bugzilla operating parameters"),
$::cgi->br,
$::cgi->a({-href=>"editowners.cgi"},
"Edit Bugzilla component owners"),
$::cgi->br,
$::cgi->a({-href=>"editgroups.cgi"},
"Edit Bugzilla group permissions"),
$::cgi->br
}
print $::cgi->a({-href=>"relogin.cgi"}, "Log in as someone besides",
$::cgi->b($::cgi->cookie('Bugzilla_login'))),
$::cgi->br;
}
print $::cgi->a({-href=>"changepassword.cgi"}, "Change your password."),
$::cgi->br,
$::cgi->a({-href=>"enter_bug.cgi"}, "Enter a new bug."),
$::cgi->br,
$::cgi->a({-href=>"reports.cgi"}, "Bug reports."),
$::cgi->br,
$::cgi->end_html;

View File

@@ -0,0 +1,126 @@
<!--
The contents of this file are subject to the Mozilla 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/MPL/
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 Bugzilla Bug Tracking System.
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): Andrew Anderson <andrew@redhat.com>
-->
<? include "header.html" ?>
<H1>Red Hat Bugzilla FAQ</H1>
<UL>
<LI><A HREF="#whatisit">What is it?</A>
<LI><A HREF="#howdoienter">How do I enter a bug?</A>
<LI><A HREF="#whathappens">What happens once I enter a bug?</A>
<LI><A HREF="#howdoisearch">How do I search for a bug?</A>
<LI><A HREF="#howdoipatch">How do I submit a patch?</A>
</UL>
<A NAME="whatisit"><H2>What is it?</H2></A>
Bugzilla is a bug tracking system developed at
<A HREF="http://www.mozilla.org/">mozilla.org</A>.
It was originally used to track the bugs in the
Mozilla web browser. Red Hat has customized it to
track bugs in our Linux products.
<A NAME="howdoienter"><H2>How do I enter a bug?</H2></A>
To enter a bug, select <I><A HREF="enter_bug.cgi">Enter a new bug</A></I>
from the <A HREF="/bugzilla/">main bugzilla page</A>. This will
take you to a product selection screen.
<P>
From this screen you select the product that you wish to enter a bug
for, by selecting the hightlighted product name. This will take you
to a bug entry screen.
<P>
<B>Example:</B> <I>Red Hat Linux</I>
<P>
From the bug entry screen, you need to select the version of the
product that you are entering a bug on, along with which component
of the product that is having a problem.
<P>
<B>Example:</B> <I>5.2</I> and <I>acm</I>
<P>
Next, select the <A HREF="bug_status.phtml#priority">Priority</A>
and <A HREF="bug_status.phtml#severity">Severity</A> of your bug.
<P>
<B>Example:</B> <I>Normal</I> and <I>Normal</I>
<P>
Then you will select which
<A HREF="bug_status.phtml#rep_platform">Architecture</A> your bug
occurs on.
<P>
<B>Example:</B> If you are using an Intel x86 platform,
you will choose <I>i386</I>.
<P>
The <I>Cc:</I> field can be used to add someone to the carbon-copy
list for all email related to this bug. As the reporter of the bug,
you will automatically be copied on any mail, so you do not need to
add yourself to this.
<P>
Enter a one line description of the bug into the <I>Summary</I> field,
and the full description of the bug inot the <I>Description</I> field.
<A NAME="whathappens"><H2>What happens once I enter a bug?</H2></A>
After you enter a bug, mail is sent both to you and the QA department
of Red Hat. A member of the QA department will verify that they can
reproduce your bug, and may contact you to get additional information.
<P>
After the bug has been <A HREF="bug_status.phtml#verified">verified</A>,
it will be assigned to a developer to look into a resolution for the bug.
<P>
Once a resolution has been found, the bug will be marked
<A HREF="bug_status.phtml#resolved">RESOLVED</A> with a
<A HREF="bug_status.phtml#fixed">resolution status</A>.
<P>
At each step of the process, you will get an email message that will
tell you what has been updated on your bug report.
<A NAME="howdoisearch"><H2>How do I search for a bug?</H2></A>
To search for a bug, select <A HREF="query.cgi"><I>Go to the query page</I></A>
from the <A HREF="/bugzilla/">main bugzilla page</A>.
<P>
The bugzilla search uses an "OR" within each field,
with an "AND" between fields. So, if you were to
select <A HREF="bug_status.phtml#new"><B>NEW</B></A> and
<A HREF="bug_status.phtml#verified"><B>VERIFIED</B></A> from the
<A HREF="bug_status.phtml#status"><I>Status</I></A> field and
<B>normal</B> from the <A HREF="bug_status.phtml#priority"><I>Priority</I></A>
field, you would be asking for all normal priority bugs that are
new or verified.
<A NAME="#howdoipatch"><H2>How do I submit a patch?</H2></A>
Send your patch to
<A HREF="mailto:bugzilla@redhat.com?subject=BUG%20ID%20%23">bugzilla@redhat.com</A>
with the subject line of "BUG ID #" followed by your bug number.
<P>
This will preserve the format of your patch so that it does not
get mangled by HTML or CGI parsing, and will make it easier for
our developers to apply and test your patch.
<P>
<BLINK><B>PLEASE DO NOT SEND MAIL AS ROOT!</B></BLINK>
<P>
The mail filters that process patches are setup to avoid mail loops,
and do not process mail that is sent from system accounts, such as
root. Please send mail from a normal user account.
<P>
<? include "footer.html" ?>

View File

@@ -0,0 +1,56 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: relogin.cgi,v 1.3.2.3 1999-01-27 17:25:35 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
use diagnostics;
use strict;
use CGI;
$::cgi = new CGI;
require "CGI.pl";
# FIXME: make the path a config option
my $login_cookie = $::cgi->cookie(-name=>'Bugzilla_login',
-value=>'',
-expires=>"now",
-path=>"/bugzilla/");
my $logincookie_cookie = $::cgi->cookie(-name=>'Bugzilla_logincookie',
-value=>'',
-expires=>"now",
-path=>"/bugzilla/");
my $password_cookie = $::cgi->cookie(-name=>'Bugzilla_password',
-value=>'',
-expires=>"now",
-path=>"/bugzilla/");
print $::cgi->header(-type=>'text/html',
-cookie=>[$login_cookie, $logincookie_cookie, $password_cookie]);
PutHeader("Your login has been forgotten");
print "The cookie that was remembering your login is now gone. " .
"The next time you do an action that requires a login, you " .
"will be prompted for it.<P>" .
$::cgi->a({-href=>"query.cgi"}, "Back to the query page.");
exit;

View File

@@ -0,0 +1,498 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: reports.cgi,v 1.6.2.3 1999-01-27 17:25:35 andrew%redhat.com Exp $
#
# Contributor(s): Harrison Page <harrison@netscape.com>,
# Terry Weissman <terry@mozilla.org>,
# Andrew Anderson <andrew@redhat.com>
use diagnostics;
use strict;
use Chart::Lines;
use CGI;
$::cgi = new CGI;
require "CGI.pl";
use vars @::legal_product;
my $dir = "data/mining";
my $week = 60 * 60 * 24 * 7;
my @status = qw (NEW ASSIGNED REOPENED);
# while this looks odd/redundant, it allows us to name
# functions differently than the value passed in
my %reports =
(
"most_doomed" => \&most_doomed,
"show_chart" => \&show_chart,
);
# patch from Sam Ziegler <ziegler@mediaguaranty.com>:
#
# "reports.cgi currently has it's own idea of what
# the header should be. This patch sets it to the
# system wide header."
print $::cgi->header('text/html');
if ($::cgi->param('nobanner') ne "") {
print $::cgi->start_html(-title=>"Bug Reports", -BGCOLOR=>"#FFFFFF");
} else {
PutHeader ("Bug Reports");
}
ConnectToDatabase();
GetVersionTable();
$::cgi->param(-name=>'output',
# a reasonable default
-value=>$::cgi->param('output') || "most_doomed",
-override=>"1");
if ($::cgi->param('product') eq "") {
&choose_product;
} else {
# we want to be careful about what subroutines
# can be called from outside. modify %reports
# accordingly when a new report type is added
if (! exists $reports{$::cgi->param('output')}) {
# a reasonable default
$::cgi->param(-name=>'output',
-value=>"most_doomed",
-override=>"1");
}
my $f = $reports{$::cgi->param('output')};
if (! defined $f) {
print "start over, your form data was all messed up.<p>\n";
foreach (%::cgi->param()) {
print $::cgi->font({-color=>"BLUE"}, "$_") .
" : " .
($::cgi->param($_) ? $::cgi->($_) : "undef") .
$::cgi->br;
}
print $::cgi->end_html;
exit;
}
&{$f};
}
print $::cgi->p, $::cgi->end_html;
##################################
# user came in with no form data #
##################################
sub choose_product {
my $charts;
my @chart_values;
my %chart_labels;
$chart_labels{'most_doomed'} = "Bug Counts";
$chart_labels{'show_chart'} = "Bug Charts";
push(@chart_values, 'most_doomed');
push(@chart_values, 'show_chart') if (-d $dir);
$charts = $::cgi->popup_menu(-name=>'output',
'-values'=>\@chart_values,
-labels=>\%chart_labels);
print $::cgi->center(
$::cgi->h1("Welcome to the Bugzilla Query Kitchen"),
$::cgi->startform,
$::cgi->table({-border=>"1", -cellpadding=>"5"},
$::cgi->TR(
$::cgi->td({-align=>"CENTER"}, $::cgi->b("Product:")),
$::cgi->td({-align=>"CENTER"},
$::cgi->popup_menu(-name=>"product",
'-values'=>\@::legal_product,
-default=>$::legal_product[0])
),
),
$::cgi->TR(
$::cgi->td({-align=>"CENTER"}, $::cgi->b("Output:")),
$::cgi->td({-align=>"CENTER"}, "$charts")
),
$::cgi->TR(
$::cgi->td({-align=>"CENTER"}, $::cgi->b("Switches:")),
$::cgi->td({-align=>"LEFT"},
$::cgi->checkbox(-name=>"links",
-checked=>'checked',
-label=>"Links to Bugs",
-value=>"1"),
$::cgi->br,
$::cgi->checkbox(-name=>"nobanner",
-label=>"No Banner",
-value=>"1"),
$::cgi->br,
$::cgi->checkbox(-name=>"quip",
-checked=>'checked',
-label=>"Include Quip",
-value=>")1"),
$::cgi->br
)
),
$::cgi->TR(
$::cgi->td({-align=>"CENTER", -colspan=>"2"},
$::cgi->submit(-name=>"submit", -value=>"Continue"))
)
),
$::cgi->endform,
$::cgi->p,
);
}
sub most_doomed {
my $when = localtime (time);
my $product = $::cgi->param('product');
print $::cgi->center(
$::cgi->h1("Bug Report for $product"),
$when,
$::cgi->p
);
my $query = <<FIN;
select
bugs.bug_id, bugs.assigned_to, bugs.bug_severity,
bugs.bug_status, bugs.product,
assign.login_name,
report.login_name,
unix_timestamp(date_format(bugs.creation_ts, '%Y-%m-%d %h:%m:%s'))
from bugs,
profiles assign,
profiles report,
versions projector
where bugs.assigned_to = assign.userid
and bugs.reporter = report.userid
and bugs.product='$product'
and
(
bugs.bug_status = 'NEW' or
bugs.bug_status = 'ASSIGNED' or
bugs.bug_status = 'REOPENED'
)
FIN
print $::cgi->font({-color=>"PURPLE"}, $::cgi->tt($query)), $::cgi->p
unless ($::cgi->param('showsql') eq "");
SendSQL ($query);
my $c = 0;
my $quip = "Summary";
my $bugs_count = 0;
my $bugs_new_this_week = 0;
my $bugs_reopened = 0;
my %bugs_owners;
my %bugs_summary;
my %bugs_status;
my %bugs_totals;
my %bugs_lookup;
#############################
# suck contents of database #
#############################
while (my ($bid, $a, $sev, $st, $prod, $who, $rep, $ts) = FetchSQLData())
{
next if (exists $bugs_lookup{$bid});
$bugs_lookup{$bid} ++;
$bugs_owners{$who} ++;
$bugs_new_this_week ++ if (time - $ts <= $week);
$bugs_status{$st} ++;
$bugs_count ++;
push @{$bugs_summary{$who}{$st}}, $bid;
$bugs_totals{$who}{$st} ++;
}
if ($::cgi->param('quip')) {
if (open (COMMENTS, "<data/comments")) {
my @cdata;
while (<COMMENTS>) {
push @cdata, $_;
}
close COMMENTS;
$quip = $::cgi->i($cdata[int(rand($#cdata + 1))]);
}
}
#########################
# start painting report #
#########################
print $::cgi->center(
$::cgi->h1("$quip"),
$::cgi->table({-border=>"1", -cellpadding=>"5"},
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"},
$::cgi->b("New Bugs This Week")),
$::cgi->td({-align=>"CENTER"},
$bugs_new_this_week ? $bugs_new_this_week
: "&nbsp;")
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"},
$::cgi->b("Bugs Marked New")),
$::cgi->td({-align=>"CENTER"},
$bugs_status{'NEW'} ? $bugs_status{'NEW'}
: "&nbsp;")
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"},
$::cgi->b("Bugs Marked Assigned")),
$::cgi->td({-align=>"CENTER"},
$bugs_status{'ASSIGNED'} ? $bugs_status{'ASSIGNED'}
: "&nbsp;")
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"},
$::cgi->b("Bugs Marked Reopened")),
$::cgi->td({-align=>"CENTER"},
$bugs_status{'REOPENED'} ? $bugs_status{'REOPENED'}
: "&nbsp;")
),
$::cgi->TR(
$::cgi->td({-align=>"RIGHT"}, $::cgi->b("Total Bugs")),
$::cgi->td({-align=>"CENTER"},
$bugs_count ? $bugs_count : "&nbsp;")
)
)
),
$::cgi->p;
if ($bugs_count == 0) {
print "No bugs found!\n";
print $::cgi->end_html;
exit;
}
my $tablerow;
my @tabledata;
foreach my $who (sort keys %bugs_summary) {
my $bugz = 0;
my @totals;
foreach my $st (@status) {
$bugs_totals{$who}{$st} += 0;
push(@totals, $::cgi->td({-align=>"CENTER"},
$bugs_totals{$who}{$st}));
$bugz += $#{$bugs_summary{$who}{$st}} + 1;
}
$tablerow = $::cgi->TR(
$::cgi->td({-align=>"LEFT"}, $::cgi->tt($who)),
@totals,
$::cgi->td({-align=>"LEFT"}, $bugz),
);
push(@tabledata, $tablerow);
}
print $::cgi->center(
$::cgi->h1("Bug Count by Engineer"),
$::cgi->table({-border=>"3", -cellpadding=>"5"},
$::cgi->TR(
$::cgi->td({-align=>"CENTER", -BGCOLOR=>"#DDDDDD"},
$::cgi->b("Owner")),
$::cgi->td({-align=>"CENTER", -BGCOLOR=>"#DDDDDD"},
$::cgi->b("New")),
$::cgi->td({-align=>"CENTER", -BGCOLOR=>"#DDDDDD"},
$::cgi->b("Assigned")),
$::cgi->td({-align=>"CENTER", -BGCOLOR=>"#DDDDDD"},
$::cgi->b("Reopened")),
$::cgi->td({-align=>"CENTER", -BGCOLOR=>"#DDDDDD"},
$::cgi->b("Total")),
),
@tabledata
)
),
$::cgi->p;
###############################
# individual bugs by engineer #
###############################
@tabledata = undef;
foreach my $who (sort keys %bugs_summary) {
my @temprow;
foreach my $st (@status) {
my @l;
foreach (sort {$a<=>$b} @{$bugs_summary{$who}{$st}}) {
if ($::cgi->param('links')) {
push @l, $::cgi->a({-href=>"show_bug.cgi?id=$_"}, "$_");
} else {
push @l, $_;
}
}
my $bugz = join ' ', @l;
$bugz = "&nbsp;" unless ($bugz);
push(@temprow, $::cgi->td({-align=>"LEFT"}, $bugz));
}
$tablerow = $::cgi->TR(
$::cgi->td({-align=>"LEFT"}, $::cgi->tt("$who")),
@temprow
);
push(@tabledata, $tablerow);
}
print $::cgi->center(
$::cgi->h1("Individual Bugs by Engineer"),
$::cgi->table({-border=>"1", -cellpadding=>"5"},
$::cgi->TR(
$::cgi->td({-align=>"CENTER", -BGCOLOR=>"#DDDDDD"},
$::cgi->b("Owner")),
$::cgi->td({-align=>"CENTER", -BGCOLOR=>"#DDDDDD"},
$::cgi->b("New")),
$::cgi->td({-align=>"CENTER", -BGCOLOR=>"#DDDDDD"},
$::cgi->b("Assigned")),
$::cgi->td({-align=>"CENTER", -BGCOLOR=>"#DDDDDD"},
$::cgi->b("Reopened"))
),
@tabledata
)
),
$::cgi->p;
}
sub is_legal_product {
my $product = shift;
return grep { $_ eq $product} @::legal_product;
}
sub header {
print $::cgi->table({-BGCOLOR=>"#000000", -width=>"100%", -border=>"0",
-cellpadding=>"0", -cellspacing=>"0"},
$::cgi->TR(
$::cgi->td(
$::cgi->a({-href=>"http://www.mozilla.org/"},
$::cgi->img({-src=>"http://www.mozilla.org/images/mozilla-banner.gif", -alt=>"", -border=>"0", -width=>"600", -height=>"58"})
)
)
)
)
}
sub show_chart {
my $when = localtime (time);
my $product = $::cgi->param('product');
if (! is_legal_product($product)) {
&die_politely ("Unknown product: $product");
}
print "<CENTER>";
my @dates;
my @open;
my @assigned;
my @reopened;
my $prodname = $product;
$prodname =~ s/\//-/gs;
my $file = join '/', $dir, $prodname;
if (! open FILE, $file) {
&die_politely ("The tool which gathers bug counts has not been run yet.");
}
my $image = "$file.gif";
while (<FILE>) {
chomp;
next if ($_ =~ /^#/ or ! $_);
my ($date, $open, $assigned, $reopened) = split /\|/, $_;
my ($yy, $mm, $dd) = $date =~ /^\d{2}(\d{2})(\d{2})(\d{2})$/;
push @dates, "$mm/$dd/$yy";
push @open, $open;
push @assigned, $assigned;
push @reopened, $reopened;
}
close FILE;
if ($#dates < 1) {
&die_politely ("We don't have enough data points to make a graph (yet)");
}
my $img = Chart::Lines->new (800, 600);
my @labels = qw (New Assigned Reopened);
my @when;
my $i = 0;
my @data;
push @data, \@dates;
push @data, \@open;
push @data, \@assigned;
push @data, \@reopened;
my %settings = (
"title" => "Bug Charts for $product",
"x_label" => "Dates",
"y_label" => "Bug Count",
"legend_labels" => \@labels,
);
$img->set (%settings);
$img->gif("$image", \@data);
# FIXME: get this hack fixed
$image =~ s/ /%20/g;
print $::cgi->img({-src=>$image}),
$::cgi->br({-clear=>"LEFT"}),
$::cgi->br;
}
sub die_politely {
my $msg = shift;
my $product = $::cgi->param('product');
print $::cgi->p,
$::cgi->table({-border=>"1", -cellpadding=>"10"},
$::cgi->TR(
$::cgi->td({-align=>"CENTER"},
$::cgi->font({-color=>"BLUE"}, "Sorry, but ..."),
$::cgi->p,
"There is no graph available for ",
$::cgi->b("$product"),
$::cgi->p,
$::cgi->font({-size=>"-1"}, "$msg"),
$::cgi->p
)
)
),
$::cgi->p,
$::cgi->end_html;
exit;
}

View File

@@ -0,0 +1,124 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: sanitycheck.cgi,v 1.2.2.3 1999-01-27 17:25:36 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Andrew Anderson <andrew@redhat.com>
use diagnostics;
use strict;
use CGI;
$::cgi = new CGI;
require "CGI.pl";
print $::cgi->header('text/html');
ConnectToDatabase();
sub Status {
my ($str) = (@_);
print "$str<P>\n";
}
sub Alert {
my ($str) = (@_);
Status("<FONT COLOR=\"red\">$str</FONT>");
}
sub BugLink {
my ($id) = (@_);
return $::cgi->a({-href=>"show_bug.cgi?id=$id"}, "$id");
}
PutHeader("Bugzilla Sanity Check");
print "OK, now running sanity checks.<P>\n";
Status("Checking profile and group ids...");
my @row;
my %groupids;
SendSQL("select groupid from groups");
while (@row = FetchSQLData()) {
my ($gid) = (@row);
$groupids{$gid} = 1;
}
SendSQL("select userid,login_name,groupid from profiles");
my %profid;
while (@row = FetchSQLData()) {
my ($id, $email, $gid) = (@row);
if ($email =~ /^[^@, ]*@[^@, ]*\.[^@, ]*$/) {
$profid{$id} = 1;
} else {
Alert "Bad profile id $id &lt;$email&gt;."
}
if (!$groupids{$gid}) {
Alert "Bad group id $gid for $id &lt;$email&gt;."
}
}
undef $profid{0};
Status("Checking reporter/assigned_to ids");
SendSQL("select bug_id,reporter,assigned_to from bugs");
my %bugid;
while (@row = FetchSQLData()) {
my($id, $reporter, $assigned_to) = (@row);
$bugid{$id} = 1;
if (!defined $profid{$reporter}) {
Alert("Bad reporter $reporter in " . BugLink($id));
}
if (!defined $profid{$assigned_to}) {
Alert("Bad assigned_to $assigned_to in" . BugLink($id));
}
}
Status("Checking CC table");
SendSQL("select bug_id,who from cc");
while (@row = FetchSQLData()) {
my ($id, $cc) = (@row);
if (!defined $profid{$cc}) {
Alert("Bad cc $cc in " . BugLink($id));
}
}
Status("Checking activity table");
SendSQL("select bug_id,who from bugs_activity");
while (@row = FetchSQLData()) {
my ($id, $who) = (@row);
if (!defined $bugid{$id}) {
Alert("Bad bugid " . BugLink($id));
}
if (!defined $profid{$who}) {
Alert("Bad who $who in " . BugLink($id));
}
}

View File

@@ -0,0 +1,83 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: show_activity.cgi,v 1.2.2.3 1999-01-27 17:25:36 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
use diagnostics;
use strict;
use CGI;
$::cgi = new CGI;
require "CGI.pl";
require "security.pl";
print $::cgi->header('text/html');
my $bug_id = $::cgi->param("id");
PutHeader("Changes made to bug $bug_id", "Activity log",
"Bug $bug_id");
my $query = "
select bugs_activity.field, bugs_activity.when,
bugs_activity.oldvalue, bugs_activity.newvalue,
profiles.login_name
from bugs_activity,profiles
where bugs_activity.bug_id = '" . $bug_id . "'
and profiles.userid = bugs_activity.who";
ConnectToDatabase();
my $view_query = "SELECT type_id FROM type where name = 'public'";
SendSQL($view_query);
my $type = FetchOneColumn();
if (CanIView("type")){
$query .= " and bugs.type = " . $type;
}
$query .= " order by bugs_activity.when";
SendSQL($query);
my @row;
my @table_data;
while (@row = FetchSQLData()) {
my ($field,$when,$old,$new,$who) = (@row);
$old = value_quote($old);
$new = value_quote($new);
my $line = $::cgi->TR($::cgi->td($who), $::cgi->td($field),
$::cgi->td($old), $::cgi->td($new), $::cgi->td($when));
push(@table_data, $line);
}
print $::cgi->table({-border=>"0", -cellpadding=>"4"},
$::cgi->TR(
$::cgi->th("Who"), $::cgi->th("What"),
$::cgi->th("Old Value"), $::cgi->th("New Value"),
$::cgi->th("When")
),
@table_data
),
$::cgi->hr,
$::cgi->a({-href=>"show_bug.cgi?id=$bug_id"}, "Back to bug $bug_id")

View File

@@ -0,0 +1,56 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: show_bug.cgi,v 1.2.2.3 1999-01-27 17:25:37 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
use diagnostics;
use strict;
use CGI;
$::cgi = new CGI;
require "CGI.pl";
confirm_login();
if ($::cgi->param('id') eq "") {
PutHeader("Search By Bug Number");
print $::cgi->startform .
"You may find a single bug by entering its bug id here: \n" .
$::cgi->textfield(-name=>"id", -default=>'') .
$::cgi->submit(-name=>"submit", -value=>"Show Me This Bug") .
$::cgi->endform;
exit;
}
ConnectToDatabase();
GetVersionTable();
# get rid of those damn 'used only once errors'
$::header = $::h1 = $::h2 = "";
$::bug_id = $::cgi->param("id");
$::header = "Bugzilla Bug $::bug_id";
$::h1 = "Bugzilla Bug";
$::h2 = "$::bug_id";
do "bug_form.pl";

View File

@@ -0,0 +1,73 @@
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 Bugzilla Bug Tracking System.
#
# 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.
#
# $Id: whineatnews.pl,v 1.1.2.3 1999-01-27 17:25:38 andrew%redhat.com Exp $
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# This is a script suitable for running once a day from a cron job. It
# looks at all the bugs, and sends whiny mail to anyone who has a bug
# assigned to them that has status NEW that has not been touched for
# more than 7 days.
use diagnostics;
use strict;
require "globals.pl";
ConnectToDatabase();
SendSQL("select bug_id,login_name from bugs,profiles where " .
"bug_status = 'NEW' and to_days(now()) - to_days(delta_ts) > " .
Param('whinedays') . " and userid=assigned_to order by bug_id");
my %bugs;
my @row;
while (@row = FetchSQLData()) {
my ($id, $email) = (@row);
if (!defined $bugs{$email}) {
$bugs{$email} = [];
}
push @{$bugs{$email}}, $id;
}
my $template = Param('whinebody');
my $urlbase = Param('urlbase');
foreach my $email (sort (keys %bugs)) {
my %substs;
$substs{'email'} = $email;
my $msg = PerformSubsts($template, \%substs);
foreach my $i (@{$bugs{$email}}) {
$msg .= " ${urlbase}show_bug.cgi?id=$i\n"
}
my $tolist = $email;
my $cclist = Param("whinecc");
if(Param("whineto") ne "") {
$tolist .= ", " . Param("whineto");
}
Mail($tolist, $cclist, Param("whinesubj"), $msg);
print "$tolist " . join(" ", @{$bugs{$email}}) . "\n";
}

View File

@@ -1,39 +0,0 @@
#!gmake
#
# 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 Mozilla Communicator client code,
# released March 31, 1998.
#
# 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.
#
# Contributors:
# Daniel Veditz <dveditz@netscape.com>
# Douglas Turner <dougt@netscape.com>
DEPTH = ..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = public
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk

View File

@@ -1,30 +0,0 @@
#!nmake
#
# 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 Mozilla Communicator client code,
# released March 31, 1998.
#
# 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.
#
# Contributors:
# Daniel Veditz <dveditz@netscape.com>
# Douglas Turner <dougt@netscape.com>
DEPTH=..
DIRS= public res src
include <$(DEPTH)\config\rules.mak>

View File

@@ -1,33 +0,0 @@
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:NC="http://home.netscape.com/NC-rdf#">
<RDF:Bag ID="NC:SoftwareUpdateRoot">
<RDF:li>
<RDF:Bag ID="NC:NewSoftwareToday" NC:title="New Software">
<RDF:li>
<RDF:Description ID="AimUpdate344">
<NC:type resource="http://home.netscape.com/NC-rdf#SoftwarePackage" />
<NC:title>AOL AIM</NC:title>
<NC:description>An Instant Message Client</NC:description>
<NC:version>3.4.1.12</NC:version>
<NC:registryKey>/AOL/AIM/</NC:registryKey>
<NC:url>http://home.netscape.com/index.html</NC:url>
</RDF:Description>
</RDF:li>
<RDF:li>
<RDF:Description ID="PGPPlugin345">
<NC:type resource="http://home.netscape.com/NC-rdf#SoftwarePackage" />
<NC:title>PGP Plugin For Mozilla</NC:title>
<NC:description>A high grade encryption plugin</NC:description>
<NC:version>1.1.2.0</NC:version>
<NC:registryKey>/PGP/ROCKS/</NC:registryKey>
<NC:url>http://home.netscape.com/index.html</NC:url>
</RDF:Description>
</RDF:li>
</RDF:Bag>
</RDF:li>
</RDF:Bag>
</RDF:RDF>

View File

@@ -1,57 +0,0 @@
window {
display: block;
}
tree {
display: table;
background-color: #FFFFFF;
border: none;
border-spacing: 0px;
width: 100%;
}
treecol {
display: table-column;
width: 200px;
}
treeitem {
display: table-row;
}
treehead {
display: table-header-group;
}
treebody {
display: table-row-group;
}
treecell {
display: table-cell;
font-family: Verdana, Sans-Serif;
font-size: 8pt;
}
treecell[selectedcell] {
background-color: yellow;
}
treehead treeitem treecell {
background-color: #c0c0c0;
border: outset 1px;
border-color: white #707070 #707070 white;
padding-left: 4px;
}
treeitem[type="http://home.netscape.com/NC-rdf#SoftwarePackage"] > treecell > titledbutton {
list-style-image: url("resource:/res/rdf/SoftwareUpdatePackage.gif");
}
treeitem[type="http://home.netscape.com/NC-rdf#Folder"] > treecell > titledbutton {
list-style-image: url("resource:/res/rdf/bookmark-folder-closed.gif");
treeitem[type="http://home.netscape.com/NC-rdf#Folder"][open="true"] > treecell > titledbutton {
list-style-image: url("resource:/res/rdf/bookmark-folder-open.gif");
}

View File

@@ -1,123 +0,0 @@
// the rdf service
var RDF = Components.classes['component://netscape/rdf/rdf-service'].getService();
RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService);
function getAttr(registry,service,attr_name)
{
var attr = registry.GetTarget(service,
RDF.GetResource('http://home.netscape.com/NC-rdf#' + attr_name),
true);
if (attr)
attr = attr.QueryInterface(Components.interfaces.nsIRDFLiteral);
if (attr)
attr = attr.Value;
return attr;
}
function Init()
{
// this is the main rdf file.
var mainRegistry = RDF.GetDataSource('resource://res/rdf/SoftwareUpdates.rdf');
var mainContainer = Components.classes['component://netscape/rdf/container'].createInstance();
mainContainer = mainContainer.QueryInterface(Components.interfaces.nsIRDFContainer);
mainContainer.Init(mainRegistry, RDF.GetResource('NC:SoftwareUpdateDataSources'));
// Now enumerate all of the softwareupdate datasources.
var mainEnumerator = mainContainer.GetElements();
while (mainEnumerator.HasMoreElements())
{
var aDistributor = mainEnumerator.GetNext();
aDistributor = aDistributor.QueryInterface(Components.interfaces.nsIRDFResource);
var distributorContainer = Components.classes['component://netscape/rdf/container'].createInstance();
distributorContainer = distributorContainer.QueryInterface(Components.interfaces.nsIRDFContainer);
var distributorRegistry = RDF.GetDataSource(aDistributor.Value);
var distributorResource = RDF.GetResource('NC:SoftwareUpdateRoot');
distributorContainer.Init(distributorRegistry, distributorResource);
// Now enumerate all of the distributorContainer's packages.
var distributorEnumerator = distributorContainer.GetElements();
while (distributorEnumerator.HasMoreElements())
{
var aPackage = distributorEnumerator.GetNext();
aPackage = aPackage.QueryInterface(Components.interfaces.nsIRDFResource);
// remove any that we do not want.
if (getAttr(distributorRegistry, aPackage, 'title') == "AOL AIM")
{
//distributorContainer.RemoveElement(aPackage, true);
}
}
var tree = document.getElementById('tree');
// Add it to the tree control's composite datasource.
tree.database.AddDataSource(distributorRegistry);
}
// Install all of the stylesheets in the softwareupdate Registry into the
// panel.
// TODO
// XXX hack to force the tree to rebuild
var treebody = document.getElementById('NC:SoftwareUpdateRoot');
treebody.setAttribute('id', 'NC:SoftwareUpdateRoot');
}
function OpenURL(event, node)
{
if (node.getAttribute('type') == "http://home.netscape.com/NC-rdf#SoftwarePackage")
{
url = node.getAttribute('url');
/*window.open(url,'bookmarks');*/
var toolkitCore = XPAppCoresManager.Find("ToolkitCore");
if (!toolkitCore)
{
toolkitCore = new ToolkitCore();
if (toolkitCore)
{
toolkitCore.Init("ToolkitCore");
}
}
if (toolkitCore)
{
toolkitCore.ShowWindow(url,window);
}
dump("OpenURL(" + url + ")\n");
return true;
}
return false;
}
// To get around "window.onload" not working in viewer.
function Boot()
{
var tree = document.getElementById('tree');
if (tree == null) {
setTimeout(Boot, 0);
}
else {
Init();
}
}
setTimeout('Boot()', 0);

View File

@@ -1,30 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="resource:/res/rdf/sidebar.css" type="text/css"?>
<?xml-stylesheet href="resource:/res/rdf/SoftwareUpdate.css" type="text/css"?>
<window
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<html:script src="SoftwareUpdate.js"/>
<tree id="tree"
flex="100%"
datasources="rdf:softwareupdates"
ondblclick="return OpenURL(event, event.target.parentNode);">
<treecol rdf:resource="http://home.netscape.com/NC-rdf#title" />
<treecol rdf:resource="http://home.netscape.com/NC-rdf#description" />
<treecol rdf:resource="http://home.netscape.com/NC-rdf#version" />
<treehead>
<treeitem>
<treecell>Title</treecell>
<treecell>Description</treecell>
<treecell>Version</treecell>
</treeitem>
</treehead>
<treebody id="NC:SoftwareUpdateRoot" rdf:containment="http://home.netscape.com/NC-rdf#child" />
</tree>
</window>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

View File

@@ -1,7 +0,0 @@
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:NC="http://home.netscape.com/softwareupdate-schema#">
<RDF:Bag ID="NC:SoftwareUpdateDataSources">
<RDF:li resource="resource:/res/rdf/SoftwareUpdate-Source-1.rdf" />
</RDF:Bag>
</RDF:RDF>

View File

@@ -1,6 +0,0 @@
#
# This is a list of local files which get copied to the mozilla:dist directory
#
nsISoftwareUpdate.h
nsSoftwareUpdateIIDs.h

View File

@@ -1,47 +0,0 @@
#!gmake
#
# 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 Mozilla Communicator client code,
# released March 31, 1998.
#
# 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.
#
# Contributors:
# Daniel Veditz <dveditz@netscape.com>
# Douglas Turner <dougt@netscape.com>
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = xpinstall
XPIDLSRCS = nsIXPInstallProgress.idl
EXPORTS = \
nsIDOMInstallTriggerGlobal.h \
nsIDOMInstallVersion.h \
nsSoftwareUpdateIIDs.h \
nsISoftwareUpdate.h \
$(NULL)
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk

View File

@@ -1,113 +0,0 @@
interface Install
{
/* IID: { 0x18c2f988, 0xb09f, 0x11d2, \
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}} */
const int BAD_PACKAGE_NAME = -200;
const int UNEXPECTED_ERROR = -201;
const int ACCESS_DENIED = -202;
const int TOO_MANY_CERTIFICATES = -203; /* Installer file must have 1 certificate */
const int NO_INSTALLER_CERTIFICATE = -204; /* Installer file must have a certificate */
const int NO_CERTIFICATE = -205; /* Extracted file is not signed */
const int NO_MATCHING_CERTIFICATE = -206; /* Extracted file does not match installer certificate */
const int UNKNOWN_JAR_FILE = -207; /* JAR file has not been opened */
const int INVALID_ARGUMENTS = -208; /* Bad arguments to a function */
const int ILLEGAL_RELATIVE_PATH = -209; /* Illegal relative path */
const int USER_CANCELLED = -210; /* User cancelled */
const int INSTALL_NOT_STARTED = -211;
const int SILENT_MODE_DENIED = -212;
const int NO_SUCH_COMPONENT = -213; /* no such component in the registry. */
const int FILE_DOES_NOT_EXIST = -214; /* File cannot be deleted as it does not exist */
const int FILE_READ_ONLY = -215; /* File cannot be deleted as it is read only. */
const int FILE_IS_DIRECTORY = -216; /* File cannot be deleted as it is a directory */
const int NETWORK_FILE_IS_IN_USE = -217; /* File on the network is in-use */
const int APPLE_SINGLE_ERR = -218; /* error in AppleSingle unpacking */
const int INVALID_PATH_ERR = -219; /* GetFolder() did not like the folderID */
const int PATCH_BAD_DIFF = -220; /* error in GDIFF patch */
const int PATCH_BAD_CHECKSUM_TARGET = -221; /* source file doesn't checksum */
const int PATCH_BAD_CHECKSUM_RESULT = -222; /* final patched file fails checksum */
const int UNINSTALL_FAILED = -223; /* error while uninstalling a package */
const int GESTALT_UNKNOWN_ERR = -5550;
const int GESTALT_INVALID_ARGUMENT = -5551;
const int SUCCESS = 0;
const int REBOOT_NEEDED = 999;
/* install types */
const int LIMITED_INSTALL = 0;
const int FULL_INSTALL = 1;
const int NO_STATUS_DLG = 2;
const int NO_FINALIZE_DLG = 4;
// these should not be public...
/* message IDs*/
const int SU_INSTALL_FILE_UNEXPECTED_MSG_ID = 0;
const int SU_DETAILS_REPLACE_FILE_MSG_ID = 1;
const int SU_DETAILS_INSTALL_FILE_MSG_ID = 2;
//////////////////////////
readonly attribute wstring UserPackageName;
readonly attribute wstring RegPackageName;
void Install();
void AbortInstall();
long AddDirectory( in wstring regName,
in wstring version,
in wstring jarSource,
in InstallFolder folder,
in wstring subdir,
in boolean forceMode );
long AddSubcomponent( in wstring regName,
in wstring version,
in wstring jarSource,
in InstallFolder folder,
in wstring targetName,
in boolean forceMode );
long DeleteComponent( in wstring registryName);
long DeleteFile( in InstallFolder folder,
in wstring relativeFileName );
long DiskSpaceAvailable( in InstallFolder folder );
long Execute(in wstring jarSource, in wstring args);
long FinalizeInstall();
long Gestalt (in wstring selector);
InstallFolder GetComponentFolder( in wstring regName,
in wstring subdirectory);
InstallFolder GetFolder(in wstring targetFolder,
in wstring subdirectory);
long GetLastError();
long GetWinProfile(in InstallFolder folder, in wstring file);
long GetWinRegistry();
long Patch( in wstring regName,
in wstring version,
in wstring jarSource,
in InstallFolder folder,
in wstring targetName );
void ResetError();
void SetPackageFolder( in InstallFolder folder );
long StartInstall( in wstring userPackageName,
in wstring packageName,
in wstring version,
in long flags );
long Uninstall( in wstring packageName);
};

View File

@@ -1,24 +0,0 @@
interface InstallTriggerGlobal
{
/* IID: { 0x18c2f987, 0xb09f, 0x11d2, \
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}} */
const int MAJOR_DIFF = 4;
const int MINOR_DIFF = 3;
const int REL_DIFF = 2;
const int BLD_DIFF = 1;
const int EQUAL = 0;
boolean UpdateEnabled ();
long StartSoftwareUpdate(in wstring URL);
long ConditionalSoftwareUpdate( in wstring URL,
in wstring regName,
in long diffLevel,
in wstring version,
in long mode);
long CompareVersion( in wstring regName, in wstring version );
};

View File

@@ -1,34 +0,0 @@
interface InstallVersion
{
/* IID: { 0x18c2f986, 0xb09f, 0x11d2, \
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}} */
const int EQUAL = 0;
const int BLD_DIFF = 1;
const int BLD_DIFF_MINUS = -1;
const int REL_DIFF = 2;
const int REL_DIFF_MINUS = -2;
const int MINOR_DIFF = 3;
const int MINOR_DIFF_MINUS = -3;
const int MAJOR_DIFF = 4;
const int MAJOR_DIFF_MINUS = -4;
attribute int major;
attribute int minor;
attribute int release;
attribute int build;
void InstallVersion();
void init(in wstring versionString);
/*
void init(in int major, in int minor, in int release, in int build);
*/
wstring toString();
/* int compareTo(in wstring version);
int compareTo(in int major, in int minor, in int release, in int build);
*/
int compareTo(in InstallVersion versionObject);
};

View File

@@ -1,36 +0,0 @@
#!nmake
#
# 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 Mozilla Communicator client code,
# released March 31, 1998.
#
# 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.
#
# Contributors:
# Daniel Veditz <dveditz@netscape.com>
# Douglas Turner <dougt@netscape.com>
MODULE=xpinstall
DEPTH=..\..
EXPORTS= nsIDOMInstallTriggerGlobal.h \
nsIDOMInstallVersion.h \
nsSoftwareUpdateIIDs.h \
nsISoftwareUpdate.h
XPIDLSRCS = .\nsIXPInstallProgress.idl
include <$(DEPTH)\config\config.mak>
include <$(DEPTH)\config\rules.mak>

View File

@@ -1 +0,0 @@
#error

View File

@@ -1,96 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/* AUTO-GENERATED. DO NOT EDIT!!! */
#ifndef nsIDOMInstallTriggerGlobal_h__
#define nsIDOMInstallTriggerGlobal_h__
#include "nsISupports.h"
#include "nsString.h"
#include "nsIScriptContext.h"
#define NS_IDOMINSTALLTRIGGERGLOBAL_IID \
{ 0x18c2f987, 0xb09f, 0x11d2, \
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}}
class nsIDOMInstallTriggerGlobal : public nsISupports {
public:
static const nsIID& IID() { static nsIID iid = NS_IDOMINSTALLTRIGGERGLOBAL_IID; return iid; }
enum {
MAJOR_DIFF = 4,
MINOR_DIFF = 3,
REL_DIFF = 2,
BLD_DIFF = 1,
EQUAL = 0
};
NS_IMETHOD UpdateEnabled(PRBool* aReturn)=0;
NS_IMETHOD StartSoftwareUpdate(const nsString& aURL, PRInt32* aReturn)=0;
NS_IMETHOD StartSoftwareUpdate(const nsString& aURL, PRInt32 aFlags, PRInt32* aReturn)=0;
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, PRInt32 aDiffLevel, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn)=0;
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, PRInt32 aDiffLevel, nsIDOMInstallVersion* aVersion, PRInt32 aMode, PRInt32* aReturn)=0;
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32 aMode, PRInt32* aReturn)=0;
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn)=0;
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, const nsString& aVersion, PRInt32* aReturn)=0;
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32* aReturn)=0;
NS_IMETHOD CompareVersion(const nsString& aRegName, PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn)=0;
NS_IMETHOD CompareVersion(const nsString& aRegName, const nsString& aVersion, PRInt32* aReturn)=0;
NS_IMETHOD CompareVersion(const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32* aReturn)=0;
};
#define NS_DECL_IDOMINSTALLTRIGGERGLOBAL \
NS_IMETHOD UpdateEnabled(PRBool* aReturn); \
NS_IMETHOD StartSoftwareUpdate(const nsString& aURL, PRInt32 aFlags, PRInt32* aReturn); \
NS_IMETHOD StartSoftwareUpdate(const nsString& aURL, PRInt32* aReturn); \
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, PRInt32 aDiffLevel, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn); \
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, PRInt32 aDiffLevel, nsIDOMInstallVersion* aVersion, PRInt32 aMode, PRInt32* aReturn); \
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32 aMode, PRInt32* aReturn); \
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn); \
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, const nsString& aVersion, PRInt32* aReturn); \
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32* aReturn); \
NS_IMETHOD CompareVersion(const nsString& aRegName, PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn); \
NS_IMETHOD CompareVersion(const nsString& aRegName, const nsString& aVersion, PRInt32* aReturn); \
NS_IMETHOD CompareVersion(const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32* aReturn); \
#define NS_FORWARD_IDOMINSTALLTRIGGERGLOBAL(_to) \
NS_IMETHOD UpdateEnabled(PRBool* aReturn) { return _to##UpdateEnabled(aReturn); } \
NS_IMETHOD StartSoftwareUpdate(const nsString& aURL, PRInt32 aFlags, PRInt32* aReturn) { return _to##StartSoftwareUpdate(aURL, aFlags, aReturn); } \
NS_IMETHOD StartSoftwareUpdate(const nsString& aURL, PRInt32* aReturn) { return _to##StartSoftwareUpdate(aURL, aReturn); } \
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, PRInt32 aDiffLevel, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn) { return _to##ConditionalSoftwareUpdate(aURL, aRegName, aDiffLevel, aVersion, aMode, aReturn); } \
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, PRInt32 aDiffLevel, nsIDOMInstallVersion* aVersion, PRInt32 aMode, PRInt32* aReturn) { return _to##ConditionalSoftwareUpdate(aURL, aRegName, aDiffLevel, aVersion, aMode, aReturn); } \
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, nsIDOMInstallVersion* aRegName, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn) { return _to##ConditionalSoftwareUpdate(aURL, aDiffLevel, aVersion, aMode, aReturn); } \
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn) { return _to##ConditionalSoftwareUpdate(aURL, aDiffLevel, aVersion, aMode, aReturn); } \
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, const nsString& aVersion, PRInt32* aReturn) { return _to##ConditionalSoftwareUpdate(aURL, aDiffLevel, aVersion, aReturn); } \
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32* aReturn) { return _to##ConditionalSoftwareUpdate(aURL, aDiffLevel, aVersion, aReturn); } \
NS_IMETHOD CompareVersion(const nsString& aRegName, PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn) { return _to##CompareVersion(aRegName, aMajor, aMinor, aRelease, aBuild, aReturn); } \
NS_IMETHOD CompareVersion(const nsString& aRegName, const nsString& aVersion, PRInt32* aReturn) { return _to##CompareVersion(aRegName, aVersion, aReturn); } \
NS_IMETHOD CompareVersion(const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32* aReturn) { return _to##CompareVersion(aRegName, aVersion, aReturn); } \
extern nsresult NS_InitInstallTriggerGlobalClass(nsIScriptContext *aContext, void **aPrototype);
extern "C" NS_DOM nsresult NS_NewScriptInstallTriggerGlobal(nsIScriptContext *aContext, nsISupports *aSupports, nsISupports *aParent, void **aReturn);
#endif // nsIDOMInstallTriggerGlobal_h__

View File

@@ -1,107 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/* AUTO-GENERATED. DO NOT EDIT!!! */
#ifndef nsIDOMInstallVersion_h__
#define nsIDOMInstallVersion_h__
#include "nsISupports.h"
#include "nsString.h"
#include "nsIScriptContext.h"
class nsIDOMInstallVersion;
#define NS_IDOMINSTALLVERSION_IID \
{ 0x18c2f986, 0xb09f, 0x11d2, \
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}}
class nsIDOMInstallVersion : public nsISupports {
public:
static const nsIID& IID() { static nsIID iid = NS_IDOMINSTALLVERSION_IID; return iid; }
enum {
EQUAL = 0,
BLD_DIFF = 1,
BLD_DIFF_MINUS = -1,
REL_DIFF = 2,
REL_DIFF_MINUS = -2,
MINOR_DIFF = 3,
MINOR_DIFF_MINUS = -3,
MAJOR_DIFF = 4,
MAJOR_DIFF_MINUS = -4
};
NS_IMETHOD GetMajor(PRInt32* aMajor)=0;
NS_IMETHOD SetMajor(PRInt32 aMajor)=0;
NS_IMETHOD GetMinor(PRInt32* aMinor)=0;
NS_IMETHOD SetMinor(PRInt32 aMinor)=0;
NS_IMETHOD GetRelease(PRInt32* aRelease)=0;
NS_IMETHOD SetRelease(PRInt32 aRelease)=0;
NS_IMETHOD GetBuild(PRInt32* aBuild)=0;
NS_IMETHOD SetBuild(PRInt32 aBuild)=0;
NS_IMETHOD Init(const nsString& aVersionString)=0;
NS_IMETHOD ToString(nsString& aReturn)=0;
NS_IMETHOD CompareTo(nsIDOMInstallVersion* aVersionObject, PRInt32* aReturn)=0;
NS_IMETHOD CompareTo(const nsString& aString, PRInt32* aReturn)=0;
NS_IMETHOD CompareTo(PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn)=0;
};
#define NS_DECL_IDOMINSTALLVERSION \
NS_IMETHOD GetMajor(PRInt32* aMajor); \
NS_IMETHOD SetMajor(PRInt32 aMajor); \
NS_IMETHOD GetMinor(PRInt32* aMinor); \
NS_IMETHOD SetMinor(PRInt32 aMinor); \
NS_IMETHOD GetRelease(PRInt32* aRelease); \
NS_IMETHOD SetRelease(PRInt32 aRelease); \
NS_IMETHOD GetBuild(PRInt32* aBuild); \
NS_IMETHOD SetBuild(PRInt32 aBuild); \
NS_IMETHOD Init(const nsString& aVersionString); \
NS_IMETHOD ToString(nsString& aReturn); \
NS_IMETHOD CompareTo(nsIDOMInstallVersion* aVersionObject, PRInt32* aReturn); \
NS_IMETHOD CompareTo(const nsString& aString, PRInt32* aReturn); \
NS_IMETHOD CompareTo(PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn); \
#define NS_FORWARD_IDOMINSTALLVERSION(_to) \
NS_IMETHOD GetMajor(PRInt32* aMajor) { return _to##GetMajor(aMajor); } \
NS_IMETHOD SetMajor(PRInt32 aMajor) { return _to##SetMajor(aMajor); } \
NS_IMETHOD GetMinor(PRInt32* aMinor) { return _to##GetMinor(aMinor); } \
NS_IMETHOD SetMinor(PRInt32 aMinor) { return _to##SetMinor(aMinor); } \
NS_IMETHOD GetRelease(PRInt32* aRelease) { return _to##GetRelease(aRelease); } \
NS_IMETHOD SetRelease(PRInt32 aRelease) { return _to##SetRelease(aRelease); } \
NS_IMETHOD GetBuild(PRInt32* aBuild) { return _to##GetBuild(aBuild); } \
NS_IMETHOD SetBuild(PRInt32 aBuild) { return _to##SetBuild(aBuild); } \
NS_IMETHOD Init(const nsString& aVersionString) { return _to##Init(aVersionString); } \
NS_IMETHOD ToString(nsString& aReturn) { return _to##ToString(aReturn); } \
NS_IMETHOD CompareTo(nsIDOMInstallVersion* aVersionObject, PRInt32* aReturn) { return _to##CompareTo(aVersionObject, aReturn); } \
NS_IMETHOD CompareTo(const nsString& aString, PRInt32* aReturn) { return _to##CompareTo(aString, aReturn); } \
NS_IMETHOD CompareTo(PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn) { return _to##CompareTo(aMajor, aMinor, aRelease, aBuild, aReturn); } \
extern nsresult NS_InitInstallVersionClass(nsIScriptContext *aContext, void **aPrototype);
extern "C" NS_DOM nsresult NS_NewScriptInstallVersion(nsIScriptContext *aContext, nsISupports *aSupports, nsISupports *aParent, void **aReturn);
#endif // nsIDOMInstallVersion_h__

View File

@@ -1,85 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* 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 Mozilla Communicator client code,
* released March 31, 1998.
*
* 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.
*
* Contributors:
* Daniel Veditz <dveditz@netscape.com>
* Douglas Turner <dougt@netscape.com>
*/
#ifndef nsISoftwareUpdate_h__
#define nsISoftwareUpdate_h__
#include "nsISupports.h"
#include "nsIFactory.h"
#include "nsString.h"
#include "nsIXPInstallProgress.h"
#define NS_IXPINSTALLCOMPONENT_PROGID NS_IAPPSHELLCOMPONENT_PROGID "/xpinstall"
#define NS_IXPINSTALLCOMPONENT_CLASSNAME "Mozilla XPInstall Component"
#define NS_ISOFTWAREUPDATE_IID \
{ 0x18c2f992, \
0xb09f, \
0x11d2, \
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}\
}
class nsISoftwareUpdate : public nsISupports
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISOFTWAREUPDATE_IID)
NS_IMETHOD InstallJar(const nsString& fromURL,
const nsString& localFile,
long flags) = 0;
NS_IMETHOD RegisterNotifier(nsIXPInstallProgress *notifier) = 0;
NS_IMETHOD InstallPending(void) = 0;
/* FIX: these should be in a private interface */
NS_IMETHOD InstallJarCallBack() = 0;
NS_IMETHOD GetTopLevelNotifier(nsIXPInstallProgress **notifier) = 0;
};
class nsSoftwareUpdateFactory : public nsIFactory
{
public:
nsSoftwareUpdateFactory();
virtual ~nsSoftwareUpdateFactory();
NS_DECL_ISUPPORTS
NS_IMETHOD CreateInstance(nsISupports *aOuter,
REFNSIID aIID,
void **aResult);
NS_IMETHOD LockFactory(PRBool aLock);
};
#endif // nsISoftwareUpdate_h__

View File

@@ -1,30 +0,0 @@
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsISupports.idl"
[uuid(eea90d40-b059-11d2-915e-c12b696c9333)]
interface nsIXPInstallProgress : nsISupports
{
void BeforeJavascriptEvaluation();
void AfterJavascriptEvaluation();
void InstallStarted([const] in string UIPackageName);
void ItemScheduled([const] in string message );
void InstallFinalization([const] in string message, in long itemNum, in long totNum );
void InstallAborted();
};

View File

@@ -1,93 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* 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 Mozilla Communicator client code,
* released March 31, 1998.
*
* 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.
*
* Contributors:
* Douglas Turner <dougt@netscape.com>
*/
#ifndef nsIXPInstallProgressNotifier_h__
#define nsIXPInstallProgressNotifier_h__
class nsIXPInstallProgressNotifier
{
public:
///////////////////////////////////////////////////////////////////////////////////////////////////////
// Function name : BeforeJavascriptEvaluation
// Description : This will be called when prior to the install script being evaluate
// Return type : void
// Argument : void
///////////////////////////////////////////////////////////////////////////////////////////////////////
virtual void BeforeJavascriptEvaluation(void) = 0;
///////////////////////////////////////////////////////////////////////////////////////////////////////
// Function name : AfterJavascriptEvaluation
// Description : This will be called after the install script has being evaluated
// Return type : void
// Argument : void
///////////////////////////////////////////////////////////////////////////////////////////////////////
virtual void AfterJavascriptEvaluation(void) = 0;
///////////////////////////////////////////////////////////////////////////////////////////////////////
// Function name : InstallStarted
// Description : This will be called when StartInstall has been called
// Return type : void
// Argument : char* UIPackageName - User Package Name
///////////////////////////////////////////////////////////////////////////////////////////////////////
virtual void InstallStarted(const char* UIPackageName) = 0;
///////////////////////////////////////////////////////////////////////////////////////////////////////
// Function name : ItemScheduled
// Description : This will be called when items are being scheduled
// Return type : Any value returned other than zero, will be treated as an error and the script will be aborted
// Argument : The message that should be displayed to the user
///////////////////////////////////////////////////////////////////////////////////////////////////////
virtual long ItemScheduled( const char* message ) = 0;
///////////////////////////////////////////////////////////////////////////////////////////////////////
// Function name : InstallFinalization
// Description : This will be called when the installation is in its Finalize stage
// Return type : void
// Argument : char* message - The message that should be displayed to the user
// Argument : long itemNum - This is the current item number
// Argument : long totNum - This is the total number of items
///////////////////////////////////////////////////////////////////////////////////////////////////////
virtual void InstallFinalization( const char* message, long itemNum, long totNum ) = 0;
///////////////////////////////////////////////////////////////////////////////////////////////////////
// Function name : InstallAborted
// Description : This will be called when the install is aborted
// Return type : void
// Argument : void
///////////////////////////////////////////////////////////////////////////////////////////////////////
virtual void InstallAborted(void) = 0;
};
#endif

View File

@@ -1,64 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* 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 Mozilla Communicator client code,
* released March 31, 1998.
*
* 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.
*
* Contributors:
* Daniel Veditz <dveditz@netscape.com>
* Douglas Turner <dougt@netscape.com>
*/
#ifndef nsSoftwareUpdateIIDs_h___
#define nsSoftwareUpdateIIDs_h___
#define NS_SoftwareUpdate_CID \
{ /* 18c2f989-b09f-11d2-bcde-00805f0e1353 */ \
0x18c2f989, \
0xb09f, \
0x11d2, \
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53} \
}
#define NS_SoftwareUpdateInstall_CID \
{ /* 18c2f98b-b09f-11d2-bcde-00805f0e1353 */ \
0x18c2f98b, \
0xb09f, \
0x11d2, \
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53} \
}
#define NS_SoftwareUpdateInstallTrigger_CID \
{ /* 18c2f98d-b09f-11d2-bcde-00805f0e1353 */ \
0x18c2f98d, \
0xb09f, \
0x11d2, \
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53} \
}
#define NS_SoftwareUpdateInstallVersion_CID \
{ /* 18c2f98f-b09f-11d2-bcde-00805f0e1353 */ \
0x18c2f98f, \
0xb09f, \
0x11d2, \
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53} \
}
#endif /* nsSoftwareUpdateIIDs_h___ */

View File

@@ -1,3 +0,0 @@
progress.xul
progress.css
progress.html

View File

@@ -1,34 +0,0 @@
#!gmake
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
DEPTH=../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk
EXPORT_RESOURCE_XPINSTALL = \
$(srcdir)/progress.xul \
$(srcdir)/progress.html \
$(srcdir)/progress.css \
$(NULL)
install::
$(INSTALL) $(EXPORT_RESOURCE_XPINSTALL) $(DIST)/bin/res/xpinstall

View File

@@ -1,31 +0,0 @@
#!nmake
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
DEPTH=..\..
IGNORE_MANIFEST=1
include <$(DEPTH)\config\rules.mak>
install:: $(DLL)
$(MAKE_INSTALL) progress.xul $(DIST)\bin\res\xpinstall
$(MAKE_INSTALL) progress.css $(DIST)\bin\res\xpinstall
$(MAKE_INSTALL) progress.html $(DIST)\bin\res\xpinstall
clobber::
rm -f $(DIST)\res\xpinstall\progress.xul
rm -f $(DIST)\res\xpinstall\progress.css
rm -f $(DIST)\res\xpinstall\progress.html

View File

@@ -1,3 +0,0 @@
TD {
font: 10pt sans-serif;
}

View File

@@ -1,16 +0,0 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<body bgcolor="#C0C0C0" style="overflow:visible; margin: 0px; color-background: rgb(192,192,192);">
<center>
<table BORDER COLS=5 WIDTH="99%" style="color-background:rgb(192,192,192);">
<tr>
<td WIDTH="3%" NOWRAP style="border: 1px inset rgb(192,192,192);">&nbsp</td>
<td WIDTH="3%" NOWRAP style="border: 1px inset rgb(192,192,192);">&nbsp</td>
<td WIDTH="3%" NOWRAP style="border: 1px inset rgb(192,192,192);">&nbsp</td>
<td WIDTH="10%" NOWRAP style="border: 1px inset rgb(192,192,192);">&nbsp</td>
<td WIDTH="81%" NOWRAP style="border: 1px inset rgb(192,192,192);">&nbsp</td>
</tr>
</table>
</center>
</body>
</html>

View File

@@ -1,67 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="../samples/xul.css" type="text/css"?>
<?xml-stylesheet href="progress.css" type="text/css"?>
<!DOCTYPE window
[
<!ENTITY downloadWindow.title "XPInstall Progress">
<!ENTITY status "Status:">
<!ENTITY cancelButtonTitle "Cancel">
]
>
<window xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="XPInstall Progress"
width="425"
height="225">
<data>
<broadcaster id="data.canceled" type="string" value="false"/>
</data>
<html:script>
function cancelInstall()
{
var cancelData = document.getElementById("data.canceled");
cancelData.setAttribute( "value", "true");
}
</html:script>
<html:center>
<html:table style="width:100%;">
<html:tr>
<html:td align="center">
<html:input id="dialog.uiPackageName" readonly="" style="background-color:lightgray;width:300px;"/>
</html:td>
</html:tr>
<html:tr>
<html:td nowrap="" style="border: 1px rgb(192,192,192);" align="center">
<html:input id="dialog.currentAction" readonly="" style="background-color:lightgray;width:450px;"/>
</html:td>
</html:tr>
<html:tr>
<html:td align="center" width="15%" nowrap="" style="border: 1px rgb(192,192,192);">
<progressmeter id="dialog.progress" mode="undetermined" style="width:300px;height:16px;">
</progressmeter>
</html:td>
</html:tr>
<html:tr>
<html:td align="center" width="3%" nowrap="" style="border: 1px rgb(192,192,192);">
<html:button onclick="cancelInstall()" height="12">
&cancelButtonTitle;
</html:button>
</html:td>
</html:tr>
</html:table>
</html:center>
</window>

View File

@@ -1,61 +0,0 @@
#!gmake
#
# 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 Mozilla Communicator client code,
# released March 31, 1998.
#
# 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.
#
# Contributors:
# Daniel Veditz <dveditz@netscape.com>
# Douglas Turner <dougt@netscape.com>
DEPTH = ../..
topsrcdir = @top_srcdir@
VPATH = @srcdir@
srcdir = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = xpinstall
LIBRARY_NAME = xpinstall
IS_COMPONENT = 1
REQUIRES = dom js netlib raptor xpcom
CPPSRCS = \
nsSoftwareUpdate.cpp \
nsInstall.cpp \
nsInstallDelete.cpp \
nsInstallExecute.cpp \
nsInstallFile.cpp \
nsInstallFolder.cpp \
nsInstallPatch.cpp \
nsInstallUninstall.cpp \
nsInstallTrigger.cpp \
nsInstallResources.cpp \
nsJSInstall.cpp \
nsJSInstallTriggerGlobal.cpp\
nsSoftwareUpdateRun.cpp \
nsSoftwareUpdateStream.cpp \
nsTopProgressNotifier.cpp \
nsLoggingProgressNotifier \
ScheduledTasks.cpp \
nsInstallFileOpItem.cpp \
$(NULL)
INCLUDES += -I$(srcdir)/../public
include $(topsrcdir)/config/rules.mk

File diff suppressed because it is too large Load Diff

View File

@@ -1,233 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* 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 Mozilla Communicator client code,
* released March 31, 1998.
*
* 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.
*
* Contributors:
* Douglas Turner <dougt@netscape.com>
*/
#ifndef SU_PAS_H
#define SU_PAS_H
#include <Errors.h>
#include <Types.h>
#include <Files.h>
#include <Script.h>
#include <Resources.h>
typedef struct PASHeader /* header portion of Patchable AppleSingle */
{
UInt32 magicNum; /* internal file type tag = 0x00244200*/
UInt32 versionNum; /* format version: 1 = 0x00010000 */
UInt8 filler[16]; /* filler */
UInt16 numEntries; /* number of entries which follow */
} PASHeader ;
typedef struct PASEntry /* one Patchable AppleSingle entry descriptor */
{
UInt32 entryID; /* entry type: see list, 0 invalid */
UInt32 entryOffset; /* offset, in bytes, from beginning */
/* of file to this entry's data */
UInt32 entryLength; /* length of data in octets */
} PASEntry;
typedef struct PASMiscInfo
{
short fileHasResFork;
short fileResAttrs;
OSType fileType;
OSType fileCreator;
UInt32 fileFlags;
} PASMiscInfo;
typedef struct PASResFork
{
short NumberOfTypes;
} PASResFork;
typedef struct PASResource
{
short attr;
short attrID;
OSType attrType;
Str255 attrName;
unsigned long length;
} PASResource;
#if PRAGMA_ALIGN_SUPPORTED
#pragma options align=reset
#endif
#define kCreator 'MOSS'
#define kType 'PASf'
#define PAS_BUFFER_SIZE (1024*512)
#define PAS_MAGIC_NUM (0x00244200)
#define PAS_VERSION (0x00010000)
enum
{
ePas_Data = 1,
ePas_Misc,
ePas_Resource
};
#ifdef __cplusplus
extern "C" {
#endif
/* Prototypes */
OSErr PAS_EncodeFile(FSSpec *inSpec, FSSpec *outSpec);
OSErr PAS_DecodeFile(FSSpec *inSpec, FSSpec *outSpec);
#ifdef __cplusplus
}
#endif
#endif /* SU_PAS_H */

View File

@@ -1,380 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* 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 Mozilla Communicator client code,
* released March 31, 1998.
*
* 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.
*
* Contributors:
* Daniel Veditz <dveditz@netscape.com>
* Douglas Turner <dougt@netscape.com>
*/
#include "nscore.h"
#include "NSReg.h"
#include "nsFileSpec.h"
#include "nsFileStream.h"
#include "nsInstall.h" // for error codes
#include "prmem.h"
#include "ScheduledTasks.h"
#ifdef _WINDOWS
#include <sys/stat.h>
#include <windows.h>
BOOL WIN32_IsMoveFileExBroken()
{
/* the NT option MOVEFILE_DELAY_UNTIL_REBOOT is broken on
* Windows NT 3.51 Service Pack 4 and NT 4.0 before Service Pack 2
*/
BOOL broken = FALSE;
OSVERSIONINFO osinfo;
// they *all* appear broken--better to have one way that works.
return TRUE;
osinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if (GetVersionEx(&osinfo) && osinfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
{
if ( osinfo.dwMajorVersion == 3 && osinfo.dwMinorVersion == 51 )
{
if ( 0 == stricmp(osinfo.szCSDVersion,"Service Pack 4"))
{
broken = TRUE;
}
}
else if ( osinfo.dwMajorVersion == 4 )
{
if (osinfo.szCSDVersion[0] == '\0' ||
(0 == stricmp(osinfo.szCSDVersion,"Service Pack 1")))
{
broken = TRUE;
}
}
}
return broken;
}
PRInt32 DoWindowsReplaceExistingFileStuff(const char* currentName, const char* finalName)
{
PRInt32 err = 0;
char* final = strdup(finalName);
char* current = strdup(currentName);
/* couldn't delete, probably in use. Schedule for later */
DWORD dwVersion, dwWindowsMajorVersion;
/* Get OS version info */
dwVersion = GetVersion();
dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
/* Get build numbers for Windows NT or Win32s */
if (dwVersion < 0x80000000) // Windows NT
{
/* On Windows NT */
if ( WIN32_IsMoveFileExBroken() )
{
/* the MOVEFILE_DELAY_UNTIL_REBOOT option doesn't work on
* NT 3.51 SP4 or on NT 4.0 until SP2
*/
struct stat statbuf;
PRBool nameFound = PR_FALSE;
char tmpname[_MAX_PATH];
strncpy( tmpname, finalName, _MAX_PATH );
int len = strlen(tmpname);
while (!nameFound && len < _MAX_PATH )
{
tmpname[len-1] = '~';
tmpname[len] = '\0';
if ( stat(tmpname, &statbuf) != 0 )
nameFound = TRUE;
else
len++;
}
if ( nameFound )
{
if ( MoveFile( finalName, tmpname ) )
{
if ( MoveFile( currentName, finalName ) )
{
DeleteFileNowOrSchedule(nsFileSpec(tmpname));
}
else
{
/* 2nd move failed, put old file back */
MoveFile( tmpname, finalName );
}
}
else
{
/* non-executable in use; schedule for later */
return -1; // let the start registry stuff do our work!
}
}
}
else if ( MoveFileEx(currentName, finalName, MOVEFILE_DELAY_UNTIL_REBOOT) )
{
err = 0;
}
}
else // Windows 95 or Win16
{
/*
* Place an entry in the WININIT.INI file in the Windows directory
* to delete finalName and rename currentName to be finalName at reboot
*/
int strlen;
char Src[_MAX_PATH]; // 8.3 name
char Dest[_MAX_PATH]; // 8.3 name
strlen = GetShortPathName( (LPCTSTR)currentName, (LPTSTR)Src, (DWORD)sizeof(Src) );
if ( strlen > 0 )
{
free(current);
current = strdup(Src);
}
strlen = GetShortPathName( (LPCTSTR) finalName, (LPTSTR) Dest, (DWORD) sizeof(Dest));
if ( strlen > 0 )
{
free(final);
final = strdup(Dest);
}
/* NOTE: use OEM filenames! Even though it looks like a Windows
* .INI file, WININIT.INI is processed under DOS
*/
AnsiToOem( final, final );
AnsiToOem( current, current );
if ( WritePrivateProfileString( "Rename", final, current, "WININIT.INI" ) )
err = 0;
}
free(final);
free(current);
return err;
}
#endif
REGERR DeleteFileNowOrSchedule(nsFileSpec& filename)
{
REGERR result = 0;
filename.Delete(false);
if (filename.Exists())
{
RKEY newkey;
HREG reg;
if ( REGERR_OK == NR_RegOpen("", &reg) )
{
if (REGERR_OK == NR_RegAddKey( reg, ROOTKEY_PRIVATE, REG_DELETE_LIST_KEY, &newkey) )
{
// FIX should be using nsPersistentFileDescriptor!!!
result = NR_RegSetEntry( reg, newkey, (char*)(const char*)filename.GetNativePathCString(), REGTYPE_ENTRY_FILE, nsnull, 0);
if (result == REGERR_OK)
result = nsInstall::REBOOT_NEEDED;
}
NR_RegClose(reg);
}
}
return result;
}
/* tmp file is the bad one that we want to replace with target. */
REGERR ReplaceFileNowOrSchedule(nsFileSpec& replacementFile, nsFileSpec& doomedFile )
{
REGERR result = 0;
if(replacementFile == doomedFile)
{
/* do not have to do anything */
return result;
}
doomedFile.Delete(false);
if (! doomedFile.Exists() )
{
// Now that we have move the existing file, we can move the mExtracedFile into place.
nsFileSpec parentofFinalFile;
doomedFile.GetParent(parentofFinalFile);
result = replacementFile.Move(parentofFinalFile);
if ( NS_SUCCEEDED(result) )
{
char* leafName = doomedFile.GetLeafName();
replacementFile.Rename(leafName);
nsCRT::free(leafName);
}
}
else
{
#ifdef _WINDOWS
if (DoWindowsReplaceExistingFileStuff(replacementFile.GetNativePathCString(), doomedFile.GetNativePathCString()) == 0)
return 0;
#endif
RKEY newkey;
HREG reg;
if ( REGERR_OK == NR_RegOpen("", &reg) )
{
result = NR_RegAddKey( reg, ROOTKEY_PRIVATE, REG_REPLACE_LIST_KEY, &newkey);
if ( result == REGERR_OK )
{
char* replacementFileName = (char*)(const char*)replacementFile.GetNativePathCString();
result = NR_RegSetEntry( reg, newkey, (char*)(const char*)doomedFile.GetNativePathCString(), REGTYPE_ENTRY_FILE, replacementFileName, strlen(replacementFileName));
if (result == REGERR_OK)
result = nsInstall::REBOOT_NEEDED;
}
NR_RegClose(reg);
}
}
return result;
}
void DeleteScheduledFiles(void);
void ReplaceScheduledFiles(void);
extern "C" void PerformScheduledTasks(void *data)
{
DeleteScheduledFiles();
ReplaceScheduledFiles();
}
void DeleteScheduledFiles(void)
{
HREG reg;
if (REGERR_OK == NR_RegOpen("", &reg))
{
RKEY key;
REGENUM state;
/* perform scheduled file deletions and replacements (PC only) */
if (REGERR_OK == NR_RegGetKey(reg, ROOTKEY_PRIVATE, REG_DELETE_LIST_KEY,&key))
{
char buf[MAXREGNAMELEN];
while (REGERR_OK == NR_RegEnumEntries(reg, key, &state, buf, sizeof(buf), NULL ))
{
nsFileSpec doomedFile(buf);
doomedFile.Delete(PR_FALSE);
if (! doomedFile.Exists())
{
NR_RegDeleteEntry( reg, key, buf );
}
}
/* delete list node if empty */
if (REGERR_NOMORE == NR_RegEnumEntries( reg, key, &state, buf, sizeof(buf), NULL ))
{
NR_RegDeleteKey(reg, ROOTKEY_PRIVATE, REG_DELETE_LIST_KEY);
}
}
NR_RegClose(reg);
}
}
void ReplaceScheduledFiles(void)
{
HREG reg;
if (REGERR_OK == NR_RegOpen("", &reg))
{
RKEY key;
REGENUM state;
/* replace files if any listed */
if (REGERR_OK == NR_RegGetKey(reg, ROOTKEY_PRIVATE, REG_REPLACE_LIST_KEY, &key))
{
char tmpfile[MAXREGNAMELEN];
char target[MAXREGNAMELEN];
state = 0;
while (REGERR_OK == NR_RegEnumEntries(reg, key, &state, tmpfile, sizeof(tmpfile), NULL ))
{
nsFileSpec replaceFile(tmpfile);
if (! replaceFile.Exists() )
{
NR_RegDeleteEntry( reg, key, tmpfile );
}
else if ( REGERR_OK != NR_RegGetEntryString( reg, key, tmpfile, target, sizeof(target) ) )
{
/* can't read target filename, corruption? */
NR_RegDeleteEntry( reg, key, tmpfile );
}
else
{
nsFileSpec targetFile(target);
targetFile.Delete(PR_FALSE);
if (!targetFile.Exists())
{
nsFileSpec parentofTarget;
targetFile.GetParent(parentofTarget);
nsresult result = replaceFile.Move(parentofTarget);
if ( NS_SUCCEEDED(result) )
{
char* leafName = targetFile.GetLeafName();
replaceFile.Rename(leafName);
nsCRT::free(leafName);
NR_RegDeleteEntry( reg, key, tmpfile );
}
}
}
}
/* delete list node if empty */
if (REGERR_NOMORE == NR_RegEnumEntries(reg, key, &state, tmpfile, sizeof(tmpfile), NULL ))
{
NR_RegDeleteKey(reg, ROOTKEY_PRIVATE, REG_REPLACE_LIST_KEY);
}
}
NR_RegClose(reg);
}
}

View File

@@ -1,42 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* 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 Mozilla Communicator client code,
* released March 31, 1998.
*
* 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.
*
* Contributors:
* Daniel Veditz <dveditz@netscape.com>
* Douglas Turner <dougt@netscape.com>
*/
#ifndef __SCHEDULEDTASKS_H__
#define __SCHEDULEDTASKS_H__
#include "NSReg.h"
#include "nsFileSpec.h"
REGERR DeleteFileNowOrSchedule(nsFileSpec& filename);
REGERR ReplaceFileNowOrSchedule(nsFileSpec& tmpfile, nsFileSpec& target );
extern "C" void PerformScheduledTasks(void *data);
#endif

View File

@@ -1,135 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*--------------------------------------------------------------
* GDIFF.H
*
* Constants used in processing the GDIFF format
*--------------------------------------------------------------*/
#include "prio.h"
#include "nsFileSpec.h"
#define GDIFF_MAGIC "\xD1\xFF\xD1\xFF"
#define GDIFF_MAGIC_LEN 4
#define GDIFF_VER 5
#define GDIFF_EOF "\0"
#define GDIFF_VER_POS 4
#define GDIFF_CS_POS 5
#define GDIFF_CSLEN_POS 6
#define GDIFF_HEADERSIZE 7
#define GDIFF_APPDATALEN 4
#define GDIFF_CS_NONE 0
#define GDIFF_CS_MD5 1
#define GDIFF_CS_SHA 2
#define GDIFF_CS_CRC32 32
#define CRC32_LEN 4
/*--------------------------------------
* GDIFF opcodes
*------------------------------------*/
#define ENDDIFF 0
#define ADD8MAX 246
#define ADD16 247
#define ADD32 248
#define COPY16BYTE 249
#define COPY16SHORT 250
#define COPY16LONG 251
#define COPY32BYTE 252
#define COPY32SHORT 253
#define COPY32LONG 254
#define COPY64 255
/* instruction sizes */
#define ADD16SIZE 2
#define ADD32SIZE 4
#define COPY16BYTESIZE 3
#define COPY16SHORTSIZE 4
#define COPY16LONGSIZE 6
#define COPY32BYTESIZE 5
#define COPY32SHORTSIZE 6
#define COPY32LONGSIZE 8
#define COPY64SIZE 12
/*--------------------------------------
* error codes
*------------------------------------*/
#define GDIFF_OK 0
#define GDIFF_ERR_UNKNOWN -1
#define GDIFF_ERR_ARGS -2
#define GDIFF_ERR_ACCESS -3
#define GDIFF_ERR_MEM -4
#define GDIFF_ERR_HEADER -5
#define GDIFF_ERR_BADDIFF -6
#define GDIFF_ERR_OPCODE -7
#define GDIFF_ERR_OLDFILE -8
#define GDIFF_ERR_CHKSUMTYPE -9
#define GDIFF_ERR_CHECKSUM -10
#define GDIFF_ERR_CHECKSUM_TARGET -11
#define GDIFF_ERR_CHECKSUM_RESULT -12
/*--------------------------------------
* types
*------------------------------------*/
#ifndef AIX
#ifdef OSF1
#include <sys/types.h>
#else
typedef unsigned char uchar;
#endif
#endif
typedef struct _diffdata {
PRFileDesc* fSrc;
PRFileDesc* fOut;
PRFileDesc* fDiff;
uint8 checksumType;
uint8 checksumLength;
uchar* oldChecksum;
uchar* newChecksum;
PRBool bMacAppleSingle;
PRBool bWin32BoundImage;
uchar* databuf;
uint32 bufsize;
} DIFFDATA;
typedef DIFFDATA* pDIFFDATA;
/*--------------------------------------
* miscellaneous
*------------------------------------*/
#define APPFLAG_W32BOUND "autoinstall:Win32PE"
#define APPFLAG_APPLESINGLE "autoinstall:AppleSingle"
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif

View File

@@ -1,111 +0,0 @@
#!nmake
#
# 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 Mozilla Communicator client code,
# released March 31, 1998.
#
# 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.
#
# Contributors:
# Daniel Veditz <dveditz@netscape.com>
# Douglas Turner <dougt@netscape.com>
DEPTH=..\..
IGNORE_MANIFEST=1
MAKE_OBJ_TYPE = DLL
MODULE=xpinstall
DLL=.\$(OBJDIR)\$(MODULE).dll
DEFINES=-D_IMPL_NS_DOM -DWIN32_LEAN_AND_MEAN
LCFLAGS = \
$(LCFLAGS) \
$(DEFINES) \
$(NULL)
LINCS= \
-I$(PUBLIC)\xpinstall \
-I$(PUBLIC)\jar \
-I$(PUBLIC)\libreg \
-I$(PUBLIC)\netlib \
-I$(PUBLIC)\xpcom \
-I$(PUBLIC)\pref \
-I$(PUBLIC)\rdf \
-I$(PUBLIC)\js \
-I$(PUBLIC)\dom \
-I$(PUBLIC)\raptor \
-I$(PUBLIC)\nspr2 \
-I$(PUBLIC)\zlib \
-I$(PUBLIC)\xpfe\components \
$(NULL)
LLIBS = \
$(DIST)\lib\jar50.lib \
$(DIST)\lib\libreg32.lib \
$(DIST)\lib\netlib.lib \
$(DIST)\lib\xpcom.lib \
$(DIST)\lib\js3250.lib \
$(DIST)\lib\jsdombase_s.lib \
$(DIST)\lib\jsdomevents_s.lib \
$(DIST)\lib\zlib.lib \
$(DIST)\lib\plc3.lib \
$(LIBNSPR) \
$(NULL)
OBJS = \
.\$(OBJDIR)\nsInstall.obj \
.\$(OBJDIR)\nsInstallTrigger.obj \
.\$(OBJDIR)\nsInstallVersion.obj \
.\$(OBJDIR)\nsInstallFolder.obj \
.\$(OBJDIR)\nsJSInstall.obj \
.\$(OBJDIR)\nsJSInstallTriggerGlobal.obj \
.\$(OBJDIR)\nsJSInstallVersion.obj \
.\$(OBJDIR)\nsSoftwareUpdate.obj \
.\$(OBJDIR)\nsSoftwareUpdateRun.obj \
.\$(OBJDIR)\nsSoftwareUpdateStream.obj \
.\$(OBJDIR)\nsInstallFile.obj \
.\$(OBJDIR)\nsInstallDelete.obj \
.\$(OBJDIR)\nsInstallExecute.obj \
.\$(OBJDIR)\nsInstallPatch.obj \
.\$(OBJDIR)\nsInstallUninstall.obj \
.\$(OBJDIR)\nsInstallResources.obj \
.\$(OBJDIR)\nsTopProgressNotifier.obj \
.\$(OBJDIR)\nsLoggingProgressNotifier.obj\
.\$(OBJDIR)\ScheduledTasks.obj \
.\$(OBJDIR)\nsWinReg.obj \
.\$(OBJDIR)\nsJSWinReg.obj \
.\$(OBJDIR)\nsWinRegItem.obj \
.\$(OBJDIR)\nsWinRegValue.obj \
.\$(OBJDIR)\nsWinProfile.obj \
.\$(OBJDIR)\nsJSWinProfile.obj \
.\$(OBJDIR)\nsWinProfileItem.obj \
.\$(OBJDIR)\nsInstallProgressDialog.obj \
.\$(OBJDIR)\nsInstallFileOpItem.obj \
$(NULL)
include <$(DEPTH)\config\rules.mak>
install:: $(DLL)
$(MAKE_INSTALL) .\$(OBJDIR)\$(MODULE).lib $(DIST)\lib
$(MAKE_INSTALL) .\$(OBJDIR)\$(MODULE).dll $(DIST)\bin\components
clobber::
rm -f $(DIST)\lib\$(MODULE).lib
rm -f $(DIST)\bin\components\$(MODULE).dll

File diff suppressed because it is too large Load Diff

View File

@@ -1,265 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* 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 Mozilla Communicator client code,
* released March 31, 1998.
*
* 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.
*
* Contributors:
* Daniel Veditz <dveditz@netscape.com>
* Douglas Turner <dougt@netscape.com>
*/
#ifndef __NS_INSTALL_H__
#define __NS_INSTALL_H__
#include "nscore.h"
#include "nsISupports.h"
#include "jsapi.h"
#include "plevent.h"
#include "nsString.h"
#include "nsFileSpec.h"
#include "nsVector.h"
#include "nsHashtable.h"
#include "nsSoftwareUpdate.h"
#include "nsInstallObject.h"
#include "nsInstallVersion.h"
#include "nsIXPInstallProgress.h"
class nsInstallInfo
{
public:
nsInstallInfo(const nsString& fromURL, const nsString& localFile, long flags);
nsInstallInfo(nsVector* fromURL, nsVector* localFiles, long flags);
virtual ~nsInstallInfo();
nsString& GetFromURL(PRUint32 index = 0);
nsString& GetLocalFile(PRUint32 index = 0);
void GetArguments(nsString& args, PRUint32 index = 0);
long GetFlags();
PRBool IsMultipleTrigger();
static void DeleteVector(nsVector* vector);
private:
PRBool mMultipleTrigger;
nsresult mError;
long mFlags;
nsVector *mFromURLs;
nsVector *mLocalFiles;
};
class nsInstall
{
friend class nsWinReg;
friend class nsWinProfile;
public:
enum
{
BAD_PACKAGE_NAME = -200,
UNEXPECTED_ERROR = -201,
ACCESS_DENIED = -202,
TOO_MANY_CERTIFICATES = -203,
NO_INSTALLER_CERTIFICATE = -204,
NO_CERTIFICATE = -205,
NO_MATCHING_CERTIFICATE = -206,
UNKNOWN_JAR_FILE = -207,
INVALID_ARGUMENTS = -208,
ILLEGAL_RELATIVE_PATH = -209,
USER_CANCELLED = -210,
INSTALL_NOT_STARTED = -211,
SILENT_MODE_DENIED = -212,
NO_SUCH_COMPONENT = -213,
FILE_DOES_NOT_EXIST = -214,
FILE_READ_ONLY = -215,
FILE_IS_DIRECTORY = -216,
NETWORK_FILE_IS_IN_USE = -217,
APPLE_SINGLE_ERR = -218,
INVALID_PATH_ERR = -219,
PATCH_BAD_DIFF = -220,
PATCH_BAD_CHECKSUM_TARGET = -221,
PATCH_BAD_CHECKSUM_RESULT = -222,
UNINSTALL_FAILED = -223,
GESTALT_UNKNOWN_ERR = -5550,
GESTALT_INVALID_ARGUMENT = -5551,
SUCCESS = 0,
REBOOT_NEEDED = 999,
LIMITED_INSTALL = 0,
FULL_INSTALL = 1,
NO_STATUS_DLG = 2,
NO_FINALIZE_DLG = 4,
INSTALL_FILE_UNEXPECTED_MSG_ID = 0,
DETAILS_REPLACE_FILE_MSG_ID = 1,
DETAILS_INSTALL_FILE_MSG_ID = 2
};
nsInstall();
virtual ~nsInstall();
PRInt32 SetScriptObject(void* aScriptObject);
PRInt32 SaveWinRegPrototype(void* aScriptObject);
PRInt32 SaveWinProfilePrototype(void* aScriptObject);
JSObject* RetrieveWinRegPrototype(void);
JSObject* RetrieveWinProfilePrototype(void);
PRInt32 GetUserPackageName(nsString& aUserPackageName);
PRInt32 GetRegPackageName(nsString& aRegPackageName);
PRInt32 AbortInstall();
PRInt32 AddDirectory(const nsString& aRegName, const nsString& aVersion, const nsString& aJarSource, const nsString& aFolder, const nsString& aSubdir, PRBool aForceMode, PRInt32* aReturn);
PRInt32 AddDirectory(const nsString& aRegName, const nsString& aVersion, const nsString& aJarSource, const nsString& aFolder, const nsString& aSubdir, PRInt32* aReturn);
PRInt32 AddDirectory(const nsString& aRegName, const nsString& aJarSource, const nsString& aFolder, const nsString& aSubdir, PRInt32* aReturn);
PRInt32 AddDirectory(const nsString& aJarSource, PRInt32* aReturn);
PRInt32 AddSubcomponent(const nsString& aRegName, const nsString& aVersion, const nsString& aJarSource, const nsString& aFolder, const nsString& aTargetName, PRBool aForceMode, PRInt32* aReturn);
PRInt32 AddSubcomponent(const nsString& aRegName, const nsString& aVersion, const nsString& aJarSource, const nsString& aFolder, const nsString& aTargetName, PRInt32* aReturn);
PRInt32 AddSubcomponent(const nsString& aRegName, const nsString& aJarSource, const nsString& aFolder, const nsString& aTargetName, PRInt32* aReturn);
PRInt32 AddSubcomponent(const nsString& aJarSource, PRInt32* aReturn);
PRInt32 DeleteComponent(const nsString& aRegistryName, PRInt32* aReturn);
PRInt32 DeleteFile(const nsString& aFolder, const nsString& aRelativeFileName, PRInt32* aReturn);
PRInt32 DiskSpaceAvailable(const nsString& aFolder, PRInt32* aReturn);
PRInt32 Execute(const nsString& aJarSource, const nsString& aArgs, PRInt32* aReturn);
PRInt32 Execute(const nsString& aJarSource, PRInt32* aReturn);
PRInt32 FinalizeInstall(PRInt32* aReturn);
PRInt32 Gestalt(const nsString& aSelector, PRInt32* aReturn);
PRInt32 GetComponentFolder(const nsString& aComponentName, const nsString& aSubdirectory, nsString** aFolder);
PRInt32 GetComponentFolder(const nsString& aComponentName, nsString** aFolder);
PRInt32 GetFolder(const nsString& aTargetFolder, const nsString& aSubdirectory, nsString** aFolder);
PRInt32 GetFolder(const nsString& aTargetFolder, nsString** aFolder);
PRInt32 GetLastError(PRInt32* aReturn);
PRInt32 GetWinProfile(const nsString& aFolder, const nsString& aFile, JSContext* jscontext, JSClass* WinProfileClass, jsval* aReturn);
PRInt32 GetWinRegistry(JSContext* jscontext, JSClass* WinRegClass, jsval* aReturn);
PRInt32 Patch(const nsString& aRegName, const nsString& aVersion, const nsString& aJarSource, const nsString& aFolder, const nsString& aTargetName, PRInt32* aReturn);
PRInt32 Patch(const nsString& aRegName, const nsString& aJarSource, const nsString& aFolder, const nsString& aTargetName, PRInt32* aReturn);
PRInt32 ResetError();
PRInt32 SetPackageFolder(const nsString& aFolder);
PRInt32 StartInstall(const nsString& aUserPackageName, const nsString& aPackageName, const nsString& aVersion, PRInt32* aReturn);
PRInt32 Uninstall(const nsString& aPackageName, PRInt32* aReturn);
PRInt32 FileOpDirCreate(nsFileSpec& aTarget, PRInt32* aReturn);
PRInt32 FileOpDirGetParent(nsFileSpec& aTarget, nsFileSpec* aReturn);
PRInt32 FileOpDirRemove(nsFileSpec& aTarget, PRInt32 aFlags, PRInt32* aReturn);
PRInt32 FileOpDirRename(nsFileSpec& aSrc, nsFileSpec& aTarget, PRInt32* aReturn);
PRInt32 FileOpFileCopy(nsFileSpec& aSrc, nsFileSpec& aTarget, PRInt32* aReturn);
PRInt32 FileOpFileDelete(nsFileSpec& aTarget, PRInt32 aFlags, PRInt32* aReturn);
PRInt32 FileOpFileExists(nsFileSpec& aTarget, PRBool* aReturn);
PRInt32 FileOpFileExecute(nsFileSpec& aTarget, nsString& aParams, PRInt32* aReturn);
PRInt32 FileOpFileGetNativeVersion(nsFileSpec& aTarget, nsString* aReturn);
PRInt32 FileOpFileGetDiskSpaceAvailable(nsFileSpec& aTarget, PRUint32* aReturn);
PRInt32 FileOpFileGetModDate(nsFileSpec& aTarget, nsFileSpec::TimeStamp* aReturn);
PRInt32 FileOpFileGetSize(nsFileSpec& aTarget, PRUint32* aReturn);
PRInt32 FileOpFileIsDirectory(nsFileSpec& aTarget, PRBool* aReturn);
PRInt32 FileOpFileIsFile(nsFileSpec& aTarget, PRBool* aReturn);
PRInt32 FileOpFileModDateChanged(nsFileSpec& aTarget, nsFileSpec::TimeStamp& aOldStamp, PRBool* aReturn);
PRInt32 FileOpFileMove(nsFileSpec& aSrc, nsFileSpec& aTarget, PRInt32* aReturn);
PRInt32 FileOpFileRename(nsFileSpec& aSrc, nsFileSpec& aTarget, PRInt32* aReturn);
PRInt32 FileOpFileWinShortcutCreate(nsFileSpec& aTarget, PRInt32 aFlags, PRInt32* aReturn);
PRInt32 FileOpFileMacAliasCreate(nsFileSpec& aTarget, PRInt32 aFlags, PRInt32* aReturn);
PRInt32 FileOpFileUnixLinkCreate(nsFileSpec& aTarget, PRInt32 aFlags, PRInt32* aReturn);
PRInt32 ExtractFileFromJar(const nsString& aJarfile, nsFileSpec* aSuggestedName, nsFileSpec** aRealName);
void AddPatch(nsHashKey *aKey, nsFileSpec* fileName);
void GetPatch(nsHashKey *aKey, nsFileSpec* fileName);
void GetJarFileLocation(nsString& aFile);
void SetJarFileLocation(const nsString& aFile);
void GetInstallArguments(nsString& args);
void SetInstallArguments(const nsString& args);
private:
JSObject* mScriptObject;
JSObject* mWinRegObject;
JSObject* mWinProfileObject;
nsString mJarFileLocation;
void* mJarFileData;
nsString mInstallArguments;
PRBool mUserCancelled;
PRBool mUninstallPackage;
PRBool mRegisterPackage;
nsString mRegistryPackageName; /* Name of the package we are installing */
nsString mUIName; /* User-readable package name */
nsInstallVersion* mVersionInfo; /* Component version info */
nsVector* mInstalledFiles;
nsHashtable* mPatchList;
nsIXPInstallProgress *mNotifier;
PRInt32 mLastError;
void ParseFlags(int flags);
PRInt32 SanityCheck(void);
void GetTime(nsString &aString);
PRInt32 GetQualifiedRegName(const nsString& name, nsString& qualifiedRegName );
PRInt32 GetQualifiedPackageName( const nsString& name, nsString& qualifiedName );
void CurrentUserNode(nsString& userRegNode);
PRBool BadRegName(const nsString& regName);
PRInt32 SaveError(PRInt32 errcode);
void CleanUp();
PRInt32 OpenJARFile(void);
void CloseJARFile(void);
PRInt32 ExtractDirEntries(const nsString& directory, nsVector *paths);
PRInt32 ScheduleForInstall(nsInstallObject* ob);
};
#endif

View File

@@ -1,235 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* 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 Mozilla Communicator client code,
* released March 31, 1998.
*
* 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.
*
* Contributors:
* Daniel Veditz <dveditz@netscape.com>
* Douglas Turner <dougt@netscape.com>
*/
#include "prmem.h"
#include "nsFileSpec.h"
#include "VerReg.h"
#include "ScheduledTasks.h"
#include "nsInstallDelete.h"
#include "nsInstallResources.h"
#include "nsInstall.h"
#include "nsIDOMInstallVersion.h"
nsInstallDelete::nsInstallDelete( nsInstall* inInstall,
const nsString& folderSpec,
const nsString& inPartialPath,
PRInt32 *error)
: nsInstallObject(inInstall)
{
if ((folderSpec == "null") || (inInstall == NULL))
{
*error = nsInstall::INVALID_ARGUMENTS;
return;
}
mDeleteStatus = DELETE_FILE;
mFinalFile = nsnull;
mRegistryName = "";
mFinalFile = new nsFileSpec(folderSpec);
*mFinalFile += inPartialPath;
*error = ProcessInstallDelete();
}
nsInstallDelete::nsInstallDelete( nsInstall* inInstall,
const nsString& inComponentName,
PRInt32 *error)
: nsInstallObject(inInstall)
{
if (inInstall == NULL)
{
*error = nsInstall::INVALID_ARGUMENTS;
return;
}
mDeleteStatus = DELETE_COMPONENT;
mFinalFile = nsnull;
mRegistryName = inComponentName;
*error = ProcessInstallDelete();
}
nsInstallDelete::~nsInstallDelete()
{
if (mFinalFile == nsnull)
delete mFinalFile;
}
PRInt32 nsInstallDelete::Prepare()
{
// no set-up necessary
return nsInstall::SUCCESS;
}
PRInt32 nsInstallDelete::Complete()
{
PRInt32 err = nsInstall::SUCCESS;
if (mInstall == NULL)
return nsInstall::INVALID_ARGUMENTS;
if (mDeleteStatus == DELETE_COMPONENT)
{
char* temp = mRegistryName.ToNewCString();
err = VR_Remove(temp);
delete [] temp;
}
if ((mDeleteStatus == DELETE_FILE) || (err == REGERR_OK))
{
err = NativeComplete();
}
else
{
err = nsInstall::UNEXPECTED_ERROR;
}
return err;
}
void nsInstallDelete::Abort()
{
}
char* nsInstallDelete::toString()
{
char* buffer = new char[1024];
if (mDeleteStatus == DELETE_COMPONENT)
{
sprintf( buffer, nsInstallResources::GetDeleteComponentString(), nsAutoCString(mRegistryName));
}
else
{
if (mFinalFile)
sprintf( buffer, nsInstallResources::GetDeleteFileString(), mFinalFile->GetCString());
}
return buffer;
}
PRBool
nsInstallDelete::CanUninstall()
{
return PR_FALSE;
}
PRBool
nsInstallDelete::RegisterPackageNode()
{
return PR_FALSE;
}
PRInt32 nsInstallDelete::ProcessInstallDelete()
{
PRInt32 err;
char* tempCString = nsnull;
if (mDeleteStatus == DELETE_COMPONENT)
{
/* Check if the component is in the registry */
tempCString = mRegistryName.ToNewCString();
err = VR_InRegistry( tempCString );
if (err != REGERR_OK)
{
return err;
}
else
{
char* tempRegistryString;
tempRegistryString = (char*)PR_Calloc(MAXREGPATHLEN, sizeof(char));
err = VR_GetPath( tempCString , MAXREGPATHLEN, tempRegistryString);
if (err == REGERR_OK)
{
if (mFinalFile)
delete mFinalFile;
mFinalFile = new nsFileSpec(tempRegistryString);
}
PR_FREEIF(tempRegistryString);
}
}
if(tempCString)
delete [] tempCString;
if (mFinalFile->Exists())
{
if (mFinalFile->IsFile())
{
err = nsInstall::SUCCESS;
}
else
{
err = nsInstall::FILE_IS_DIRECTORY;
}
}
else
{
err = nsInstall::FILE_DOES_NOT_EXIST;
}
return err;
}
PRInt32 nsInstallDelete::NativeComplete()
{
if (mFinalFile->Exists())
{
if (mFinalFile->IsFile())
{
return DeleteFileNowOrSchedule(*mFinalFile);
}
else
{
return nsInstall::FILE_IS_DIRECTORY;
}
}
return nsInstall::FILE_DOES_NOT_EXIST;
}

View File

@@ -1,78 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* 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 Mozilla Communicator client code,
* released March 31, 1998.
*
* 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.
*
* Contributors:
* Daniel Veditz <dveditz@netscape.com>
* Douglas Turner <dougt@netscape.com>
*/
#ifndef nsInstallDelete_h__
#define nsInstallDelete_h__
#include "prtypes.h"
#include "nsString.h"
#include "nsInstallObject.h"
#include "nsInstall.h"
#define DELETE_COMPONENT 1
#define DELETE_FILE 2
class nsInstallDelete : public nsInstallObject
{
public:
nsInstallDelete( nsInstall* inInstall,
const nsString& folderSpec,
const nsString& inPartialPath,
PRInt32 *error);
nsInstallDelete( nsInstall* inInstall,
const nsString& ,
PRInt32 *error);
virtual ~nsInstallDelete();
PRInt32 Prepare();
PRInt32 Complete();
void Abort();
char* toString();
PRBool CanUninstall();
PRBool RegisterPackageNode();
private:
/* Private Fields */
nsFileSpec* mFinalFile;
nsString mRegistryName;
PRInt32 mDeleteStatus;
PRInt32 ProcessInstallDelete();
PRInt32 NativeComplete();
};
#endif /* nsInstallDelete_h__ */

View File

@@ -1,136 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* 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 Mozilla Communicator client code,
* released March 31, 1998.
*
* 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.
*
* Contributors:
* Daniel Veditz <dveditz@netscape.com>
* Douglas Turner <dougt@netscape.com>
*/
#include "prmem.h"
#include "nsFileSpec.h"
#include "VerReg.h"
#include "nsInstallExecute.h"
#include "nsInstallResources.h"
#include "ScheduledTasks.h"
#include "nsInstall.h"
#include "nsIDOMInstallVersion.h"
nsInstallExecute:: nsInstallExecute( nsInstall* inInstall,
const nsString& inJarLocation,
const nsString& inArgs,
PRInt32 *error)
: nsInstallObject(inInstall)
{
if ((inInstall == nsnull) || (inJarLocation == "null"))
{
*error = nsInstall::INVALID_ARGUMENTS;
return;
}
mJarLocation = inJarLocation;
mArgs = inArgs;
mExecutableFile = nsnull;
}
nsInstallExecute::~nsInstallExecute()
{
if (mExecutableFile)
delete mExecutableFile;
}
PRInt32 nsInstallExecute::Prepare()
{
if (mInstall == NULL || mJarLocation == "null")
return nsInstall::INVALID_ARGUMENTS;
return mInstall->ExtractFileFromJar(mJarLocation, nsnull, &mExecutableFile);
}
PRInt32 nsInstallExecute::Complete()
{
if (mExecutableFile == nsnull)
return nsInstall::INVALID_ARGUMENTS;
nsFileSpec app( *mExecutableFile);
if (!app.Exists())
{
return nsInstall::INVALID_ARGUMENTS;
}
PRInt32 result = app.Execute( mArgs );
DeleteFileNowOrSchedule( app );
return result;
}
void nsInstallExecute::Abort()
{
/* Get the names */
if (mExecutableFile == nsnull)
return;
DeleteFileNowOrSchedule(*mExecutableFile);
}
char* nsInstallExecute::toString()
{
char* buffer = new char[1024];
// if the FileSpec is NULL, just us the in jar file name.
if (mExecutableFile == nsnull)
{
char *tempString = mJarLocation.ToNewCString();
sprintf( buffer, nsInstallResources::GetExecuteString(), tempString);
delete [] tempString;
}
else
{
sprintf( buffer, nsInstallResources::GetExecuteString(), mExecutableFile->GetCString());
}
return buffer;
}
PRBool
nsInstallExecute::CanUninstall()
{
return PR_FALSE;
}
PRBool
nsInstallExecute::RegisterPackageNode()
{
return PR_FALSE;
}

View File

@@ -1,73 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* 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 Mozilla Communicator client code,
* released March 31, 1998.
*
* 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.
*
* Contributors:
* Daniel Veditz <dveditz@netscape.com>
* Douglas Turner <dougt@netscape.com>
*/
#ifndef nsInstallExecute_h__
#define nsInstallExecute_h__
#include "prtypes.h"
#include "nsString.h"
#include "nsInstallObject.h"
#include "nsInstall.h"
#include "nsIDOMInstallVersion.h"
class nsInstallExecute : public nsInstallObject
{
public:
nsInstallExecute( nsInstall* inInstall,
const nsString& inJarLocation,
const nsString& inArgs,
PRInt32 *error);
virtual ~nsInstallExecute();
PRInt32 Prepare();
PRInt32 Complete();
void Abort();
char* toString();
PRBool CanUninstall();
PRBool RegisterPackageNode();
private:
nsString mJarLocation; // Location in the JAR
nsString mArgs; // command line arguments
nsFileSpec *mExecutableFile; // temporary file location
PRInt32 NativeComplete(void);
void NativeAbort(void);
};
#endif /* nsInstallExecute_h__ */

View File

@@ -1,366 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* 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 Mozilla Communicator client code,
* released March 31, 1998.
*
* 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.
*
* Contributors:
* Daniel Veditz <dveditz@netscape.com>
* Douglas Turner <dougt@netscape.com>
*/
#include "nsInstallFile.h"
#include "nsFileSpec.h"
#include "VerReg.h"
#include "ScheduledTasks.h"
#include "nsInstall.h"
#include "nsIDOMInstallVersion.h"
#include "nsInstallResources.h"
/* Public Methods */
/* Constructor
inInstall - softUpdate object we belong to
inComponentName - full path of the registry component
inVInfo - full version info
inJarLocation - location inside the JAR file
inFinalFileSpec - final location on disk
*/
nsInstallFile::nsInstallFile(nsInstall* inInstall,
const nsString& inComponentName,
const nsString& inVInfo,
const nsString& inJarLocation,
const nsString& folderSpec,
const nsString& inPartialPath,
PRBool forceInstall,
PRInt32 *error)
: nsInstallObject(inInstall)
{
mVersionRegistryName = nsnull;
mJarLocation = nsnull;
mExtracedFile = nsnull;
mFinalFile = nsnull;
mVersionInfo = nsnull;
mUpgradeFile = PR_FALSE;
if ((folderSpec == "null") || (inInstall == NULL))
{
*error = nsInstall::INVALID_ARGUMENTS;
return;
}
/* Check for existence of the newer version */
PRBool versionNewer = PR_FALSE; // Is this a newer version
char* qualifiedRegNameString = inComponentName.ToNewCString();
if ( (forceInstall == PR_FALSE ) && (inVInfo != "") && ( VR_ValidateComponent( qualifiedRegNameString ) == 0 ) )
{
nsInstallVersion *newVersion = new nsInstallVersion();
newVersion->Init(inVInfo);
VERSION versionStruct;
VR_GetVersion( qualifiedRegNameString, &versionStruct );
nsInstallVersion* oldVersion = new nsInstallVersion();
oldVersion->Init(versionStruct.major,
versionStruct.minor,
versionStruct.release,
versionStruct.build);
PRInt32 areTheyEqual;
newVersion->CompareTo(oldVersion, &areTheyEqual);
delete oldVersion;
delete newVersion;
if (areTheyEqual == nsIDOMInstallVersion::MAJOR_DIFF_MINUS ||
areTheyEqual == nsIDOMInstallVersion::MINOR_DIFF_MINUS ||
areTheyEqual == nsIDOMInstallVersion::REL_DIFF_MINUS ||
areTheyEqual == nsIDOMInstallVersion::BLD_DIFF_MINUS )
{
// the file to be installed is OLDER than what is on disk. Return error
delete qualifiedRegNameString;
*error = areTheyEqual;
return;
}
}
delete qualifiedRegNameString;
mFinalFile = new nsFileSpec(folderSpec);
*mFinalFile += inPartialPath;
mReplaceFile = mFinalFile->Exists();
if (mReplaceFile == PR_FALSE)
{
nsFileSpec parent;
mFinalFile->GetParent(parent);
nsFileSpec makeDirs(parent.GetCString(), PR_TRUE);
}
mForceInstall = forceInstall;
mVersionRegistryName = new nsString(inComponentName);
mJarLocation = new nsString(inJarLocation);
mVersionInfo = new nsString(inVInfo);
nsString regPackageName;
mInstall->GetRegPackageName(regPackageName);
// determine Child status
if ( regPackageName == "" )
{
// in the "current communicator package" absolute pathnames (start
// with slash) indicate shared files -- all others are children
mChildFile = ( mVersionRegistryName->CharAt(0) != '/' );
}
else
{
// there is no "starts with" api in nsString. LAME!
nsString startsWith;
mVersionRegistryName->Left(startsWith, regPackageName.Length());
if (startsWith.Equals(regPackageName))
{
mChildFile = true;
}
else
{
mChildFile = false;
}
}
}
nsInstallFile::~nsInstallFile()
{
if (mVersionRegistryName)
delete mVersionRegistryName;
if (mJarLocation)
delete mJarLocation;
if (mExtracedFile)
delete mExtracedFile;
if (mFinalFile)
delete mFinalFile;
if (mVersionInfo)
delete mVersionInfo;
}
/* Prepare
* Extracts file out of the JAR archive
*/
PRInt32 nsInstallFile::Prepare()
{
if (mInstall == nsnull || mFinalFile == nsnull || mJarLocation == nsnull )
return nsInstall::INVALID_ARGUMENTS;
return mInstall->ExtractFileFromJar(*mJarLocation, mFinalFile, &mExtracedFile);
}
/* Complete
* Completes the install:
* - move the downloaded file to the final location
* - updates the registry
*/
PRInt32 nsInstallFile::Complete()
{
PRInt32 err;
if (mInstall == nsnull || mVersionRegistryName == nsnull || mFinalFile == nsnull )
{
return nsInstall::INVALID_ARGUMENTS;
}
err = CompleteFileMove();
if ( 0 == err || nsInstall::REBOOT_NEEDED == err )
{
err = RegisterInVersionRegistry();
}
return err;
}
void nsInstallFile::Abort()
{
if (mExtracedFile != nsnull)
mExtracedFile->Delete(PR_FALSE);
}
char* nsInstallFile::toString()
{
char* buffer = new char[1024];
if (mFinalFile == nsnull)
{
sprintf( buffer, nsInstallResources::GetInstallFileString(), nsnull);
}
else if (mReplaceFile)
{
// we are replacing this file.
sprintf( buffer, nsInstallResources::GetReplaceFileString(), mFinalFile->GetCString());
}
else
{
sprintf( buffer, nsInstallResources::GetInstallFileString(), mFinalFile->GetCString());
}
return buffer;
}
PRInt32 nsInstallFile::CompleteFileMove()
{
int result = 0;
if (mExtracedFile == nsnull)
{
return -1;
}
if ( *mExtracedFile == *mFinalFile )
{
/* No need to rename, they are the same */
result = 0;
}
else
{
result = ReplaceFileNowOrSchedule(*mExtracedFile, *mFinalFile );
}
return result;
}
PRInt32
nsInstallFile::RegisterInVersionRegistry()
{
int refCount;
nsString regPackageName;
mInstall->GetRegPackageName(regPackageName);
// Register file and log for Uninstall
if (!mChildFile)
{
int found;
if (regPackageName != "")
{
found = VR_UninstallFileExistsInList( (char*)(const char*)nsAutoCString(regPackageName) ,
(char*)(const char*)nsAutoCString(*mVersionRegistryName));
}
else
{
found = VR_UninstallFileExistsInList( "", (char*)(const char*)nsAutoCString(*mVersionRegistryName) );
}
if (found != REGERR_OK)
mUpgradeFile = PR_FALSE;
else
mUpgradeFile = PR_TRUE;
}
else if (REGERR_OK == VR_InRegistry( (char*)(const char*)nsAutoCString(*mVersionRegistryName)))
{
mUpgradeFile = PR_TRUE;
}
else
{
mUpgradeFile = PR_FALSE;
}
if ( REGERR_OK != VR_GetRefCount( (char*)(const char*)nsAutoCString(*mVersionRegistryName), &refCount ))
{
refCount = 0;
}
VR_Install( (char*)(const char*)nsAutoCString(*mVersionRegistryName),
(char*)(const char*)mFinalFile->GetNativePathCString(), // DO NOT CHANGE THIS.
(char*)(const char*)nsAutoCString(*mVersionInfo),
PR_FALSE );
if (mUpgradeFile)
{
if (refCount == 0)
VR_SetRefCount( (char*)(const char*)nsAutoCString(*mVersionRegistryName), 1 );
else
VR_SetRefCount( (char*)(const char*)nsAutoCString(*mVersionRegistryName), refCount ); //FIX?? what should the ref count be/
}
else
{
if (refCount != 0)
{
VR_SetRefCount( (char*)(const char*)nsAutoCString(*mVersionRegistryName), refCount + 1 );
}
else
{
if (mReplaceFile)
VR_SetRefCount( (char*)(const char*)nsAutoCString(*mVersionRegistryName), 2 );
else
VR_SetRefCount( (char*)(const char*)nsAutoCString(*mVersionRegistryName), 1 );
}
}
if ( !mChildFile && !mUpgradeFile )
{
if (regPackageName != "")
{
VR_UninstallAddFileToList( (char*)(const char*)nsAutoCString(regPackageName),
(char*)(const char*)nsAutoCString(*mVersionRegistryName));
}
else
{
VR_UninstallAddFileToList( "", (char*)(const char*)nsAutoCString(*mVersionRegistryName) );
}
}
return nsInstall::SUCCESS;
}
/* CanUninstall
* InstallFile() installs files which can be uninstalled,
* hence this function returns true.
*/
PRBool
nsInstallFile::CanUninstall()
{
return TRUE;
}
/* RegisterPackageNode
* InstallFile() installs files which need to be registered,
* hence this function returns true.
*/
PRBool
nsInstallFile::RegisterPackageNode()
{
return TRUE;
}

View File

@@ -1,93 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* 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 Mozilla Communicator client code,
* released March 31, 1998.
*
* 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.
*
* Contributors:
* Daniel Veditz <dveditz@netscape.com>
* Douglas Turner <dougt@netscape.com>
*/
#ifndef nsInstallFile_h__
#define nsInstallFile_h__
#include "prtypes.h"
#include "nsString.h"
#include "nsInstallObject.h"
#include "nsInstall.h"
#include "nsInstallVersion.h"
class nsInstallFile : public nsInstallObject
{
public:
/*************************************************************
* Public Methods
*
* Constructor
* inSoftUpdate - softUpdate object we belong to
* inComponentName - full path of the registry component
* inVInfo - full version info
* inJarLocation - location inside the JAR file
* inFinalFileSpec - final location on disk
*************************************************************/
nsInstallFile( nsInstall* inInstall,
const nsString& inVRName,
const nsString& inVInfo,
const nsString& inJarLocation,
const nsString& folderSpec,
const nsString& inPartialPath,
PRBool forceInstall,
PRInt32 *error);
virtual ~nsInstallFile();
PRInt32 Prepare();
PRInt32 Complete();
void Abort();
char* toString();
PRBool CanUninstall();
PRBool RegisterPackageNode();
private:
/* Private Fields */
nsString* mVersionInfo; /* Version info for this file*/
nsString* mJarLocation; /* Location in the JAR */
nsFileSpec* mExtracedFile; /* temporary file location */
nsFileSpec* mFinalFile; /* final file destination */
nsString* mVersionRegistryName; /* full version path */
PRBool mForceInstall; /* whether install is forced */
PRBool mReplaceFile; /* whether file exists */
PRBool mChildFile; /* whether file is a child */
PRBool mUpgradeFile; /* whether file is an upgrade */
PRInt32 CompleteFileMove();
PRInt32 RegisterInVersionRegistry();
};
#endif /* nsInstallFile_h__ */

View File

@@ -1,38 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsInstallFileOpEnums_h__
#define nsInstallFileOpEnums_h__
typedef enum nsInstallFileOpEnums {
NS_FOP_DIR_CREATE = 0,
NS_FOP_DIR_REMOVE = 1,
NS_FOP_DIR_RENAME = 2,
NS_FOP_FILE_COPY = 3,
NS_FOP_FILE_DELETE = 4,
NS_FOP_FILE_EXECUTE = 5,
NS_FOP_FILE_MOVE = 6,
NS_FOP_FILE_RENAME = 7,
NS_FOP_WIN_SHORTCUT_CREATE = 8,
NS_FOP_MAC_ALIAS_CREATE = 9,
NS_FOP_UNIX_LINK_CREATE = 10,
NS_FOP_FILE_SET_STAT = 11
} nsInstallFileOpEnums;
#endif /* nsInstallFileOpEnums_h__ */

View File

@@ -1,316 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nspr.h"
#include "nsInstall.h"
#include "nsInstallFileOpEnums.h"
#include "nsInstallFileOpItem.h"
/* Public Methods */
nsInstallFileOpItem::nsInstallFileOpItem(nsInstall* aInstallObj,
PRInt32 aCommand,
nsFileSpec& aTarget,
PRInt32 aFlags,
PRInt32* aReturn)
:nsInstallObject(aInstallObj)
{
mIObj = aInstallObj;
mCommand = aCommand;
mFlags = aFlags;
mSrc = nsnull;
mParams = nsnull;
mTarget = new nsFileSpec(aTarget);
*aReturn = NS_OK;
}
nsInstallFileOpItem::nsInstallFileOpItem(nsInstall* aInstallObj,
PRInt32 aCommand,
nsFileSpec& aSrc,
nsFileSpec& aTarget,
PRInt32* aReturn)
:nsInstallObject(aInstallObj)
{
mIObj = aInstallObj;
mCommand = aCommand;
mFlags = 0;
mSrc = new nsFileSpec(aSrc);
mParams = nsnull;
mTarget = new nsFileSpec(aTarget);
*aReturn = NS_OK;
}
nsInstallFileOpItem::nsInstallFileOpItem(nsInstall* aInstallObj,
PRInt32 aCommand,
nsFileSpec& aTarget,
PRInt32* aReturn)
:nsInstallObject(aInstallObj)
{
mIObj = aInstallObj;
mCommand = aCommand;
mFlags = 0;
mSrc = nsnull;
mParams = nsnull;
mTarget = new nsFileSpec(aTarget);
*aReturn = NS_OK;
}
nsInstallFileOpItem::nsInstallFileOpItem(nsInstall* aInstallObj,
PRInt32 aCommand,
nsFileSpec& aTarget,
nsString& aParams,
PRInt32* aReturn)
:nsInstallObject(aInstallObj)
{
mIObj = aInstallObj;
mCommand = aCommand;
mFlags = 0;
mSrc = nsnull;
mParams = new nsString(aParams);
mTarget = new nsFileSpec(aTarget);
*aReturn = NS_OK;
}
nsInstallFileOpItem::~nsInstallFileOpItem()
{
if(mSrc)
delete mSrc;
if(mTarget)
delete mTarget;
}
PRInt32 nsInstallFileOpItem::Complete()
{
PRInt32 aReturn = NS_OK;
switch(mCommand)
{
case NS_FOP_DIR_CREATE:
NativeFileOpDirCreate(mTarget);
break;
case NS_FOP_DIR_REMOVE:
NativeFileOpDirRemove(mTarget, mFlags);
break;
case NS_FOP_DIR_RENAME:
NativeFileOpDirRename(mSrc, mTarget);
break;
case NS_FOP_FILE_COPY:
NativeFileOpFileCopy(mSrc, mTarget);
break;
case NS_FOP_FILE_DELETE:
NativeFileOpFileDelete(mTarget, mFlags);
break;
case NS_FOP_FILE_EXECUTE:
NativeFileOpFileExecute(mTarget, mParams);
break;
case NS_FOP_FILE_MOVE:
NativeFileOpFileMove(mSrc, mTarget);
break;
case NS_FOP_FILE_RENAME:
NativeFileOpFileRename(mSrc, mTarget);
break;
case NS_FOP_WIN_SHORTCUT_CREATE:
NativeFileOpWinShortcutCreate();
break;
case NS_FOP_MAC_ALIAS_CREATE:
NativeFileOpMacAliasCreate();
break;
case NS_FOP_UNIX_LINK_CREATE:
NativeFileOpUnixLinkCreate();
break;
}
return aReturn;
}
float nsInstallFileOpItem::GetInstallOrder()
{
return 3;
}
char* nsInstallFileOpItem::toString()
{
nsString result;
char* resultCString;
switch(mCommand)
{
case NS_FOP_FILE_COPY:
result = "Copy file: ";
result.Append(mSrc->GetNativePathCString());
result.Append(" to ");
result.Append(mTarget->GetNativePathCString());
resultCString = result.ToNewCString();
break;
case NS_FOP_FILE_DELETE:
result = "Delete file: ";
result.Append(mTarget->GetNativePathCString());
resultCString = result.ToNewCString();
break;
case NS_FOP_FILE_MOVE:
result = "Move file: ";
result.Append(mSrc->GetNativePathCString());
result.Append(" to ");
result.Append(mTarget->GetNativePathCString());
resultCString = result.ToNewCString();
break;
case NS_FOP_FILE_RENAME:
result = "Rename file: ";
result.Append(mTarget->GetNativePathCString());
resultCString = result.ToNewCString();
break;
case NS_FOP_DIR_CREATE:
result = "Create Folder: ";
result.Append(mTarget->GetNativePathCString());
resultCString = result.ToNewCString();
break;
case NS_FOP_DIR_REMOVE:
result = "Remove Folder: ";
result.Append(mTarget->GetNativePathCString());
resultCString = result.ToNewCString();
break;
case NS_FOP_WIN_SHORTCUT_CREATE:
break;
case NS_FOP_MAC_ALIAS_CREATE:
break;
case NS_FOP_UNIX_LINK_CREATE:
break;
case NS_FOP_FILE_SET_STAT:
result = "Set file stat: ";
result.Append(mTarget->GetNativePathCString());
resultCString = result.ToNewCString();
break;
default:
result = "Unkown file operation command!";
resultCString = result.ToNewCString();
break;
}
return resultCString;
}
PRInt32 nsInstallFileOpItem::Prepare()
{
return NULL;
}
void nsInstallFileOpItem::Abort()
{
}
/* Private Methods */
/* CanUninstall
* InstallFileOpItem() does not install any files which can be uninstalled,
* hence this function returns false.
*/
PRBool
nsInstallFileOpItem::CanUninstall()
{
return FALSE;
}
/* RegisterPackageNode
* InstallFileOpItem() does notinstall files which need to be registered,
* hence this function returns false.
*/
PRBool
nsInstallFileOpItem::RegisterPackageNode()
{
return FALSE;
}
//
// File operation functions begin here
//
PRInt32
nsInstallFileOpItem::NativeFileOpDirCreate(nsFileSpec* aTarget)
{
aTarget->CreateDirectory();
return NS_OK;
}
PRInt32
nsInstallFileOpItem::NativeFileOpDirRemove(nsFileSpec* aTarget, PRInt32 aFlags)
{
aTarget->Delete(aFlags);
return NS_OK;
}
PRInt32
nsInstallFileOpItem::NativeFileOpDirRename(nsFileSpec* aSrc, nsFileSpec* aTarget)
{
aSrc->Rename(*aTarget);
return NS_OK;
}
PRInt32
nsInstallFileOpItem::NativeFileOpFileCopy(nsFileSpec* aSrc, nsFileSpec* aTarget)
{
aSrc->Copy(*aTarget);
return NS_OK;
}
PRInt32
nsInstallFileOpItem::NativeFileOpFileDelete(nsFileSpec* aTarget, PRInt32 aFlags)
{
aTarget->Delete(aFlags);
return NS_OK;
}
PRInt32
nsInstallFileOpItem::NativeFileOpFileExecute(nsFileSpec* aTarget, nsString* aParams)
{
aTarget->Execute(*aParams);
return NS_OK;
}
PRInt32
nsInstallFileOpItem::NativeFileOpFileMove(nsFileSpec* aSrc, nsFileSpec* aTarget)
{
aSrc->Move(*aTarget);
return NS_OK;
}
PRInt32
nsInstallFileOpItem::NativeFileOpFileRename(nsFileSpec* aSrc, nsFileSpec* aTarget)
{
aSrc->Rename(*aTarget);
return NS_OK;
}
PRInt32
nsInstallFileOpItem::NativeFileOpWinShortcutCreate()
{
return NS_OK;
}
PRInt32
nsInstallFileOpItem::NativeFileOpMacAliasCreate()
{
return NS_OK;
}
PRInt32
nsInstallFileOpItem::NativeFileOpUnixLinkCreate()
{
return NS_OK;
}

View File

@@ -1,111 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsInstallFileOpItem_h__
#define nsInstallFileOpItem_h__
#include "prtypes.h"
#include "nsFileSpec.h"
#include "nsSoftwareUpdate.h"
#include "nsInstallObject.h"
#include "nsInstall.h"
class nsInstallFileOpItem : public nsInstallObject
{
public:
/* Public Fields */
/* Public Methods */
// used by:
// FileOpFileDelete()
nsInstallFileOpItem(nsInstall* installObj,
PRInt32 aCommand,
nsFileSpec& aTarget,
PRInt32 aFlags,
PRInt32* aReturn);
// used by:
// FileOpDirRemove()
// FileOpDirRename()
// FileOpFileCopy()
// FileOpFileMove()
// FileOpFileRename()
nsInstallFileOpItem(nsInstall* installObj,
PRInt32 aCommand,
nsFileSpec& aSrc,
nsFileSpec& aTarget,
PRInt32* aReturn);
// used by:
// FileOpDirCreate()
nsInstallFileOpItem(nsInstall* aInstallObj,
PRInt32 aCommand,
nsFileSpec& aTarget,
PRInt32* aReturn);
// used by:
// FileOpFileExecute()
nsInstallFileOpItem(nsInstall* aInstallObj,
PRInt32 aCommand,
nsFileSpec& aTarget,
nsString& aParams,
PRInt32* aReturn);
~nsInstallFileOpItem();
PRInt32 Prepare(void);
PRInt32 Complete();
char* toString();
void Abort();
float GetInstallOrder();
/* should these be protected? */
PRBool CanUninstall();
PRBool RegisterPackageNode();
private:
/* Private Fields */
nsInstall* mIObj; // initiating Install object
nsFileSpec* mSrc;
nsFileSpec* mTarget;
nsString* mParams;
long mFStat;
PRInt32 mFlags;
PRInt32 mCommand;
/* Private Methods */
PRInt32 NativeFileOpDirCreate(nsFileSpec* aTarget);
PRInt32 NativeFileOpDirRemove(nsFileSpec* aTarget, PRInt32 aFlags);
PRInt32 NativeFileOpDirRename(nsFileSpec* aSrc, nsFileSpec* aTarget);
PRInt32 NativeFileOpFileCopy(nsFileSpec* aSrc, nsFileSpec* aTarget);
PRInt32 NativeFileOpFileDelete(nsFileSpec* aTarget, PRInt32 aFlags);
PRInt32 NativeFileOpFileExecute(nsFileSpec* aTarget, nsString* aParams);
PRInt32 NativeFileOpFileMove(nsFileSpec* aSrc, nsFileSpec* aTarget);
PRInt32 NativeFileOpFileRename(nsFileSpec* aSrc, nsFileSpec* aTarget);
PRInt32 NativeFileOpWinShortcutCreate();
PRInt32 NativeFileOpMacAliasCreate();
PRInt32 NativeFileOpUnixLinkCreate();
};
#endif /* nsInstallFileOpItem_h__ */

View File

@@ -1,336 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* 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 Mozilla Communicator client code,
* released March 31, 1998.
*
* 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.
*
* Contributors:
* Daniel Veditz <dveditz@netscape.com>
* Douglas Turner <dougt@netscape.com>
*/
#include "nsInstall.h"
#include "nsInstallFolder.h"
#include "nscore.h"
#include "prtypes.h"
#include "nsRepository.h"
#include "nsString.h"
#include "nsFileSpec.h"
#include "nsSpecialSystemDirectory.h"
#include "nsFileLocations.h"
#include "nsIFileLocator.h"
struct DirectoryTable
{
char * directoryName; /* The formal directory name */
PRInt32 folderEnum; /* Directory ID */
};
struct DirectoryTable DirectoryTable[] =
{
{"Plugins", 100 },
{"Program", 101 },
{"Communicator", 102 },
{"User Pick", 103 },
{"Temporary", 104 },
{"Installed", 105 },
{"Current User", 106 },
{"Preferences", 107 },
{"OS Drive", 108 },
{"file:///", 109 },
{"Components", 110 },
{"Chrome", 111 },
{"Win System", 200 },
{"Windows", 201 },
{"Mac System", 300 },
{"Mac Desktop", 301 },
{"Mac Trash", 302 },
{"Mac Startup", 303 },
{"Mac Shutdown", 304 },
{"Mac Apple Menu", 305 },
{"Mac Control Panel", 306 },
{"Mac Extension", 307 },
{"Mac Fonts", 308 },
{"Mac Preferences", 309 },
{"Mac Documents", 310 },
{"Unix Local", 400 },
{"Unix Lib", 401 },
{"", -1 }
};
nsInstallFolder::nsInstallFolder(const nsString& aFolderID)
{
mFileSpec = nsnull;
SetDirectoryPath( aFolderID, "");
}
nsInstallFolder::nsInstallFolder(const nsString& aFolderID, const nsString& aRelativePath)
{
mFileSpec = nsnull;
/*
aFolderID can be either a Folder enum in which case we merely pass it to SetDirectoryPath, or
it can be a Directory. If it is the later, it must already exist and of course be a directory
not a file.
*/
nsFileSpec dirCheck(aFolderID);
if ( (dirCheck.Error() == NS_OK) && (dirCheck.IsDirectory()) && (dirCheck.Exists()))
{
nsString tempString = aFolderID;
tempString += aRelativePath;
mFileSpec = new nsFileSpec(tempString);
// make sure that the directory is created.
nsFileSpec(mFileSpec->GetCString(), PR_TRUE);
}
else
{
SetDirectoryPath( aFolderID, aRelativePath);
}
}
nsInstallFolder::~nsInstallFolder()
{
if (mFileSpec != nsnull)
delete mFileSpec;
}
void
nsInstallFolder::GetDirectoryPath(nsString& aDirectoryPath)
{
aDirectoryPath = "";
if (mFileSpec != nsnull)
{
// We want the a NATIVE path.
aDirectoryPath.SetString(mFileSpec->GetCString());
}
}
void
nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRelativePath)
{
if ( aFolderID.EqualsIgnoreCase("User Pick") )
{
PickDefaultDirectory();
return;
}
else if ( aFolderID.EqualsIgnoreCase("Installed") )
{
mFileSpec = new nsFileSpec(aRelativePath, PR_TRUE); // creates the directories to the relative path.
return;
}
else
{
PRInt32 folderDirSpecID = MapNameToEnum(aFolderID);
switch (folderDirSpecID)
{
case 100: /////////////////////////////////////////////////////////// Plugins
SetAppShellDirectory(nsSpecialFileSpec::App_PluginsDirectory );
break;
case 101: /////////////////////////////////////////////////////////// Program
mFileSpec = new nsFileSpec( nsSpecialSystemDirectory( nsSpecialSystemDirectory::OS_CurrentProcessDirectory ));
break;
case 102: /////////////////////////////////////////////////////////// Communicator
mFileSpec = new nsFileSpec( nsSpecialSystemDirectory( nsSpecialSystemDirectory::OS_CurrentProcessDirectory ));
break;
case 103: /////////////////////////////////////////////////////////// User Pick
// we should never be here.
mFileSpec = nsnull;
break;
case 104: /////////////////////////////////////////////////////////// Temporary
mFileSpec = new nsFileSpec( nsSpecialSystemDirectory( nsSpecialSystemDirectory::OS_TemporaryDirectory ));
break;
case 105: /////////////////////////////////////////////////////////// Installed
// we should never be here.
mFileSpec = nsnull;
break;
case 106: /////////////////////////////////////////////////////////// Current User
SetAppShellDirectory(nsSpecialFileSpec::App_UserProfileDirectory50 );
break;
case 107: /////////////////////////////////////////////////////////// Preferences
SetAppShellDirectory(nsSpecialFileSpec::App_PrefsDirectory50 );
break;
case 108: /////////////////////////////////////////////////////////// OS Drive
mFileSpec = new nsFileSpec( nsSpecialSystemDirectory( nsSpecialSystemDirectory::OS_DriveDirectory ));
break;
case 109: /////////////////////////////////////////////////////////// File URL
{
nsString tempFileURLString = aFolderID;
tempFileURLString += aRelativePath;
mFileSpec = new nsFileSpec( nsFileURL(tempFileURLString) );
}
break;
case 110: /////////////////////////////////////////////////////////// Components
SetAppShellDirectory(nsSpecialFileSpec::App_ComponentsDirectory );
break;
case 111: /////////////////////////////////////////////////////////// Chrome
SetAppShellDirectory(nsSpecialFileSpec::App_ChromeDirectory );
break;
case 200: /////////////////////////////////////////////////////////// Win System
mFileSpec = new nsFileSpec( nsSpecialSystemDirectory( nsSpecialSystemDirectory::Win_SystemDirectory ));
break;
case 201: /////////////////////////////////////////////////////////// Windows
mFileSpec = new nsFileSpec( nsSpecialSystemDirectory( nsSpecialSystemDirectory::Win_WindowsDirectory ));
break;
case 300: /////////////////////////////////////////////////////////// Mac System
mFileSpec = new nsFileSpec( nsSpecialSystemDirectory( nsSpecialSystemDirectory::Mac_SystemDirectory ));
break;
case 301: /////////////////////////////////////////////////////////// Mac Desktop
mFileSpec = new nsFileSpec( nsSpecialSystemDirectory( nsSpecialSystemDirectory::Mac_DesktopDirectory ));
break;
case 302: /////////////////////////////////////////////////////////// Mac Trash
mFileSpec = new nsFileSpec( nsSpecialSystemDirectory( nsSpecialSystemDirectory::Mac_TrashDirectory ));
break;
case 303: /////////////////////////////////////////////////////////// Mac Startup
mFileSpec = new nsFileSpec( nsSpecialSystemDirectory( nsSpecialSystemDirectory::Mac_StartupDirectory ));
break;
case 304: /////////////////////////////////////////////////////////// Mac Shutdown
mFileSpec = new nsFileSpec( nsSpecialSystemDirectory( nsSpecialSystemDirectory::Mac_StartupDirectory ));
break;
case 305: /////////////////////////////////////////////////////////// Mac Apple Menu
mFileSpec = new nsFileSpec( nsSpecialSystemDirectory( nsSpecialSystemDirectory::Mac_AppleMenuDirectory ));
break;
case 306: /////////////////////////////////////////////////////////// Mac Control Panel
mFileSpec = new nsFileSpec( nsSpecialSystemDirectory( nsSpecialSystemDirectory::Mac_ControlPanelDirectory ));
break;
case 307: /////////////////////////////////////////////////////////// Mac Extension
mFileSpec = new nsFileSpec( nsSpecialSystemDirectory( nsSpecialSystemDirectory::Mac_ExtensionDirectory ));
break;
case 308: /////////////////////////////////////////////////////////// Mac Fonts
mFileSpec = new nsFileSpec( nsSpecialSystemDirectory( nsSpecialSystemDirectory::Mac_FontsDirectory ));
break;
case 309: /////////////////////////////////////////////////////////// Mac Preferences
mFileSpec = new nsFileSpec( nsSpecialSystemDirectory( nsSpecialSystemDirectory::Mac_PreferencesDirectory ));
break;
case 310: /////////////////////////////////////////////////////////// Mac Documents
mFileSpec = new nsFileSpec( nsSpecialSystemDirectory( nsSpecialSystemDirectory::Mac_DocumentsDirectory ));
break;
case 400: /////////////////////////////////////////////////////////// Unix Local
mFileSpec = new nsFileSpec( nsSpecialSystemDirectory( nsSpecialSystemDirectory::Unix_LocalDirectory ));
break;
case 401: /////////////////////////////////////////////////////////// Unix Lib
mFileSpec = new nsFileSpec( nsSpecialSystemDirectory( nsSpecialSystemDirectory::Unix_LibDirectory ));
break;
case -1:
default:
mFileSpec = nsnull;
return;
}
#ifndef XP_MAC
if (aRelativePath.Length() > 0)
{
nsString tempPath(aRelativePath);
if (aRelativePath.Last() != '/' || aRelativePath.Last() != '\\')
tempPath += '/';
*mFileSpec += tempPath;
}
#endif
// make sure that the directory is created.
nsFileSpec(mFileSpec->GetCString(), PR_TRUE);
}
}
void nsInstallFolder::PickDefaultDirectory()
{
//FIX: Need to put up a dialog here and set mFileSpec
return;
}
/* MapNameToEnum
* maps name from the directory table to its enum */
PRInt32
nsInstallFolder::MapNameToEnum(const nsString& name)
{
int i = 0;
if ( name == "null")
return -1;
while ( DirectoryTable[i].directoryName[0] != 0 )
{
if ( name.EqualsIgnoreCase(DirectoryTable[i].directoryName) )
return DirectoryTable[i].folderEnum;
i++;
}
return -1;
}
static NS_DEFINE_IID(kFileLocatorIID, NS_IFILELOCATOR_IID);
static NS_DEFINE_IID(kFileLocatorCID, NS_FILELOCATOR_CID);
void
nsInstallFolder::SetAppShellDirectory(PRUint32 value)
{
nsIFileLocator * appShellLocator;
nsresult rv = nsComponentManager::CreateInstance(kFileLocatorCID,
nsnull,
kFileLocatorIID,
(void**) &appShellLocator);
if ( NS_SUCCEEDED(rv) )
{
mFileSpec = new nsFileSpec();
appShellLocator->GetFileLocation(value, mFileSpec);
NS_RELEASE(appShellLocator);
}
}

View File

@@ -1,58 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* 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 Mozilla Communicator client code,
* released March 31, 1998.
*
* 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.
*
* Contributors:
* Daniel Veditz <dveditz@netscape.com>
* Douglas Turner <dougt@netscape.com>
*/
#ifndef __NS_INSTALLFOLDER_H__
#define __NS_INSTALLFOLDER_H__
#include "nscore.h"
#include "prtypes.h"
#include "nsString.h"
#include "nsFileSpec.h"
#include "nsSpecialSystemDirectory.h"
class nsInstallFolder
{
public:
nsInstallFolder(const nsString& aFolderID);
nsInstallFolder(const nsString& aFolderID, const nsString& aRelativePath);
virtual ~nsInstallFolder();
void GetDirectoryPath(nsString& aDirectoryPath);
private:
nsFileSpec* mFileSpec;
void SetDirectoryPath(const nsString& aFolderID, const nsString& aRelativePath);
void PickDefaultDirectory();
PRInt32 MapNameToEnum(const nsString& name);
void SetAppShellDirectory(PRUint32 value);
};
#endif

View File

@@ -1,52 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsInstallObject_h__
#define nsInstallObject_h__
#include "prtypes.h"
class nsInstall;
class nsInstallObject
{
public:
/* Public Methods */
nsInstallObject(nsInstall* inInstall) {mInstall = inInstall; }
/* Override with your set-up action */
virtual PRInt32 Prepare() = 0;
/* Override with your Completion action */
virtual PRInt32 Complete() = 0;
/* Override with an explanatory string for the progress dialog */
virtual char* toString() = 0;
/* Override with your clean-up function */
virtual void Abort() = 0;
/* should these be protected? */
virtual PRBool CanUninstall() = 0;
virtual PRBool RegisterPackageNode() = 0;
protected:
nsInstall* mInstall;
};
#endif /* nsInstallObject_h__ */

View File

@@ -1,986 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsFileSpec.h"
#include "prmem.h"
#include "nsInstall.h"
#include "nsInstallPatch.h"
#include "nsInstallResources.h"
#include "nsIDOMInstallVersion.h"
#include "zlib.h"
#include "gdiff.h"
#include "VerReg.h"
#include "ScheduledTasks.h"
#include "plstr.h"
#include "xp_file.h" /* for XP_PlatformFileToURL */
#ifdef XP_MAC
#include "PatchableAppleSingle.h"
#endif
#define BUFSIZE 32768
#define OPSIZE 1
#define MAXCMDSIZE 12
#define SRCFILE 0
#define OUTFILE 1
#define getshort(s) (uint16)( ((uchar)*(s) << 8) + ((uchar)*((s)+1)) )
#define getlong(s) \
(uint32)( ((uchar)*(s) << 24) + ((uchar)*((s)+1) << 16 ) + \
((uchar)*((s)+2) << 8) + ((uchar)*((s)+3)) )
static int32 gdiff_parseHeader( pDIFFDATA dd );
static int32 gdiff_validateFile( pDIFFDATA dd, int file );
static int32 gdiff_valCRC32( pDIFFDATA dd, PRFileDesc* fh, uint32 chksum );
static int32 gdiff_ApplyPatch( pDIFFDATA dd );
static int32 gdiff_getdiff( pDIFFDATA dd, uchar *buffer, uint32 length );
static int32 gdiff_add( pDIFFDATA dd, uint32 count );
static int32 gdiff_copy( pDIFFDATA dd, uint32 position, uint32 count );
static int32 gdiff_validateFile( pDIFFDATA dd, int file );
nsInstallPatch::nsInstallPatch( nsInstall* inInstall,
const nsString& inVRName,
const nsString& inVInfo,
const nsString& inJarLocation,
PRInt32 *error)
: nsInstallObject(inInstall)
{
char tempTargetFile[MAXREGPATHLEN];
char* tempVersionString = inVRName.ToNewCString();
PRInt32 err = VR_GetPath(tempVersionString, MAXREGPATHLEN, tempTargetFile );
delete [] tempVersionString;
if (err != REGERR_OK)
{
*error = nsInstall::NO_SUCH_COMPONENT;
return;
}
nsString folderSpec(tempTargetFile);
mPatchFile = nsnull;
mTargetFile = nsnull;
mPatchedFile = nsnull;
mRegistryName = new nsString(inVRName);
mJarLocation = new nsString(inJarLocation);
mTargetFile = new nsFileSpec(folderSpec);
mVersionInfo = new nsInstallVersion();
mVersionInfo->Init(inVInfo);
}
nsInstallPatch::nsInstallPatch( nsInstall* inInstall,
const nsString& inVRName,
const nsString& inVInfo,
const nsString& inJarLocation,
const nsString& folderSpec,
const nsString& inPartialPath,
PRInt32 *error)
: nsInstallObject(inInstall)
{
if ((inInstall == nsnull) || (inVRName == "null") || (inJarLocation == "null"))
{
*error = nsInstall::INVALID_ARGUMENTS;
return;
}
mPatchFile = nsnull;
mTargetFile = nsnull;
mPatchedFile = nsnull;
mRegistryName = new nsString(inVRName);
mJarLocation = new nsString(inJarLocation);
mVersionInfo = new nsInstallVersion();
mVersionInfo->Init(inVInfo);
mTargetFile = new nsFileSpec(folderSpec);
if(inPartialPath != "null")
*mTargetFile += inPartialPath;
}
nsInstallPatch::~nsInstallPatch()
{
if (mVersionInfo)
delete mVersionInfo;
if (mTargetFile)
delete mTargetFile;
if (mJarLocation)
delete mJarLocation;
if (mRegistryName)
delete mRegistryName;
if (mPatchedFile)
delete mPatchedFile;
if (mPatchFile)
delete mPatchFile;
}
PRInt32 nsInstallPatch::Prepare()
{
PRInt32 err;
PRBool deleteOldSrc;
if (mTargetFile == nsnull)
return nsInstall::INVALID_ARGUMENTS;
if (mTargetFile->Exists())
{
if (mTargetFile->IsFile())
{
err = nsInstall::SUCCESS;
}
else
{
err = nsInstall::FILE_IS_DIRECTORY;
}
}
else
{
err = nsInstall::FILE_DOES_NOT_EXIST;
}
if (err != nsInstall::SUCCESS)
{
return err;
}
err = mInstall->ExtractFileFromJar(*mJarLocation, mTargetFile, &mPatchFile);
nsFileSpec *fileName = nsnull;
nsVoidKey ikey( HashFilePath( nsFilePath(*mTargetFile) ) );
mInstall->GetPatch(&ikey, fileName);
if (fileName != nsnull)
{
deleteOldSrc = PR_TRUE;
}
else
{
fileName = mTargetFile;
deleteOldSrc = PR_FALSE;
}
err = NativePatch( *fileName, // the file to patch
*mPatchFile, // the patch that was extracted from the jarfile
&mPatchedFile); // the new patched file
if (err != nsInstall::SUCCESS)
{
return err;
}
PR_ASSERT(mPatchedFile != nsnull);
mInstall->AddPatch(&ikey, mPatchedFile );
if ( deleteOldSrc )
{
DeleteFileNowOrSchedule(*fileName );
}
return err;
}
PRInt32 nsInstallPatch::Complete()
{
if ((mInstall == nsnull) || (mVersionInfo == nsnull) || (mPatchedFile == nsnull) || (mTargetFile == nsnull))
{
return nsInstall::INVALID_ARGUMENTS;
}
PRInt32 err = nsInstall::SUCCESS;
nsFileSpec *fileName = nsnull;
nsVoidKey ikey( HashFilePath( nsFilePath(*mTargetFile) ) );
mInstall->GetPatch(&ikey, fileName);
if (fileName != nsnull && (*fileName == *mPatchedFile) )
{
// the patch has not been superceded--do final replacement
err = ReplaceFileNowOrSchedule( *mTargetFile, *mPatchedFile);
if ( 0 == err || nsInstall::REBOOT_NEEDED == err )
{
nsString tempVersionString;
mVersionInfo->ToString(tempVersionString);
char* tempRegName = mRegistryName->ToNewCString();
char* tempVersion = tempVersionString.ToNewCString();
err = VR_Install( tempRegName,
(char*) (const char *) nsNSPRPath(*mTargetFile),
tempVersion,
PR_FALSE );
delete [] tempRegName;
delete [] tempVersion;
}
else
{
err = nsInstall::UNEXPECTED_ERROR;
}
}
else
{
// nothing -- old intermediate patched file was
// deleted by a superceding patch
}
return err;
}
void nsInstallPatch::Abort()
{
nsFileSpec *fileName = nsnull;
nsVoidKey ikey( HashFilePath( nsFilePath(*mTargetFile) ) );
mInstall->GetPatch(&ikey, fileName);
if (fileName != nsnull && (*fileName == *mPatchedFile) )
{
DeleteFileNowOrSchedule( *mPatchedFile );
}
}
char* nsInstallPatch::toString()
{
char* buffer = new char[1024];
// FIX! sprintf( buffer, nsInstallResources::GetPatchFileString(), mPatchedFile->GetCString());
return buffer;
}
PRBool
nsInstallPatch::CanUninstall()
{
return PR_FALSE;
}
PRBool
nsInstallPatch::RegisterPackageNode()
{
return PR_FALSE;
}
PRInt32
nsInstallPatch::NativePatch(const nsFileSpec &sourceFile, const nsFileSpec &patchFile, nsFileSpec **newFile)
{
DIFFDATA *dd;
PRInt32 status = GDIFF_ERR_MEM;
char *tmpurl = NULL;
char *realfile = PL_strdup(nsNSPRPath(sourceFile)); // needs to be sourceFile!!!
nsFileSpec outFileSpec = sourceFile;
dd = (DIFFDATA *)PR_Calloc( 1, sizeof(DIFFDATA));
if (dd != NULL)
{
dd->databuf = (uchar*)PR_Malloc(BUFSIZE);
if (dd->databuf == NULL)
{
status = GDIFF_ERR_MEM;
goto cleanup;
}
dd->bufsize = BUFSIZE;
// validate patch header & check for special instructions
dd->fDiff = PR_Open (nsNSPRPath(patchFile), PR_RDONLY, 0666);
if (dd->fDiff != NULL)
{
status = gdiff_parseHeader(dd);
} else {
status = GDIFF_ERR_ACCESS;
}
#ifdef dono
#ifdef WIN32
/* unbind Win32 images */
if ( dd->bWin32BoundImage && status == GDIFF_OK ) {
tmpurl = WH_TempName( xpURL, NULL );
if ( tmpurl != NULL ) {
if (su_unbind( srcfile, srctype, tmpurl, xpURL ))
{
PL_strfree(realfile);
realfile = tmpurl;
realtype = xpURL;
}
}
else
status = GDIFF_ERR_MEM;
}
#endif
#endif
#ifdef XP_MAC
if ( dd->bMacAppleSingle && status == GDIFF_OK )
{
// create a tmp file, so that we can AppleSingle the src file
nsSpecialSystemDirectory tempMacFile(nsSpecialSystemDirectory::OS_TemporaryDirectory);
nsString srcName = sourceFile.GetLeafName();
tempMacFile.SetLeafName(srcName);
tempMacFile.MakeUnique();
// Encode!
// Encode src file, and put into temp file
FSSpec sourceSpec = sourceFile.GetFSSpec();
FSSpec tempSpec = tempMacFile.GetFSSpec();
status = PAS_EncodeFile(&sourceSpec, &tempSpec);
if (status == noErr)
{
// set
PL_strfree(realfile);
realfile = PL_strdup(nsNSPRPath(tempMacFile));
}
}
#endif
if (status != NS_OK)
goto cleanup;
// make a unique file at the same location of our source file (FILENAME-ptch.EXT)
nsString patchFileName = "-ptch";
nsString newFileName = sourceFile.GetLeafName();
PRInt32 index;
if ((index = newFileName.RFind(".")) > 0)
{
nsString extention;
nsString fileName;
newFileName.Right(extention, (newFileName.Length() - index) );
newFileName.Left(fileName, (newFileName.Length() - (newFileName.Length() - index)));
newFileName = fileName + patchFileName + extention;
} else {
newFileName += patchFileName;
}
outFileSpec.SetLeafName(newFileName); //????
outFileSpec.MakeUnique();
char *outFile = PL_strdup(nsNSPRPath(outFileSpec));
// apply patch to the source file
dd->fSrc = PR_Open ( realfile, PR_RDONLY, 0666);
dd->fOut = PR_Open ( outFile, PR_RDWR|PR_CREATE_FILE|PR_TRUNCATE, 0666);
if (dd->fSrc != NULL && dd->fOut != NULL)
{
status = gdiff_validateFile (dd, SRCFILE);
// specify why diff failed
if (status == GDIFF_ERR_CHECKSUM)
status = GDIFF_ERR_CHECKSUM_TARGET;
if (status == GDIFF_OK)
status = gdiff_ApplyPatch(dd);
if (status == GDIFF_OK)
status = gdiff_validateFile (dd, OUTFILE);
if (status == GDIFF_ERR_CHECKSUM)
status = GDIFF_ERR_CHECKSUM_RESULT;
if (status == GDIFF_OK)
{
*newFile = &outFileSpec;
if ( outFile != nsnull)
PL_strfree( outFile );
}
} else {
status = GDIFF_ERR_ACCESS;
}
}
#ifdef XP_MAC
if ( dd->bMacAppleSingle && status == GDIFF_OK )
{
// create another file, so that we can decode somewhere
nsFileSpec anotherName = outFileSpec;
anotherName.MakeUnique();
// Close the out file so that we can read it
PR_Close( dd->fOut );
dd->fOut = NULL;
FSSpec outSpec = outFileSpec.GetFSSpec();
FSSpec anotherSpec = anotherName.GetFSSpec();
status = PAS_DecodeFile(&outSpec, &anotherSpec);
if (status != noErr)
{
goto cleanup;
}
nsFileSpec parent;
outFileSpec.GetParent(parent);
outFileSpec.Delete(PR_FALSE);
anotherName.Copy(parent);
*newFile = &anotherName;
}
#endif
cleanup:
if ( dd != NULL )
{
if ( dd->fSrc != nsnull )
PR_Close( dd->fSrc );
if ( dd->fDiff != nsnull )
PR_Close( dd->fDiff );
if ( dd->fOut != nsnull )
{
PR_Close( dd->fOut );
}
if ( status != GDIFF_OK )
//XP_FileRemove( outfile, outtype );
newFile = NULL;
PR_FREEIF( dd->databuf );
PR_FREEIF( dd->oldChecksum );
PR_FREEIF( dd->newChecksum );
PR_DELETE(dd);
}
if ( tmpurl != NULL ) {
//XP_FileRemove( tmpurl, xpURL );
tmpurl = NULL;
PR_DELETE( tmpurl );
}
/* lets map any GDIFF error to nice SU errors */
switch (status)
{
case GDIFF_OK:
break;
case GDIFF_ERR_HEADER:
case GDIFF_ERR_BADDIFF:
case GDIFF_ERR_OPCODE:
case GDIFF_ERR_CHKSUMTYPE:
status = nsInstall::PATCH_BAD_DIFF;
break;
case GDIFF_ERR_CHECKSUM_TARGET:
status = nsInstall::PATCH_BAD_CHECKSUM_TARGET;
break;
case GDIFF_ERR_CHECKSUM_RESULT:
status = nsInstall::PATCH_BAD_CHECKSUM_RESULT;
break;
case GDIFF_ERR_OLDFILE:
case GDIFF_ERR_ACCESS:
case GDIFF_ERR_MEM:
case GDIFF_ERR_UNKNOWN:
default:
status = nsInstall::UNEXPECTED_ERROR;
break;
}
return status;
// return -1; //old return value
}
void*
nsInstallPatch::HashFilePath(const nsFilePath& aPath)
{
PRUint32 rv = 0;
char* cPath = PL_strdup(nsNSPRPath(aPath));
if(cPath != nsnull)
{
char ch;
char* filePath = PL_strdup(cPath);
PRUint32 cnt=0;
while ((ch = *filePath++) != 0)
{
// FYI: rv = rv*37 + ch
rv = ((rv << 5) + (rv << 2) + rv) + ch;
cnt++;
}
for (PRUint32 i=0; i<=cnt; i++)
*filePath--;
PL_strfree(filePath);
}
PL_strfree(cPath);
return (void*)rv;
}
/*---------------------------------------------------------
* gdiff_parseHeader()
*
* reads and validates the GDIFF header info
*---------------------------------------------------------
*/
static
int32 gdiff_parseHeader( pDIFFDATA dd )
{
int32 err = GDIFF_OK;
uint8 cslen;
uint8 oldcslen;
uint8 newcslen;
uint32 nRead;
uchar header[GDIFF_HEADERSIZE];
/* Read the fixed-size part of the header */
nRead = PR_Read (dd->fDiff, header, GDIFF_HEADERSIZE);
if ( nRead != GDIFF_HEADERSIZE ||
memcmp( header, GDIFF_MAGIC, GDIFF_MAGIC_LEN ) != 0 ||
header[GDIFF_VER_POS] != GDIFF_VER )
{
err = GDIFF_ERR_HEADER;
}
else
{
/* get the checksum information */
dd->checksumType = header[GDIFF_CS_POS];
cslen = header[GDIFF_CSLEN_POS];
if ( cslen > 0 )
{
oldcslen = cslen / 2;
newcslen = cslen - oldcslen;
PR_ASSERT( newcslen == oldcslen );
dd->checksumLength = oldcslen;
dd->oldChecksum = (uchar*)PR_MALLOC(oldcslen);
dd->newChecksum = (uchar*)PR_MALLOC(newcslen);
if ( dd->oldChecksum != NULL && dd->newChecksum != NULL )
{
nRead = PR_Read (dd->fDiff, dd->oldChecksum, oldcslen);
if ( nRead == oldcslen )
{
nRead = PR_Read (dd->fDiff, dd->newChecksum, newcslen);
if ( nRead != newcslen ) {
err = GDIFF_ERR_HEADER;
}
}
else {
err = GDIFF_ERR_HEADER;
}
}
else {
err = GDIFF_ERR_MEM;
}
}
/* get application data, if any */
if ( err == GDIFF_OK )
{
uint32 appdataSize;
uchar *buf;
uchar lenbuf[GDIFF_APPDATALEN];
nRead = PR_Read(dd->fDiff, lenbuf, GDIFF_APPDATALEN);
if ( nRead == GDIFF_APPDATALEN )
{
appdataSize = getlong(lenbuf);
if ( appdataSize > 0 )
{
buf = (uchar *)PR_MALLOC( appdataSize );
if ( buf != NULL )
{
nRead = PR_Read (dd->fDiff, buf, appdataSize);
if ( nRead == appdataSize )
{
if ( 0 == memcmp( buf, APPFLAG_W32BOUND, appdataSize ) )
dd->bWin32BoundImage = TRUE;
if ( 0 == memcmp( buf, APPFLAG_APPLESINGLE, appdataSize ) )
dd->bMacAppleSingle = TRUE;
}
else {
err = GDIFF_ERR_HEADER;
}
PR_DELETE( buf );
}
else {
err = GDIFF_ERR_MEM;
}
}
}
else {
err = GDIFF_ERR_HEADER;
}
}
}
return (err);
}
/*---------------------------------------------------------
* gdiff_validateFile()
*
* computes the checksum of the file and compares it to
* the value stored in the GDIFF header
*---------------------------------------------------------
*/
static
int32 gdiff_validateFile( pDIFFDATA dd, int file )
{
int32 result;
PRFileDesc* fh;
uchar* chksum;
/* which file are we dealing with? */
if ( file == SRCFILE ) {
fh = dd->fSrc;
chksum = dd->oldChecksum;
}
else { /* OUTFILE */
fh = dd->fOut;
chksum = dd->newChecksum;
}
/* make sure file's at beginning */
PR_Seek( fh, 0, PR_SEEK_SET );
/* calculate appropriate checksum */
switch (dd->checksumType)
{
case GDIFF_CS_NONE:
result = GDIFF_OK;
break;
case GDIFF_CS_CRC32:
if ( dd->checksumLength == CRC32_LEN )
result = gdiff_valCRC32( dd, fh, getlong(chksum) );
else
result = GDIFF_ERR_HEADER;
break;
case GDIFF_CS_MD5:
case GDIFF_CS_SHA:
default:
/* unsupported checksum type */
result = GDIFF_ERR_CHKSUMTYPE;
break;
}
/* reset file position to beginning and return status */
PR_Seek( fh, 0, PR_SEEK_SET );
return (result);
}
/*---------------------------------------------------------
* gdiff_valCRC32()
*
* computes the checksum of the file and compares it to
* the passed in checksum. Assumes file is positioned at
* beginning.
*---------------------------------------------------------
*/
static
int32 gdiff_valCRC32( pDIFFDATA dd, PRFileDesc* fh, uint32 chksum )
{
uint32 crc;
uint32 nRead;
crc = crc32(0L, Z_NULL, 0);
nRead = PR_Read (fh, dd->databuf, dd->bufsize);
while ( nRead > 0 )
{
crc = crc32( crc, dd->databuf, nRead );
nRead = PR_Read (fh, dd->databuf, dd->bufsize);
}
if ( crc == chksum )
return GDIFF_OK;
else
return GDIFF_ERR_CHECKSUM;
}
/*---------------------------------------------------------
* gdiff_ApplyPatch()
*
* Combines patch data with source file to produce the
* new target file. Assumes all three files have been
* opened, GDIFF header read, and all other setup complete
*
* The GDIFF patch is processed sequentially which random
* access is neccessary for the source file.
*---------------------------------------------------------
*/
static
int32 gdiff_ApplyPatch( pDIFFDATA dd )
{
int32 err;
XP_Bool done;
uint32 position;
uint32 count;
uchar opcode;
uchar cmdbuf[MAXCMDSIZE];
done = FALSE;
while ( !done ) {
err = gdiff_getdiff( dd, &opcode, OPSIZE );
if ( err != GDIFF_OK )
break;
switch (opcode)
{
case ENDDIFF:
done = TRUE;
break;
case ADD16:
err = gdiff_getdiff( dd, cmdbuf, ADD16SIZE );
if ( err == GDIFF_OK ) {
err = gdiff_add( dd, getshort( cmdbuf ) );
}
break;
case ADD32:
err = gdiff_getdiff( dd, cmdbuf, ADD32SIZE );
if ( err == GDIFF_OK ) {
err = gdiff_add( dd, getlong( cmdbuf ) );
}
break;
case COPY16BYTE:
err = gdiff_getdiff( dd, cmdbuf, COPY16BYTESIZE );
if ( err == GDIFF_OK ) {
position = getshort( cmdbuf );
count = *(cmdbuf + sizeof(short));
err = gdiff_copy( dd, position, count );
}
break;
case COPY16SHORT:
err = gdiff_getdiff( dd, cmdbuf, COPY16SHORTSIZE );
if ( err == GDIFF_OK ) {
position = getshort( cmdbuf );
count = getshort(cmdbuf + sizeof(short));
err = gdiff_copy( dd, position, count );
}
break;
case COPY16LONG:
err = gdiff_getdiff( dd, cmdbuf, COPY16LONGSIZE );
if ( err == GDIFF_OK ) {
position = getshort( cmdbuf );
count = getlong(cmdbuf + sizeof(short));
err = gdiff_copy( dd, position, count );
}
break;
case COPY32BYTE:
err = gdiff_getdiff( dd, cmdbuf, COPY32BYTESIZE );
if ( err == GDIFF_OK ) {
position = getlong( cmdbuf );
count = *(cmdbuf + sizeof(long));
err = gdiff_copy( dd, position, count );
}
break;
case COPY32SHORT:
err = gdiff_getdiff( dd, cmdbuf, COPY32SHORTSIZE );
if ( err == GDIFF_OK ) {
position = getlong( cmdbuf );
count = getshort(cmdbuf + sizeof(long));
err = gdiff_copy( dd, position, count );
}
break;
case COPY32LONG:
err = gdiff_getdiff( dd, cmdbuf, COPY32LONGSIZE );
if ( err == GDIFF_OK ) {
position = getlong( cmdbuf );
count = getlong(cmdbuf + sizeof(long));
err = gdiff_copy( dd, position, count );
}
break;
case COPY64:
/* we don't support 64-bit file positioning yet */
err = GDIFF_ERR_OPCODE;
break;
default:
err = gdiff_add( dd, opcode );
break;
}
if ( err != GDIFF_OK )
done = TRUE;
}
/* return status */
return (err);
}
/*---------------------------------------------------------
* gdiff_getdiff()
*
* reads the next "length" bytes of the diff into "buffer"
*
* XXX: need a diff buffer to optimize reads!
*---------------------------------------------------------
*/
static
int32 gdiff_getdiff( pDIFFDATA dd, uchar *buffer, uint32 length )
{
uint32 bytesRead;
bytesRead = PR_Read (dd->fDiff, buffer, length);
if ( bytesRead != length )
return GDIFF_ERR_BADDIFF;
return GDIFF_OK;
}
/*---------------------------------------------------------
* gdiff_add()
*
* append "count" bytes from diff file to new file
*---------------------------------------------------------
*/
static
int32 gdiff_add( pDIFFDATA dd, uint32 count )
{
int32 err = GDIFF_OK;
uint32 nRead;
uint32 chunksize;
while ( count > 0 ) {
chunksize = ( count > dd->bufsize) ? dd->bufsize : count;
nRead = PR_Read (dd->fDiff, dd->databuf, chunksize);
if ( nRead != chunksize ) {
err = GDIFF_ERR_BADDIFF;
break;
}
PR_Write (dd->fOut, dd->databuf, chunksize);
count -= chunksize;
}
return (err);
}
/*---------------------------------------------------------
* gdiff_copy()
*
* copy "count" bytes from "position" in source file
*---------------------------------------------------------
*/
static
int32 gdiff_copy( pDIFFDATA dd, uint32 position, uint32 count )
{
int32 err = GDIFF_OK;
uint32 nRead;
uint32 chunksize;
PR_Seek (dd->fSrc, position, PR_SEEK_SET);
while ( count > 0 ) {
chunksize = (count > dd->bufsize) ? dd->bufsize : count;
nRead = PR_Read (dd->fSrc, dd->databuf, chunksize);
if ( nRead != chunksize ) {
err = GDIFF_ERR_OLDFILE;
break;
}
PR_Write (dd->fOut, dd->databuf, chunksize);
count -= chunksize;
}
return (err);
}

View File

@@ -1,79 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsInstallPatch_h__
#define nsInstallPatch_h__
#include "prtypes.h"
#include "nsString.h"
#include "nsInstallObject.h"
#include "nsInstall.h"
#include "nsInstallFolder.h"
#include "nsInstallVersion.h"
class nsInstallPatch : public nsInstallObject
{
public:
nsInstallPatch( nsInstall* inInstall,
const nsString& inVRName,
const nsString& inVInfo,
const nsString& inJarLocation,
const nsString& folderSpec,
const nsString& inPartialPath,
PRInt32 *error);
nsInstallPatch( nsInstall* inInstall,
const nsString& inVRName,
const nsString& inVInfo,
const nsString& inJarLocation,
PRInt32 *error);
virtual ~nsInstallPatch();
PRInt32 Prepare();
PRInt32 Complete();
void Abort();
char* toString();
PRBool CanUninstall();
PRBool RegisterPackageNode();
private:
nsInstallVersion *mVersionInfo;
nsFileSpec *mTargetFile;
nsFileSpec *mPatchFile;
nsFileSpec *mPatchedFile;
nsString *mJarLocation;
nsString *mRegistryName;
PRInt32 NativePatch(const nsFileSpec &sourceFile, const nsFileSpec &patchfile, nsFileSpec **newFile);
void* HashFilePath(const nsFilePath& aPath);
};
#endif /* nsInstallPatch_h__ */

Some files were not shown because too many files have changed in this diff Show More