|
44 | 44 | from easybuild.easyblocks import VERSION as EASYBLOCKS_VERSION |
45 | 45 | from easybuild.framework.easyblock import EasyBlock |
46 | 46 | from easybuild.framework.easyconfig import CUSTOM |
47 | | -from easybuild.tools.build_log import print_warning |
| 47 | +from easybuild.tools.build_log import print_warning, EasyBuildError |
48 | 48 | from easybuild.tools.config import source_paths, build_option |
49 | 49 | from easybuild.tools.filetools import CHECKSUM_TYPE_SHA256, adjust_permissions, compute_checksum, download_file |
50 | 50 | from easybuild.tools.filetools import read_file, remove_file |
@@ -106,29 +106,24 @@ def check_config_guess(config_guess): |
106 | 106 | return result |
107 | 107 |
|
108 | 108 |
|
109 | | -def obtain_config_guess(download_source_path=None, search_source_paths=None): |
| 109 | +def obtain_config_guess(): |
110 | 110 | """ |
111 | 111 | Locate or download an up-to-date config.guess |
112 | 112 |
|
113 | | - :param download_source_path: Path to download config.guess to |
114 | | - :param search_source_paths: Paths to search for config.guess |
115 | 113 | :return: Path to config.guess or None |
116 | 114 | """ |
117 | 115 | log = fancylogger.getLogger('config.guess') |
118 | 116 |
|
119 | | - eb_source_paths = source_paths() |
120 | | - if download_source_path is None: |
121 | | - download_source_path = eb_source_paths[0] |
122 | | - if search_source_paths is None: |
123 | | - search_source_paths = eb_source_paths |
| 117 | + search_source_paths = source_paths() |
| 118 | + download_source_path = search_source_paths[0] |
124 | 119 |
|
125 | 120 | config_guess = 'config.guess' |
126 | 121 | sourcepath_subdir = os.path.join('generic', 'eb_v%s' % EASYBLOCKS_VERSION, 'ConfigureMake') |
127 | 122 |
|
128 | 123 | config_guess_path = None |
129 | 124 |
|
130 | 125 | # check if config.guess has already been downloaded to source path |
131 | | - for path in eb_source_paths: |
| 126 | + for path in search_source_paths: |
132 | 127 | cand_config_guess_path = os.path.join(path, sourcepath_subdir, config_guess) |
133 | 128 | if os.path.isfile(cand_config_guess_path) and check_config_guess(cand_config_guess_path): |
134 | 129 | force_download = build_option('force_download') |
@@ -187,15 +182,17 @@ def __init__(self, *args, **kwargs): |
187 | 182 |
|
188 | 183 | self.config_guess = None |
189 | 184 |
|
190 | | - def obtain_config_guess(self, download_source_path=None, search_source_paths=None): |
| 185 | + def obtain_config_guess(self, *args, **kwargs): |
191 | 186 | """ |
192 | 187 | Locate or download an up-to-date config.guess for use with ConfigureMake |
193 | 188 |
|
194 | | - :param download_source_path: Path to download config.guess to |
195 | | - :param search_source_paths: Paths to search for config.guess |
| 189 | + No arguments allowed |
196 | 190 | :return: Path to config.guess or None |
197 | 191 | """ |
198 | | - return obtain_config_guess(download_source_path, search_source_paths) |
| 192 | + if args or kwargs: |
| 193 | + raise EasyBuildError("Support for passing arguments to 'obtain_config_guess' has been removed " |
| 194 | + "and 'source_paths' will always be used") |
| 195 | + return obtain_config_guess() |
199 | 196 |
|
200 | 197 | def check_config_guess(self): |
201 | 198 | """Check timestamp & SHA256 checksum of config.guess script.""" |
|
0 commit comments