X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=commands%2Fsource.py;h=23b41d70c746ad7b28ca0f61ae7804d46b863f69;hb=fe93dec3df59f9238c50e52cce21d939fa4ccc1c;hp=7b2131e583ed4e7789e3f8b3ee06576d19abd708;hpb=835d4b3877b73a1be09835bc5ed53114f86e54fa;p=tools%2Fsat.git diff --git a/commands/source.py b/commands/source.py index 7b2131e..23b41d7 100644 --- a/commands/source.py +++ b/commands/source.py @@ -130,9 +130,10 @@ def get_source_from_git(product_info, return retcode -def get_source_from_archive(product_info, source_dir, logger): +def get_source_from_archive(config, product_info, source_dir, logger): '''The method called if the product is to be get in archive mode + :param config Config: The global configuration :param product_info Config: The configuration specific to the product to be prepared :param source_dir Path: The Path instance corresponding to the @@ -143,8 +144,17 @@ def get_source_from_archive(product_info, source_dir, logger): ''' # check archive exists if not os.path.exists(product_info.archive_info.archive_name): - raise src.SatException(_("Archive not found in config.PATHS.ARCHIVEPATH: '%s'") % - product_info.archive_info.archive_name) + # The archive is not found on local file system (ARCHIVEPATH) + # We try ftp! + logger.write("\n The archive is not found on local file system, we try ftp\n", 3) + ret=src.find_file_in_ftppath(product_info.archive_info.archive_name, + config.PATHS.ARCHIVEFTP, config.LOCAL.archive_dir, logger) + if ret: + # archive was found on ftp and stored in ret + product_info.archive_info.archive_name=ret + else: + raise src.SatException(_("Archive not found in ARCHIVEPATH, nor on ARCHIVEFTP: '%s'") % + product_info.archive_info.archive_name) logger.write('arc:%s ... ' % src.printcolors.printcInfo(product_info.archive_info.archive_name), @@ -346,7 +356,7 @@ def get_product_sources(config, is_dev,env_appli) if product_info.get_source == "archive": - return get_source_from_archive(product_info, source_dir, logger) + return get_source_from_archive(config, product_info, source_dir, logger) if product_info.get_source == "dir": return get_source_from_dir(product_info, source_dir, logger)