[tbb-commits] [tor-browser-bundle/master] update_responses: extract mar-tools in a temporary directory

mikeperry at torproject.org mikeperry at torproject.org
Fri Oct 24 23:56:05 UTC 2014


commit d5459fbac32c7be88e70093b18aad138dd620b7c
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Mon Oct 13 12:31:33 2014 +0200

    update_responses: extract mar-tools in a temporary directory
    
    Extract the gitian-builder/inputs/mar-tools-linux*.zip file that was
    created during the last firefox build.
---
 tools/update-responses/update_responses |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/tools/update-responses/update_responses b/tools/update-responses/update_responses
index 55ebfb9..7f1df2d 100755
--- a/tools/update-responses/update_responses
+++ b/tools/update-responses/update_responses
@@ -268,6 +268,33 @@ sub check_deps {
     }
 }
 
+sub osname {
+    my ($osname) = capture_exec('uname', '-s');
+    my ($arch) = capture_exec('uname', '-m');
+    chomp($osname, $arch);
+    if ($osname eq 'Linux' && $arch eq 'x86_64') {
+        return 'linux64';
+    }
+    if ($osname eq 'Linux' && $arch =~ m/^i.86$/) {
+        return 'linux32';
+    }
+    exit_error 'Unknown OS';
+}
+
+my $martools_tmpdir;
+sub extract_martools {
+    my $osname = osname;
+    my $marzip = "$FindBin::Bin/../../../gitian-builder/inputs/mar-tools-$osname.zip";
+    $martools_tmpdir = File::Temp->newdir();
+    my $old_cwd = getcwd;
+    chdir $martools_tmpdir;
+    my (undef, undef, $success) = capture_exec('unzip', $marzip);
+    chdir $old_cwd;
+    exit_error "Error extracting $marzip" unless $success;
+    $ENV{PATH} .= ":$martools_tmpdir/mar-tools";
+}
+
+extract_martools;
 check_deps;
 write_responses($config);
 write_htaccess($config);





More information about the tbb-commits mailing list