Skip to content

Commit 46dbf96

Browse files
committed
fixing recipe env bug
1 parent 7b430f5 commit 46dbf96

File tree

4 files changed

+29
-5
lines changed

4 files changed

+29
-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: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,25 @@ 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])
118+
self.install.append(line[0])
119+
102120

103121
# Env Parser
104122

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

400418
mapping = {"ADD": self._add,
419+
"ARG": self._arg,
401420
"COPY": self._copy,
402421
"CMD": self._cmd,
403422
"ENTRYPOINT": self._entry,
@@ -411,7 +430,7 @@ def _get_mapping(self, line, parser=None, previous=None):
411430
"VOLUME": self._volume,
412431
"LABEL": self._label}
413432

414-
# If it's a command line, return correct functoin
433+
# If it's a command line, return correct function
415434
if cmd in mapping:
416435
return mapping[cmd]
417436

@@ -448,7 +467,6 @@ def _parse(self):
448467

449468
parser = self._get_mapping(line, parser, previous)
450469

451-
452470
# Parse it, if appropriate
453471
if parser:
454472
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)