[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit d5459fbac32c7be88e70093b18aad138dd620b7c
Author: Nicolas Vigier <boklm@xxxxxxxxxxxxxx>
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);



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits