set_var ("build_host", $build_host);
set_var ("build_number", $build_number);
+our $GIT = "git --git-dir=$topdir/.git";
+
sub start_step {
my ($msg) = @_;
print LOG "\f\n$msg\n";
return $commit;
}
-my $GIT = "git --git-dir=$topdir/.git";
-
if (@ARGV == 2) {
my ($repo, $branch) = @ARGV;
set_var ("dist_ref", "refs/builds/$build_number/dist");
set_var ("dist_commit", ref_to_commit ("refs/builds/$build_number/dist"));
+ start_step ("Determining $tarball target directory");
+ my $sample_filename = `zcat $tarball | tar tf - | head -1`;
+ my ($tarball_dir) = $sample_filename =~ m%^(?:[./])*([^/]+)/%;
+ set_var ("dist_dir", $tarball_dir);
+
start_step ("Extracting source tarball");
run ("zcat $tarball | (cd $builddir && tar xf -)");