diff --git a/CHANGELOG.md b/CHANGELOG.md index 869061a8..0faa56f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The client here will eventually be released as "spython" (and eventually to singularity on pypi), and the versions here will coincide with these releases. ## [master](https://github.com/singularityhub/singularity-cli/tree/master) + - continued lines should not be split in docker.py recipe parser (_setup) (0.0.49) - COPY command should honor src src dest (and not reverse) (0.0.48) - adding support for instance list (0.0.47) - ENV variables in Dockerfile can be empty (like unsetting) (0.0.46) diff --git a/spython/main/parse/docker.py b/spython/main/parse/docker.py index 14904615..e720e4ff 100644 --- a/spython/main/parse/docker.py +++ b/spython/main/parse/docker.py @@ -48,7 +48,10 @@ def _setup(self, action, line): bot.debug('[in] %s' % line) # Replace ACTION at beginning - line = re.sub('^%s' %action, '', line) + line = re.sub('^%s' % action, '', line) + + # Handle continuation lines without ACTION by padding with leading space + line = " " + line # Split into components return [x for x in self._split_line(line) if x not in ['', None]] @@ -372,25 +375,7 @@ def _label(self, line): self.labels += [ label ] -# Main Parsing Functions - - - def _split_line(self, line): - '''clean a line to prepare it for parsing, meaning separation - of the Docker command (e.g., RUN) from the remainder. We remove - newlines (from ends) along with extra spaces. - - Parameters - ========== - line: the string to parse into parts - - Returns - ======= - parts: a list of line pieces, the command is likely first - - ''' - return [x.strip() for x in line.split(' ', 1)] - +# Main Parsing Functions def _get_mapping(self, line, parser=None, previous=None): diff --git a/spython/version.py b/spython/version.py index 81bc2ab3..b489aedb 100644 --- a/spython/version.py +++ b/spython/version.py @@ -16,7 +16,7 @@ -__version__ = "0.0.48" +__version__ = "0.0.49" AUTHOR = 'Vanessa Sochat' AUTHOR_EMAIL = 'vsochat@stanford.edu' NAME = 'spython'