git_submodule option doesn't work when a submodule is not in the root directory
rbm has the git_submodule
option to include all submodules in the sources tarball. This option works as expected when all the submodules are located in the root directory, however it fails if one of the submodules is in a sub-directory.
The reason is that we do this to create .tar files for all the submodules:
($stdout, $stderr, $success, $exit_code)
= capture_exec('git', 'submodule', 'foreach',
"git archive --prefix=$project-$version/\$path/"
. " --output=$tmpdir/submodule-\$name.tar \$sha1");
We use the submodule name in the output filename inside a temporary directory, which fails when the submodule name contains /
as it wants to create a file in a directory which does not exist.