landing final patch for bug 76261

This commit is contained in:
tara%tequilarista.org 2001-04-19 17:19:07 +00:00
parent 1e55a5b67a
commit 4aeb7565b6
4 changed files with 26 additions and 19 deletions

View File

@ -451,7 +451,7 @@ unless (-d 'data') {
print "Creating data directory ...\n";
mkdir 'data', 0770;
if ($my_webservergroup eq "") {
chmod 0777, 'data';
chmod 1777, 'data';
}
open FILE, '>>data/comments'; close FILE;
open FILE, '>>data/nomail'; close FILE;
@ -545,7 +545,7 @@ if ($my_webservergroup) {
# make sure that contrib keeps the permissions it had (don't touch it)
chmod 0770, 'data', 'shadow', 'graphs';
chmod 0666, glob('data/*');
chmod 0777, glob('data/*/'); # directories stay executable
chmod 1777, glob('data/*/'); # directories stay executable
}
@ -2058,9 +2058,9 @@ if (!($sth->fetchrow_arrayref()->[0])) {
# a Bugzilla with the old data format, and so upgrade their data files.
unless (-d 'graphs') {
print "Creating graphs directory...\n";
mkdir 'graphs', 0770;
mkdir 'graphs', 1770;
if ($my_webservergroup eq "") {
chmod 0777, 'graphs';
chmod 1777, 'graphs';
}
# Upgrade data format
@ -2137,16 +2137,14 @@ unless (-d 'graphs') {
}
}
#
# 2000-12-18. Added an 'emailflags' field for storing preferences about
# when email gets sent on a per-user basis.
#
if (!GetFieldDef('profiles', 'emailflags')) {
AddField('profiles', 'emailflags', 'mediumtext');
}
# http://bugzilla.mozilla.org/show_bug.cgi?id=61637
# upgrade older versions of bugzilla that have the old comments table
# 2000-11-27 For Bugzilla 2.5 and later. Change table 'comments' to
# 'longdescs' - the new name of the comments table.
if (&TableExists('comments')) {
RenameField ('comments', 'when', 'bug_when');
ChangeFieldType('comments', 'bug_id', 'mediumint not null');
@ -2158,7 +2156,15 @@ if (&TableExists('comments')) {
$dbh->do("ALTER TABLE comments RENAME longdescs");
}
#
# 2001-04-08 Added a special directory for the duplicates stats.
unless (-d 'data/duplicates') {
print "Creating duplicates directory...\n";
mkdir 'data/duplicates', 0770;
if ($my_webservergroup eq "") {
chmod 1777, 'data/duplicates';
}
}
# If you had to change the --TABLE-- definition in any way, then add your
# differential change code *** A B O V E *** this comment.
#

View File

@ -130,11 +130,11 @@ sub calculate_dupes {
# Save % count here in a date-named file
# so we can read it back in to do changed counters
# First, delete it if it exists, so we don't add to the contents of an old file
if (-e "data/mining/dupes$today") {
system("rm -f data/mining/dupes$today");
if (<data/duplicates/dupes$today*>) {
system("rm -f data/duplicates/dupes$today*");
}
dbmopen(%count, "data/mining/dupes$today", 0644) || die "Can't open DBM dupes file: $!";
dbmopen(%count, "data/duplicates/dupes$today", 0644) || die "Can't open DBM dupes file: $!";
# Create a hash with key "a bug number", value "bug which that bug is a
# direct dupe of" - straight from the duplicates table.

View File

@ -297,7 +297,8 @@ DefParam("mostfreqhtml",
<blockquote>The Most Frequent Bugs page lists the known open bugs which
are reported most frequently in recent builds of Mozilla. It is automatically
generated from the Bugzilla database.
generated from the Bugzilla database every 24 hours, by counting the number
of direct and indirect duplicates of bugs.
This information is provided in order to assist in minimizing
the amount of duplicate bugs entered into Bugzilla which in turn cuts down
on development time.

View File

@ -69,18 +69,18 @@ PutHeader("Most Frequently Reported Bugs");
# Open today's record of dupes
my $today = &days_ago(0);
if (-e "data/mining/dupes$today.db")
if (<data/duplicates/dupes$today*>)
{
dbmopen(%dbmcount, "data/mining/dupes$today", 0644) ||
dbmopen(%dbmcount, "data/duplicates/dupes$today", 0644) ||
&die_politely("Can't open today's dupes file: $!");
}
else
{
# Try yesterday's, then (in case today's hasn't been created yet)
$today = &days_ago(1);
if (-e "data/mining/dupes$today.db")
if (<data/duplicates/dupes$today*>)
{
dbmopen(%dbmcount, "data/mining/dupes$today", 0644) ||
dbmopen(%dbmcount, "data/duplicates/dupes$today", 0644) ||
&die_politely("Can't open yesterday's dupes file: $!");
}
else
@ -107,9 +107,9 @@ while (($key, $value) = each %count)
# Try and open the database from "changedsince" days ago
$before = &days_ago($changedsince);
if (-e "data/mining/dupes$before.db")
if (<data/duplicates/dupes$before*>)
{
dbmopen(%before, "data/mining/dupes$before", 0644) && ($dobefore = 1);
dbmopen(%before, "data/duplicates/dupes$before", 0644) && ($dobefore = 1);
}
print Param("mostfreqhtml");