Commit 5396a84b authored by Yueh-Shun Li's avatar Yueh-Shun Li
Browse files

singularity-tools: string-interpolate and and quote members in contents

String-interpolation converts path objects inside `contents` into store
paths to ensure they are properly included in the result image.

See tests.trivial-builders.references for the necessity of
string-interpolation.

Quote each string-interpolated content member to accomodates spaces
inside.
parent 7487a620
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -120,7 +120,12 @@ lib.makeExtensible (final: {
              cp -ar "$f" "./$f"
            done

            for c in ${toString contents} ; do
            # TODO(@ShamrockLee):
            # Once vmTools.runInLinuxVMm works with `__structuredAttrs = true` (#334705),
            # set __structuredAttrs = true and pass contents as an attribute
            # so that we could loop with `for c in ''${contents[@]}`
            # instead of expanding all the paths in contents into the Bash string.
            for c in ${lib.escapeShellArgs contents} ; do
              for f in "$c"/bin/* ; do
                if [ ! -e "bin/$(basename "$f")" ] ; then
                  ln -s "$f" bin/