# HG changeset patch -- Bitbucket.org # Project galaxy-dist # URL http://bitbucket.org/galaxy/galaxy-dist/overview # User Nate Coraor <nate@bx.psu.edu> # Date 1288983302 14400 # Node ID 32e5efb7a7d5606a4dc1c8808fe4888ade2892e8 # Parent eb79ab327351e4789a89748269fc34428f791463 Remove the need for setup.sh - All configuration is done in run.sh/galaxy.config. --- a/run.sh +++ b/run.sh @@ -2,6 +2,53 @@ cd `dirname $0` +python ./scripts/check_python.py +[ $? -ne 0 ] && exit 1 + +FROM_SAMPLE=" + datatypes_conf.xml + reports_wsgi.ini + tool_conf.xml + tool_data_table_conf.xml + universe_wsgi.ini + tool-data/add_scores.loc + tool-data/alignseq.loc + tool-data/annotation_profiler_options.xml + tool-data/annotation_profiler_valid_builds.txt + tool-data/bfast_indexes.loc + tool-data/binned_scores.loc + tool-data/blastdb.loc + tool-data/blastdb_p.loc + tool-data/bowtie_indices.loc + tool-data/bowtie_indices_color.loc + tool-data/codingSnps.loc + tool-data/encode_datasets.loc + tool-data/funDo.loc + tool-data/lastz_seqs.loc + tool-data/liftOver.loc + tool-data/maf_index.loc + tool-data/maf_pairwise.loc + tool-data/microbial_data.loc + tool-data/phastOdds.loc + tool-data/perm_base_index.loc + tool-data/perm_color_index.loc + tool-data/quality_scores.loc + tool-data/regions.loc + tool-data/sam_fa_indices.loc + tool-data/sift_db.loc + tool-data/srma_index.loc + tool-data/twobit.loc + tool-data/shared/ucsc/builds.txt +" + +# Create any missing config/location files +for file in $FROM_SAMPLE; do + if [ ! -f "$file" -a -f "$file.sample" ]; then + echo "Initializing $file from `basename $file`.sample" + cp $file.sample $file + fi +done + # explicitly attempt to fetch eggs before running FETCH_EGGS=1 for arg in "$@"; do @@ -21,10 +68,4 @@ if [ $FETCH_EGGS -eq 1 ]; then fi fi -# Temporary: since builds.txt is now removed from source control, create it -# from the sample if necessary -if [ ! -f "tool-data/shared/ucsc/builds.txt" ]; then - cp tool-data/shared/ucsc/builds.txt.sample tool-data/shared/ucsc/builds.txt -fi - python ./scripts/paster.py serve universe_wsgi.ini $@ --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -94,14 +94,8 @@ class Configuration( object ): self.blog_url = kwargs.get( 'blog_url', None ) self.screencasts_url = kwargs.get( 'screencasts_url', None ) self.library_import_dir = kwargs.get( 'library_import_dir', None ) - if self.library_import_dir is not None and not os.path.exists( self.library_import_dir ): - raise ConfigurationError( "library_import_dir specified in config (%s) does not exist" % self.library_import_dir ) self.user_library_import_dir = kwargs.get( 'user_library_import_dir', None ) - if self.user_library_import_dir is not None and not os.path.exists( self.user_library_import_dir ): - raise ConfigurationError( "user_library_import_dir specified in config (%s) does not exist" % self.user_library_import_dir ) self.ftp_upload_dir = kwargs.get( 'ftp_upload_dir', None ) - if self.ftp_upload_dir is not None and not os.path.exists( self.ftp_upload_dir ): - os.makedirs( self.ftp_upload_dir ) self.ftp_upload_site = kwargs.get( 'ftp_upload_site', None ) self.allow_library_path_paste = kwargs.get( 'allow_library_path_paste', False ) self.disable_library_comptypes = kwargs.get( 'disable_library_comptypes', '' ).lower().split( ',' ) @@ -159,9 +153,16 @@ class Configuration( object ): return default def check( self ): # Check that required directories exist - for path in self.root, self.file_path, self.tool_path, self.tool_data_path, self.template_path, self.job_working_directory, self.cluster_files_directory: + for path in self.root, self.tool_path, self.tool_data_path, self.template_path: if not os.path.isdir( path ): raise ConfigurationError("Directory does not exist: %s" % path ) + # Create the directories that it makes sense to create + for path in self.file_path, self.new_file_path, self.job_working_directory, self.cluster_files_directory, self.template_cache, self.ftp_upload_dir, self.library_import_dir, self.user_library_import_dir, self.nginx_upload_store, './static/genetrack/plots', os.path.join( self.tool_data_path, 'shared', 'jars' ): + if path not in [ None, False ] and not os.path.isdir( path ): + try: + os.makedirs( path ) + except Exception, e: + raise ConfigurationError( "Unable to create missing directory: %s\n%s" % ( path, e ) ) # Check that required files exist for path in self.tool_config, self.datatypes_config: if not os.path.isfile(path):