Skip to content

Commit

Permalink
Use print_warning and add debug-log to update_config_guess
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamefire committed Feb 20, 2020
1 parent 727661a commit 86d0a06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions easybuild/easyblocks/generic/configuremake.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
def check_config_guess(config_guess, log=None):
"""Check timestamp & SHA256 checksum of config.guess script.
:param configu_gess: Path to config.guess script to check
:param config_guess: Path to config.guess script to check
:param log: Instance of a logger to use or None to run in quiet mode
:return: Whether the script is valid (matches the version and checksum)
"""
Expand Down Expand Up @@ -100,12 +100,13 @@ def check_config_guess(config_guess, log=None):
result = False
tup = (config_guess, config_guess_version, CONFIG_GUESS_VERSION)
if log:
log.warning("config.guess version at %s does not match expected version: %s vs %s" % tup)
print_warning("config.guess version at %s does not match expected version: %s vs %s" % tup, log=log)
if config_guess_checksum != CONFIG_GUESS_SHA256:
result = False
tup = (config_guess, config_guess_checksum, CONFIG_GUESS_SHA256)
if log:
log.warning("SHA256 checksum of config.guess at %s does not match expected checksum: %s vs %s" % tup)
print_warning("SHA256 checksum of config.guess at %s does not match expected checksum: %s vs %s" % tup,
log=log)

return result

Expand Down
8 changes: 4 additions & 4 deletions easybuild/easyblocks/generic/rpackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
@author: Balazs Hajgato (Vrije Universiteit Brussel)
"""
import os
import shutil

from easybuild.easyblocks.r import EXTS_FILTER_R_PACKAGES, EB_R
from easybuild.easyblocks.generic.configuremake import check_config_guess, obtain_config_guess
Expand Down Expand Up @@ -175,13 +174,14 @@ def install_R_package(self, cmd, inp=None):
else:
self.log.debug("R package %s installed succesfully" % self.name)

def update_config_guess(self, src_dir):
"""Update any config.guess found in src_dir"""
for config_guess_dir in (root for root, _, files in os.walk(src_dir) if 'config.guess' in files):
def update_config_guess(self, path):
"""Update any config.guess found in specified directory"""
for config_guess_dir in (root for root, _, files in os.walk(path) if 'config.guess' in files):
config_guess = os.path.join(config_guess_dir, 'config.guess')
if not check_config_guess(config_guess):
updated_config_guess = obtain_config_guess(log=self.log)
copy_file(updated_config_guess, config_guess)
self.log.debug("Replacing outdated %s with more recent copy at %s", config_guess, updated_config_guess)

def install_step(self):
"""Install procedure for R packages."""
Expand Down

0 comments on commit 86d0a06

Please sign in to comment.