Skip to content

Commit

Permalink
fix all the things
Browse files Browse the repository at this point in the history
  • Loading branch information
Toon Willems committed Aug 14, 2014
1 parent 2ef71c0 commit 46ca7e3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
31 changes: 22 additions & 9 deletions easybuild/framework/easyconfig/easyconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,22 +883,35 @@ def find_related_easyconfigs(path, ec):
toolchain = "%s-%s" % (toolchain_name, ec['toolchain']['version'])
full_version = det_full_ec_version(ec)

patterns = [
potential_paths = [os.path.dirname(path) for path in create_paths(path, name, version)]
result_potential_paths = []

for pot in potential_paths:
try:
result_potential_paths.append([os.path.join(pot,base) for base in os.listdir(pot) if os.path.isfile(os.path.join(pot,base))])
except:
None

# flatten
result_potential_paths = sum(result_potential_paths, [])

regexes = [
# exact match
("%s-%s" % (name, full_version)),
re.compile(("^\S*/%s-%s.eb$" % (name, full_version))),
# same version, same toolchain name
("%s-%s-%s-*" % (name, version, toolchain_name)),
re.compile(("^\S*/%s-%s-%s-\S*.eb$" % (name, version, toolchain_name))),
# Same version, any toolchain
("%s-%s-*" % (name, version)),
re.compile(("^\S*/%s-%s-\S*.eb$" % (name, version))),
# any version, same toolchain
("%s-*-%s-*" % (name, toolchain)),
re.compile(("^\S*/%s-\S*-%s-\S*.eb$" % (name, toolchain))),
# any version, same toolchain name
("%s-*-%s-*" % (name, toolchain_name)),
# any version, any toolchain
("*"),
re.compile(("^\S*/%s-\S*-%s-\S*.eb$" % (name, toolchain_name))),
]
_log.debug("found these potential paths: %s" % result_potential_paths)

return [glob.glob("%s.eb" % os.path.join(path, name.lower()[0], name, *cand_path)) for cand_path in patterns]
result = [filter(lambda path: regex.match(path),result_potential_paths) for regex in regexes]
result.append(result_potential_paths)
return result


def process_easyconfig(path, build_specs=None, validate=True, parse_only=False):
Expand Down
1 change: 0 additions & 1 deletion easybuild/framework/easyconfig/review.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# #
# Copyright 2014 Ghent University
#
Expand Down
3 changes: 0 additions & 3 deletions easybuild/tools/multi_diff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# #
# Copyright 2014 Ghent University
#
Expand Down Expand Up @@ -167,8 +166,6 @@ def _colorize(self, line, squigly):
chars.insert(0, color_map.get(line[0],''))
chars.append(ENDC)



return ''.join(chars)

def _color(self, line, color):
Expand Down
1 change: 0 additions & 1 deletion easybuild/tools/terminal.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# #
# Copyright 2009-2014 Ghent University
#
Expand Down

0 comments on commit 46ca7e3

Please sign in to comment.