added --no_db option to make_project

This commit is contained in:
marius 2015-07-20 15:46:52 -07:00
parent 0192970350
commit d384489952
2 changed files with 21 additions and 10 deletions

View File

@ -455,12 +455,14 @@ class Project:
master_url=None,
db_name=None,
web_only=False,
no_db=False,
production=False
):
init()
self.production = production
self.web_only = web_only
self.no_db = no_db
self.short_name = short_name
self.long_name = long_name or 'Project ' + self.short_name.replace('_',' ').capitalize()
@ -578,6 +580,9 @@ class Project:
print >>f, "<link rel=\"boinc_scheduler\" href=\"" + self.scheduler_url.strip()+ "\">"
f.close()
if self.no_db:
verbose_echo(1, "Not setting up database (--no_db was specified)")
else:
verbose_echo(1, "Setting up database")
database.create_database(
srcdir = options.srcdir,

View File

@ -35,6 +35,7 @@ Misc options:
--drop_db_first drop database first (from prev installation)
--test_app install example application
--web_only install web files, no executables (for Bossa, Bolt)
--no_db don't create the database
--srcdir where to find the source files (default: current directory)
Dir-options:
@ -76,6 +77,7 @@ try:
'no_query',
'test_app',
'web_only',
'no_db',
'srcdir=',
'user_name=',
'drop_db_first',
@ -99,6 +101,7 @@ options.url_base = None
options.no_query = False
options.test_app = False
options.web_only = False
options.no_db = False
options.delete_prev_inst = False
options.srcdir = None
@ -109,6 +112,7 @@ for o,a in opts:
elif o == '--no_query': options.no_query = True
elif o == '--test_app': options.test_app = True
elif o == '--web_only': options.web_only = True
elif o == '--no_db': options.no_db = True
elif o == '--srcdir': options.srcdir = a
elif o == '--user_name': options.user_name = a
elif o == '--drop_db_first': options.drop_db_first = True
@ -215,6 +219,7 @@ project = Project(
key_dir = options.key_dir,
db_name = options.db_name,
web_only = options.web_only,
no_db = options.no_db,
production = True
)
@ -288,9 +293,10 @@ t.disabled = 0
project.config.write()
try:
if not options.no_db:
try:
os.system('cd '+proot+'/html/ops; ./db_schemaversion.php > '+proot+'/db_revision')
except:
except:
print '''Couldn't set db schema version number'''
try: