diff --git a/py/Boinc/setup_project.py b/py/Boinc/setup_project.py index 58ebcb4fe5..14beb025d5 100644 --- a/py/Boinc/setup_project.py +++ b/py/Boinc/setup_project.py @@ -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,12 +580,15 @@ class Project: print >>f, "" f.close() - verbose_echo(1, "Setting up database") - database.create_database( - srcdir = options.srcdir, - config = self.config.config, - drop_first = options.drop_db_first - ) + 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, + config = self.config.config, + drop_first = options.drop_db_first + ) verbose_echo(1, "Writing config files") diff --git a/tools/make_project b/tools/make_project index 09a2ef5651..59aa8ff65a 100755 --- a/tools/make_project +++ b/tools/make_project @@ -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,10 +293,11 @@ t.disabled = 0 project.config.write() -try: - os.system('cd '+proot+'/html/ops; ./db_schemaversion.php > '+proot+'/db_revision') -except: - print '''Couldn't set db schema version number''' +if not options.no_db: + try: + os.system('cd '+proot+'/html/ops; ./db_schemaversion.php > '+proot+'/db_revision') + except: + print '''Couldn't set db schema version number''' try: os.system('cd '+proot+'/html/ops; ./update_translations.php -d 1')