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

[tor-commits] [tor-browser-build/master] Bug 32738: Use any of the mar-tools available



commit 25d9f797f4d2b1313ea396fada5b7cfb77c8232c
Author: Nicolas Vigier <boklm@xxxxxxxxxxxxxx>
Date:   Thu Dec 12 13:02:24 2019 +0100

    Bug 32738: Use any of the mar-tools available
    
    If the linux64 mar-tools is not available, use any of the other
    mar-tools that is available.
---
 tools/update-responses/update_responses | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/tools/update-responses/update_responses b/tools/update-responses/update_responses
index 3dfd05d..399d289 100755
--- a/tools/update-responses/update_responses
+++ b/tools/update-responses/update_responses
@@ -429,24 +429,19 @@ sub write_downloads_json {
     }
 }
 
-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';
+sub marzip_path {
+    my ($config, $version) = @_;
+    for my $osname (qw/linux64 linux32 mac64 win64 win32/) {
+        my $marzip = version_dir($config, $version) . "/mar-tools-$osname.zip";
+        return $marzip if -f $marzip;
     }
-    exit_error 'Unknown OS';
+    exit_error 'Could not find mar-tools';
 }
 
 my $martools_tmpdir;
 sub extract_martools {
     my ($config, $version) = @_;
-    my $osname = osname;
-    my $marzip = version_dir($config, $version) . "/mar-tools-$osname.zip";
+    my $marzip = marzip_path($config, $version);
     $martools_tmpdir = get_tmpdir($config);
     my $old_cwd = getcwd;
     chdir $martools_tmpdir;
@@ -566,7 +561,7 @@ sub download_version {
     my %sums = map { chomp; reverse split '  ', $_ }
                  read_file "$destdir/sha256sums-signed-build.txt";
 
-    my $martools = 'mar-tools-' . osname . '.zip';
+    my $martools = 'mar-tools-linux64.zip';
     exit_error "Error downloading $urldir/$martools\n"
         unless getstore("$urldir/$martools", "$tmpdir/$martools") == 200;
     exit_error "Error downloading $urldir/$martools.asc\n"

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