From 1b45faadd1f3a4e080a53dafd3edee4dc753833d Mon Sep 17 00:00:00 2001 From: "dave%intrec.com" <> Date: Wed, 7 Mar 2001 11:09:29 +0000 Subject: Fix for bug 62949: Initial Test Component on new install did not have initialOwner, which made sanitycheck complain. --- checksetup.pl | 61 +++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 27 deletions(-) (limited to 'checksetup.pl') diff --git a/checksetup.pl b/checksetup.pl index a23ba6a50..abc3fea44 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -1037,32 +1037,6 @@ if (!GroupExists("canconfirm")) { -########################################################################### -# Create initial test product if there are no products present. -########################################################################### - -my $sth = $dbh->prepare("SELECT product FROM products"); -$sth->execute; -unless ($sth->rows) { - print "Creating initial dummy product 'TestProduct' ...\n"; - $dbh->do('INSERT INTO products(product, description, milestoneurl, disallownew, votesperuser, votestoconfirm) VALUES ("TestProduct", - "This is a test product. This ought to be blown away and ' . - 'replaced with real stuff in a finished installation of ' . - 'bugzilla.", "", 0, 0, 0)'); - $dbh->do('INSERT INTO versions (value, program) VALUES ("other", "TestProduct")'); - $dbh->do('INSERT INTO components (value, program, description, initialowner, initialqacontact) - VALUES (' . - '"TestComponent", "TestProduct", ' . - '"This is a test component in the test product database. ' . - 'This ought to be blown away and replaced with real stuff in ' . - 'a finished installation of bugzilla.", "", "")'); - $dbh->do('INSERT INTO milestones (product, value) VALUES ("TestProduct","---")'); -} - - - - - ########################################################################### # Populate the list of fields. ########################################################################### @@ -1249,7 +1223,7 @@ sub bailout { # this is just in case we get interrupted while getting passwd exit 1; } -$sth = $dbh->prepare(<<_End_Of_SQL_); +my $sth = $dbh->prepare(<<_End_Of_SQL_); SELECT login_name FROM profiles WHERE groupset=9223372036854775807 @@ -1371,6 +1345,39 @@ _End_Of_SQL_ } +########################################################################### +# Create initial test product if there are no products present. +########################################################################### + +$sth = $dbh->prepare(<<_End_Of_SQL_); + SELECT userid + FROM profiles + WHERE groupset=9223372036854775807 +_End_Of_SQL_ +$sth->execute; +my ($adminuid) = $sth->fetchrow_array; +if (!$adminuid) { die "No administator!" } # should never get here +$sth = $dbh->prepare("SELECT product FROM products"); +$sth->execute; +unless ($sth->rows) { + print "Creating initial dummy product 'TestProduct' ...\n"; + $dbh->do('INSERT INTO products(product, description, milestoneurl, disallownew, votesperuser, votestoconfirm) VALUES ("TestProduct", + "This is a test product. This ought to be blown away and ' . + 'replaced with real stuff in a finished installation of ' . + 'bugzilla.", "", 0, 0, 0)'); + $dbh->do('INSERT INTO versions (value, program) VALUES ("other", "TestProduct")'); + $dbh->do("INSERT INTO components (value, program, description, initialowner, initialqacontact) + VALUES (" . + "'TestComponent', 'TestProduct', " . + "'This is a test component in the test product database. " . + "This ought to be blown away and replaced with real stuff in " . + "a finished installation of bugzilla.', $adminuid, 0)"); + $dbh->do('INSERT INTO milestones (product, value) VALUES ("TestProduct","---")'); +} + + + + ########################################################################### # Update the tables to the current definition -- cgit v1.2.3-24-g4f1b