Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull --debug fix on docker:// URI #1556

Merged
merged 2 commits into from
May 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions libexec/cli/pull.exec
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ case "$SINGULARITY_CONTAINER" in
message WARNING "Container will be sized appropriately for Docker image.\n"
fi

if [ -f "$SINGULARITY_IMAGE" ]; then
if [ -f "$SINGULARITY_IMAGE" ]; then
if [ -n "${OVERWRITE:-}" ]; then
message 2 "Removing existing file\n"
rm -f "$SINGULARITY_IMAGE"
Expand All @@ -151,8 +151,13 @@ case "$SINGULARITY_CONTAINER" in
fi
fi

if [ -x "${SINGULARITY_bindir}/singularity" ]; then
${SINGULARITY_bindir}/singularity build ${SINGULARITY_IMAGE} ${SINGULARITY_CONTAINER}
DBGFLAG=""
if [ "x${SINGULARITY_MESSAGELEVEL}" == "x5" ]; then
Copy link
Contributor

@bauerm97 bauerm97 May 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this say "x$... and "x5" instead of "$... and "5"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because if SINGULARITY_MESSAGELEVEL is not set, you could end up like:

if [ == 5 ]; then

And not have a left hand side. So ... it's common practice to add an x in, so the check ends up as:

if [ x == x5 ]; then

DBGFLAG="-d"
fi

if [ -x "${SINGULARITY_bindir}/singularity" ]; then
${SINGULARITY_bindir}/singularity ${DBGFLAG} build ${SINGULARITY_IMAGE} ${SINGULARITY_CONTAINER}
RETVAL=$?
else
message ERROR "Could not locate the Singularity binary: $SINGULARITY_home/singularity\n"
Expand Down