Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions easybuild/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
from easybuild.tools.config import find_last_log, get_repository, get_repositorypath, build_option
from easybuild.tools.containers.common import containerize
from easybuild.tools.docs import list_software
from easybuild.tools.filetools import adjust_permissions, cleanup, write_file
from easybuild.tools.filetools import adjust_permissions, cleanup, read_file, write_file
from easybuild.tools.github import check_github, close_pr, new_branch_github, find_easybuild_easyconfig
from easybuild.tools.github import install_github_token, list_prs, new_pr, new_pr_from_branch, merge_pr
from easybuild.tools.github import sync_branch_with_develop, sync_pr_with_develop, update_branch, update_pr
Expand Down Expand Up @@ -302,8 +302,14 @@ def main(args=None, logfile=None, do_build=None, testing=False, modtool=None):
# determine paths to easyconfigs
determined_paths = det_easyconfig_paths(categorized_paths['easyconfigs'])

if options.fix_deprecated_easyconfigs:
fix_deprecated_easyconfigs(determined_paths)
if options.fix_deprecated_easyconfigs or options.show_ec:
if options.fix_deprecated_easyconfigs:
fix_deprecated_easyconfigs(determined_paths)
elif options.show_ec:
for path in determined_paths:
print_msg("Contents of %s:" % path)
print_msg(read_file(path), prefix=False)

clean_exit(logfile, eb_tmpdir, testing)

if determined_paths:
Expand Down
1 change: 1 addition & 0 deletions easybuild/tools/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@ def informative_options(self):
'show-default-configfiles': ("Show list of default config files", None, 'store_true', False),
'show-default-moduleclasses': ("Show default module classes with description",
None, 'store_true', False),
'show-ec': ("Show contents of specified easyconfig(s)", None, 'store_true', False),
'show-full-config': ("Show current EasyBuild configuration (all settings)", None, 'store_true', False),
'show-system-info': ("Show system information relevant to EasyBuild", None, 'store_true', False),
'terse': ("Terse output (machine-readable)", None, 'store_true', False),
Expand Down
29 changes: 29 additions & 0 deletions test/framework/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,35 @@ def test_search_archived(self):
])
self.assertEqual(txt, expected)

def test_show_ec(self):
"""Test 'eb --show-ec'."""

args = [
'--show-ec',
'toy-0.0.eb',
'gzip-1.6-GCC-4.9.2.eb',
]
self.mock_stderr(True)
self.mock_stdout(True)
self.eb_main(args)
stderr, stdout = self.get_stderr(), self.get_stdout()
self.mock_stderr(False)
self.mock_stdout(False)

self.assertFalse(stderr)
patterns = [
r"^== Contents of .*/test/framework/easyconfigs/test_ecs/t/toy/toy-0.0.eb:",
r"^name = 'toy'",
r"^toolchain = SYSTEM",
r"^sanity_check_paths = {\n 'files': \[\('bin/yot', 'bin/toy'\)\],",
r"^== Contents of .*/test/framework/easyconfigs/test_ecs/g/gzip/gzip-1.6-GCC-4.9.2.eb:",
r"^easyblock = 'ConfigureMake'\n\nname = 'gzip'",
r"^toolchain = {'name': 'GCC', 'version': '4.9.2'}",
]
for pattern in patterns:
regex = re.compile(pattern, re.M)
self.assertTrue(regex.search(stdout), "Pattern '%s' found in: %s" % (regex.pattern, stdout))

def test_dry_run(self):
"""Test dry run (long format)."""
fd, dummylogfn = tempfile.mkstemp(prefix='easybuild-dummy', suffix='.log')
Expand Down