/usr/share/boinc-server/tools/upgrade is in boinc-server-maker 7.0.24+dfsg-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | #!/usr/bin/env python
# $Id: upgrade 23358 2011-04-09 03:10:29Z davea $
'''
Usage: upgrade [options] project_root
Options:
--srcdir default: current directory
Copy source/build files to a project tree,
overwriting what's already there.
Run it in the source directory (tools/upgrade).
If project_root is an absolute path, it's the project root.
Otherwise the project root is HOME/projects/project_root.
'''
import boinc_path_config
from Boinc import boinc_project_path, tools
from Boinc.setup_project import *
import os, getopt
def usage():
print "Usage: upgrade [--web_only | --server_only] [--srcdir DIR] project_root"
raise SystemExit
def syntax_error(str):
raise SystemExit('%s; See "%s --help" for help\n' % (str, sys.argv[0]))
try:
opts, args = getopt.getopt(sys.argv[1:], '', ['help', 'web_only', 'server_only', 'srcdir='])
except getopt.GetoptError, e:
syntax_error(e)
home = os.path.expanduser('~')
options.web_only = False
options.server_only = False
options.srcdir = None
for o,a in opts:
if o == '--help': usage()
elif o == '--web_only': options.web_only = True
elif o == '--server_only': options.server_only = True
elif o == '--srcdir': options.srcdir = a
else:
raise SystemExit('internal error o=%s'%o)
if len(args) == 1:
if os.path.isabs(args[0]):
INSTALL_DIR = args[0]
else:
INSTALL_DIR = os.path.join(home, 'projects', args[0])
else:
syntax_error('No project name')
if not options.srcdir:
for dir in ('.', '..'):
if os.path.exists(os.path.join(dir, 'html', 'project.sample', 'project.inc')):
options.srcdir = dir
if not options.srcdir:
syntax_error('Not running in the source directory and --srcdir was not specified')
if not tools.query_noyes("Overwrite files in "+INSTALL_DIR):
raise SystemExit
if not options.web_only:
if os.system('cd '+INSTALL_DIR+'; ./bin/stop'):
raise SystemExit("Couldn't stop project!")
print "Upgrading files... "
options.install_method = 'copy'
init()
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')
except:
print '''Couldn't install translation files'''
opt = '';
if options.server_only:
opt = ' --server'
if options.web_only:
opt = ' --web'
print "Checking for DB upgrades"
os.system('cd '+INSTALL_DIR+'/html/ops; ./upgrade_db.php'+opt)
if os.path.exists(INSTALL_DIR+'/html/project/project_news.inc'):
print '''\
html/project/project_news.inc is deprecated.
Run html/ops/news_convert.php to convert project news to forum format.
'''
if not options.web_only:
print "Run `bin/start' to restart the project."
|