Skip to content

Commit 96659d7

Browse files
authored
Merge pull request #40 from vsoch/fix/recipe-bug
Fix/recipe bug
2 parents 7b430f5 + 41abd1d commit 96659d7

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The client here will eventually be released as "spython" (and eventually to
1717
singularity on pypi), and the versions here will coincide with these releases.
1818

1919
## [master](https://github.com/singularityhub/singularity-cli/tree/master)
20+
- fixing bug with recipe Dockerfile conversion (0.0.37)
2021
- typo in pypi PACKAGE_URL (0.0.36)
2122
- respecting Client "quiet" attribute in run_command (0.0.34/0.0.35)
2223
- adding missing import of tempfile in image.export (0.0.33)

spython/main/parse/docker.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,23 @@ def _test(self, line):
9898
9999
'''
100100
self.test = self._setup('HEALTHCHECK', line)
101-
101+
102+
103+
# Arg Parser
104+
105+
def _arg(self, line):
106+
'''singularity doesn't have support for ARG, so instead will issue
107+
a warning to the console for the user to export the variable
108+
with SINGULARITY prefixed at build.
109+
110+
Parameters
111+
==========
112+
line: the line from the recipe file to parse for ARG
113+
114+
'''
115+
line = self._setup('ARG', line)
116+
bot.warning("ARG is not supported for Singularity! To get %s" %line[0])
117+
bot.warning("in the container, on host export SINGULARITY_%s" %line[0])
102118

103119
# Env Parser
104120

@@ -398,6 +414,7 @@ def _get_mapping(self, line, parser=None, previous=None):
398414
cmd = line[0].upper()
399415

400416
mapping = {"ADD": self._add,
417+
"ARG": self._arg,
401418
"COPY": self._copy,
402419
"CMD": self._cmd,
403420
"ENTRYPOINT": self._entry,
@@ -411,7 +428,7 @@ def _get_mapping(self, line, parser=None, previous=None):
411428
"VOLUME": self._volume,
412429
"LABEL": self._label}
413430

414-
# If it's a command line, return correct functoin
431+
# If it's a command line, return correct function
415432
if cmd in mapping:
416433
return mapping[cmd]
417434

@@ -448,7 +465,6 @@ def _parse(self):
448465

449466
parser = self._get_mapping(line, parser, previous)
450467

451-
452468
# Parse it, if appropriate
453469
if parser:
454470
parser(line)

spython/main/parse/environment.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ def parse_env(envlist):
5555
elif '=' in current:
5656
exports.append(current)
5757

58-
# Case 1: ['A', 'B'] --> A=B
58+
# Case 3: ENV \\
59+
60+
elif current.endswith('\\'):
61+
continue
62+
63+
# Case 4: ['A', 'B'] --> A=B
5964

6065
else:
6166

spython/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020

21-
__version__ = "0.0.36"
21+
__version__ = "0.0.37"
2222
AUTHOR = 'Vanessa Sochat'
2323
AUTHOR_EMAIL = '[email protected]'
2424
NAME = 'spython'

0 commit comments

Comments
 (0)