- Fix the db schema check functionality so that it will work with make_project and upgrade correctly. We no longer rely on svnversion for this sort of thing.

This commit is contained in:
Rom Walton 2012-10-24 17:55:26 -04:00 committed by Oliver Bock
parent 83211fd1c6
commit 02e70da914
4 changed files with 56 additions and 16 deletions

View File

@ -6349,3 +6349,16 @@ David 24 Oct 2012
client/
app.cpp,h
cpp_control.cpp
Rom 24 Oct 2012
- Fix the db schema check functionality so that it will work with make_project
and upgrade correctly. We no longer rely on svnversion for this sort of
thing.
db\
init_db
html\ops\
db_schemaversion.php
tools\
make_project
upgrade

View File

@ -0,0 +1,41 @@
#!/usr/bin/env php
<?php
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2008 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
// Perform DB updates.
// Used by "upgrade".
// Can also be run manually in project/html/ops.
require_once("../inc/util_ops.inc");
$db_revision = 0;
if (file_exists("../../db_revision")) {
$db_revision = (int) file_get_contents("../../db_revision");
}
require_once("db_update.php");
$updates = array();
foreach($db_updates as $db_update) {
if ($db_update[0] > $db_revision) {
$db_revision = $db_update[0];
}
}
echo "\n$db_version\n";
?>

View File

@ -287,18 +287,10 @@ t.disabled = 1
project.config.write()
svn_version_file = proot+'/local.revision'
try:
cmd = '/bin/sh -c \'/usr/bin/svnversion ' + options.srcdir + '\' > '+svn_version_file
os.system(cmd)
os.system('cd '+proot+'/html/ops; ./db_schemaversion.php > '+proot+'/db_revision')
except:
print '''Couldn't find svnversion'''
try:
cmd = '/bin/sh -c \'/usr/bin/svnversion ' + options.srcdir + '\' > '+proot+'/db_revision'
os.system(cmd)
except:
print '''Couldn't find svnversion'''
print '''Couldn't set db schema version number'''
try:
os.system('cd '+proot+'/html/ops; ./update_translations.php -d 1')

View File

@ -78,12 +78,6 @@ install_boinc_files(INSTALL_DIR, not options.server_only, not options.web_only)
print "Upgrading files... done"
print "Finding SVN revision"
svn_version_file = INSTALL_DIR+'/local.revision'
try:
os.system('/bin/sh -c /usr/bin/svnversion > '+svn_version_file)
except:
print '''Couldn't find svnversion'''
print "Updating translations"
try:
os.system('cd '+INSTALL_DIR+'/html/ops; ./update_translations.php -d 1')