summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@torproject.org>2018-04-09 18:54:04 +0200
committerNicolas Vigier <boklm@torproject.org>2018-04-09 19:13:47 +0200
commit8adbc46dc9e8358abad75ac81faf4646d8165b9e (patch)
treeaa1772bd5805392f79c55ee25e62b0f6d5c5fd4c
parentdb41d8e754ed8cd6cee7bca18d76d59f8f7f369b (diff)
Bug 25746: fix git_submodule option with submodule in subdirectorybug_25746
To create an archive containing all submodules, we were creating a temporary archive of each submodule before appending them to the main archive. We were using the submodule path in the temporary archive filename, which was failing if the submodule is in a subdirectory. To avoid that, we are removing the path from the temporary archive's filename and directly appending it to the main archive.
-rw-r--r--lib/RBM.pm8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/RBM.pm b/lib/RBM.pm
index f987130..8875a7c 100644
--- a/lib/RBM.pm
+++ b/lib/RBM.pm
@@ -557,13 +557,9 @@ sub maketar {
($stdout, $stderr, $success, $exit_code)
= capture_exec('git', 'submodule', 'foreach',
"git archive --prefix=$project-$version/\$path/"
- . " --output=$tmpdir/submodule-\$name.tar \$sha1");
+ . " --output=$tmpdir/submodule.tar \$sha1;"
+ . "tar -Af \"$dest_dir/$tar_file\" $tmpdir/submodule.tar");
exit_error 'Error running git archive on submodules.' unless $success;
- foreach my $file (sort glob "$tmpdir/*.tar") {
- ($stdout, $stderr, $success, $exit_code)
- = capture_exec('tar', '-Af', "$dest_dir/$tar_file", $file);
- exit_error "Error appending submodule tar:\n$stderr" unless $success;
- }
}
} else {
system('hg', 'archive', '-r', $commit_hash, '-t', 'tar',