summaryrefslogtreecommitdiffstats
path: root/checksetup.pl
diff options
context:
space:
mode:
authorbbaetz%student.usyd.edu.au <>2002-08-17 23:09:08 +0200
committerbbaetz%student.usyd.edu.au <>2002-08-17 23:09:08 +0200
commit0d951d3dd4ed821dcb71bd912052da6fb25594e1 (patch)
tree70442ef98fa50f945223cacfdf0e01280f141f8f /checksetup.pl
parent7891f2ead5f6f71cb2a10d71ad8c4cc98bf9a4d0 (diff)
downloadbugzilla-0d951d3dd4ed821dcb71bd912052da6fb25594e1.tar.gz
bugzilla-0d951d3dd4ed821dcb71bd912052da6fb25594e1.tar.xz
Bug 160112 - clean up quip table conversion code
r=joel x2
Diffstat (limited to 'checksetup.pl')
-rwxr-xr-xchecksetup.pl36
1 files changed, 13 insertions, 23 deletions
diff --git a/checksetup.pl b/checksetup.pl
index 4cf164f09..728db3798 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -658,7 +658,6 @@ unless (-d 'data' && -e 'data/nomail') {
# permissions for non-webservergroup are fixed later on
mkdir 'data', 0770;
mkdir 'data/mimedump-tmp', 01777;
- open FILE, '>>data/comments'; close FILE;
open FILE, '>>data/nomail'; close FILE;
open FILE, '>>data/mail'; close FILE;
}
@@ -3044,29 +3043,20 @@ if (!GetFieldDef("bugs", "alias")) {
# 2002-07-15 davef@tetsubo.com - bug 67950
# Move quips to the db.
-my $renamed_comments_file = 0;
-if (GetFieldDef("quips", "quipid")) {
- if (-e 'data/comments' && open (COMMENTS, "<data/comments")) {
- print "Populating quips table from data/comments...\n";
- while (<COMMENTS>) {
- chomp;
- $dbh->do("INSERT INTO quips (quip) VALUES ("
- . $dbh->quote($_) . ")");
- }
- print "The data/comments file (used to store quips) has been
- copied into the database, and the data/comments file
- moved to data/comments.bak - you can delete this file
- once you're satisfied the migration worked correctly.\n\n";
- close COMMENTS;
- rename("data/comments", "data/comments.bak") or next;
- $renamed_comments_file = 1;
+if (-r 'data/comments' && -s 'data/comments'
+ && open (COMMENTS, "<data/comments")) {
+ print "Populating quips table from data/comments...\n\n";
+ while (<COMMENTS>) {
+ chomp;
+ $dbh->do("INSERT INTO quips (quip) VALUES ("
+ . $dbh->quote($_) . ")");
}
-}
-
-# Warn if data/comments.bak exists, as it should be deleted.
-if (-e 'data/comments.bak' && !$renamed_comments_file) {
- print "The data/comments.bak file can be removed, as it's no longer
- used.\n\n";
+ print "The data/comments file (used to store quips) has been copied into\n" .
+ "the database, and the data/comments file moved to data/comments.bak - \n" .
+ "you can delete this fileonce you're satisfied the migration worked\n" .
+ "correctly.\n\n";
+ close COMMENTS;
+ rename("data/comments", "data/comments.bak");
}
# 2002-07-31 bbaetz@student.usyd.edu.au bug 158236