From: Ben Pfaff Date: Fri, 26 Mar 2010 03:55:23 +0000 (-0700) Subject: Add dist_dir to output variables. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6f5a05fa098aeb35cd184682c271244f05907e8;p=pspp Add dist_dir to output variables. --- diff --git a/build-pspp b/build-pspp index d45a9efba7..ae723f7de4 100755 --- a/build-pspp +++ b/build-pspp @@ -66,6 +66,8 @@ chomp $build_host; 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 " \n$msg\n"; @@ -122,8 +124,6 @@ sub ref_to_commit { return $commit; } -my $GIT = "git --git-dir=$topdir/.git"; - if (@ARGV == 2) { my ($repo, $branch) = @ARGV; @@ -286,6 +286,11 @@ if ($build_binary) { 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 -)");