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

[tor-commits] [tor-browser-build/master] Bug 40045: Fix complete .mar file creation for dmg2mar



commit 340d124db3ef1f1ac173f28b2ceb5c8532e99797
Author: Matthew Finkel <sysrqb@xxxxxxxxxxxxxx>
Date:   Wed Aug 19 15:33:58 2020 +0000

    Bug 40045: Fix complete .mar file creation for dmg2mar
---
 projects/release/dmg2mar |  2 +-
 tools/dmg2mar            | 11 ++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/projects/release/dmg2mar b/projects/release/dmg2mar
index d6175f5..42fae50 100644
--- a/projects/release/dmg2mar
+++ b/projects/release/dmg2mar
@@ -1,4 +1,4 @@
 #!/bin/bash
 [% c("var/set_default_env") -%]
 cd [% shell_quote(path(dest_dir)) %]/[% c("var/signed_status") %]/[%  c("version") %]
-[% shell_quote(c("basedir")) %]/tools/dmg2mar
+[% shell_quote(c("basedir")) %]/tools/dmg2mar [% c("var/channel") %]
diff --git a/tools/dmg2mar b/tools/dmg2mar
index 9b98956..13a4c9e 100755
--- a/tools/dmg2mar
+++ b/tools/dmg2mar
@@ -103,6 +103,7 @@ sub get_dmg_files_from_sha256sums {
 }
 
 sub convert_files {
+    my ($channel) = @_;
     my $pm = Parallel::ForkManager->new(get_nbprocs);
     $pm->run_on_finish(sub { print "Finished $_[2]\n" });
     foreach my $file (get_dmg_files_from_sha256sums) {
@@ -140,9 +141,13 @@ sub convert_files {
         find($wanted, "$tmpdir/$appname.app");
 
         unlink $output;
+        local $ENV{MOZ_PRODUCT_VERSION} = $file->{version};
+        local $ENV{MAR_CHANNEL_ID} = "torbrowser-torproject-$channel";
         (undef, $err, $success) =  capture_exec('make_full_update.sh', '-q',
                                         $output, "$tmpdir/$appname.app");
         exit_error "Error updating $output: $err" unless $success;
+        exit_error "make_full_update.sh failed. $output does not exist."
+            unless -f $output;
         $pm->finish;
     }
     $pm->wait_all_children;
@@ -164,6 +169,10 @@ sub remove_incremental_mars {
 # Set LC_ALL=C to avoid reproducibility issues when creating mar files
 $ENV{LC_ALL} = 'C';
 
+
+exit_error "Please specify update channel" unless @ARGV == 1;
+my $channel = $ARGV[0];
+
 extract_martools;
-convert_files;
+convert_files $channel;
 remove_incremental_mars;



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