boklm pushed to branch main at The Tor Project / Applications / tor-browser-build

Commits:

4 changed files:

Changes:

  • projects/browser/build
    ... ... @@ -372,7 +372,7 @@ cd $distdir
    372 372
     
    
    373 373
     [% IF c("var/build_mar") && c("var/updater_enabled") -%]
    
    374 374
       # Create full MAR file and compressed package.
    
    375
    -  [% SET mar_file = c("var/project-name") _ '-' _ c("var/mar_osname") _ '-' _ c("var/torbrowser_version") _ '_ALL.mar' %]
    
    375
    +  [% SET mar_file = c("var/project-name") _ '-' _ c("var/mar_osname") _ '-' _ c("var/torbrowser_version") _ '.mar' %]
    
    376 376
       MAR=$MARTOOLS/mar \
    
    377 377
       MOZ_PRODUCT_VERSION=[% c("var/torbrowser_version") %] \
    
    378 378
       MAR_CHANNEL_ID=[% c("var/mar_channel_id") %] \
    

  • tools/count-mar-downloads
    ... ... @@ -63,7 +63,7 @@ sub parse_log_file {
    63 63
       my ($stdout, undef, $success) = capture_exec('xzcat', $File::Find::name);
    
    64 64
       foreach my $line (split /\n/, $stdout) {
    
    65 65
         my ($version, $os) =
    
    66
    -      ($line =~ m|^[^\s]+ - - \[.+\] "GET /aus1/torbrowser/([^/]+)/tor-browser-(.*)-\d.*_ALL\.mar HTTP/|);
    
    66
    +      ($line =~ m|^[^\s]+ - - \[.+\] "GET /aus1/torbrowser/([^/]+)/tor-browser-(.*)-\d.*(_ALL)?\.mar HTTP/|);
    
    67 67
         if ($version) {
    
    68 68
           $downloads{$version}{total} += 1;
    
    69 69
           $downloads{$version}{full_update} += 1;
    
    ... ... @@ -72,7 +72,7 @@ sub parse_log_file {
    72 72
         }
    
    73 73
         my $incremental_from;
    
    74 74
         ($version, $os, $incremental_from) =
    
    75
    -      ($line =~ m|^[^\s]+ - - \[.+\] "GET /aus1/torbrowser/([^/]+)/tor-browser-(.*)--(\d[^-]+)-.*_ALL\.incremental\.mar HTTP/|);
    
    75
    +      ($line =~ m|^[^\s]+ - - \[.+\] "GET /aus1/torbrowser/([^/]+)/tor-browser-(.*)--(\d[^-]+)-.*(_ALL)?\.incremental\.mar HTTP/|);
    
    76 76
         if ($incremental_from) {
    
    77 77
           $downloads{$version}{total} += 1;
    
    78 78
           $downloads{$version}{OS}{$os} += 1;
    

  • tools/dmg2mar
    ... ... @@ -117,7 +117,7 @@ sub convert_files {
    117 117
             print "Finished $_[2]\n";
    
    118 118
           });
    
    119 119
         foreach my $file (get_dmg_files_from_sha256sums) {
    
    120
    -        my $output = "$appname_mar-macos-$file->{version}_ALL.mar";
    
    120
    +        my $output = "$appname_mar-macos-$file->{version}.mar";
    
    121 121
             my $step_name = "$file->{filename} -> $output";
    
    122 122
             print "Starting $step_name\n";
    
    123 123
             $pm->start($step_name) and next;
    

  • tools/update-responses/update_responses
    ... ... @@ -87,6 +87,33 @@ sub get_sha512_hex_of_file {
    87 87
         return $sha->hexdigest;
    
    88 88
     }
    
    89 89
     
    
    90
    +# With release 15.0 _ALL is being removed from mar file names.
    
    91
    +# However we need to be able to generate incrementals from versions
    
    92
    +# using the old filenames. As a workaround, if the old filename is
    
    93
    +# found we create a symlink to the new file name.
    
    94
    +# The symlinks are used in `create_incremental_mar` and `get_buildinfos`,
    
    95
    +# where supporting both file names would complexify things. The symlinks
    
    96
    +# are ignored in `get_version_files` where the regexp used support both
    
    97
    +# old and new filenames.
    
    98
    +# We can remove this once we don't need to generate incrementals from
    
    99
    +# versions with the old file names.
    
    100
    +sub symlink_ALL {
    
    101
    +    my ($config, $version) = @_;
    
    102
    +    my $vdir = version_dir($config, $version);
    
    103
    +    opendir(my $d, $vdir) or exit_error "Error opening directory $vdir";
    
    104
    +    foreach my $file (readdir $d) {
    
    105
    +        next unless -f "$vdir/$file";
    
    106
    +        if ($file =~ m/^(.+)_ALL\.mar$/) {
    
    107
    +            next if -f "$vdir/$1.mar";
    
    108
    +            symlink $file, "$vdir/$1.mar";
    
    109
    +        }
    
    110
    +        if ($file =~ m/^(.+)_ALL\.incremental\.mar$/) {
    
    111
    +            next if -f "$vdir/$1.incremental.mar";
    
    112
    +            symlink $file, "$vdir/$1.incremental.mar";
    
    113
    +        }
    
    114
    +    }
    
    115
    +}
    
    116
    +
    
    90 117
     sub get_version_files {
    
    91 118
         my ($config, $version) = @_;
    
    92 119
         return if $config->{versions}{$version}{files};
    
    ... ... @@ -97,8 +124,13 @@ sub get_version_files {
    97 124
         opendir(my $d, $vdir) or exit_error "Error opening directory $vdir";
    
    98 125
         foreach my $file (readdir $d) {
    
    99 126
             next unless -f "$vdir/$file";
    
    127
    +        # Ignore the symlinks created by `symlink_ALL` to avoid adding the files
    
    128
    +        # twice.
    
    129
    +        # We can remove this line once we don't need to support the legacy channel with
    
    130
    +        # with the old file names.
    
    131
    +        next if -l "$vdir/$file";
    
    100 132
             if ($file !~ m/incremental\.mar$/ &&
    
    101
    -            $file =~ m/^$appname-(.+)-${version}_ALL\.mar$/) {
    
    133
    +            $file =~ m/^$appname-(.+)-${version}(_ALL)?\.mar$/) {
    
    102 134
                 my $os = $1;
    
    103 135
                 $files->{$os}{complete} = {
    
    104 136
                     type => 'complete',
    
    ... ... @@ -111,7 +143,7 @@ sub get_version_files {
    111 143
                 };
    
    112 144
                 next;
    
    113 145
             }
    
    114
    -        if ($file =~ m/^$appname-(.+)--(.+)-${version}_ALL\.incremental\.mar$/) {
    
    146
    +        if ($file =~ m/^$appname-(.+)--(.+)-${version}(_ALL)?\.incremental\.mar$/) {
    
    115 147
                 my ($os, $from_version) = ($1, $2);
    
    116 148
                 $files->{$os}{partial}{$from_version} = {
    
    117 149
                     type => 'partial',
    
    ... ... @@ -221,13 +253,13 @@ sub extract_mar {
    221 253
     
    
    222 254
     sub mar_filename {
    
    223 255
         my ($config, $appname, $version, $os) = @_;
    
    224
    -    version_dir($config, $version) .  "/$appname-$os-${version}_ALL.mar";
    
    256
    +    version_dir($config, $version) .  "/$appname-$os-${version}.mar";
    
    225 257
     }
    
    226 258
     
    
    227 259
     sub create_incremental_mar {
    
    228 260
         my ($config, $pm, $from_version, $new_version, $os, $channel) = @_;
    
    229 261
         my $appname = $config->{appname_marfile};
    
    230
    -    my $mar_file = "$appname-$os--${from_version}-${new_version}_ALL.incremental.mar";
    
    262
    +    my $mar_file = "$appname-$os--${from_version}-${new_version}.incremental.mar";
    
    231 263
         my $mar_file_path = version_dir($config, $new_version) . '/' . $mar_file;
    
    232 264
         if ($ENV{MAR_SKIP_EXISTING} && -f $mar_file_path) {
    
    233 265
             print "Skipping $mar_file\n";
    
    ... ... @@ -288,6 +320,7 @@ sub create_incremental_mars_for_version {
    288 320
         my $v = $config->{versions}{$version};
    
    289 321
         foreach my $from_version (@{$v->{incremental_from}}) {
    
    290 322
             $config->{versions}{$from_version} //= {};
    
    323
    +        symlink_ALL($config, $from_version);
    
    291 324
             get_version_files($config, $from_version);
    
    292 325
             my $from_v = $config->{versions}{$from_version};
    
    293 326
             foreach my $os (keys %{$v->{files}}) {
    
    ... ... @@ -396,6 +429,7 @@ sub write_responses {
    396 429
         my (%oses, %from_versions);
    
    397 430
         foreach my $version (@$versions) {
    
    398 431
             get_version_files($config, $version);
    
    432
    +        symlink_ALL($config, $version);
    
    399 433
             get_buildinfos($config, $version);
    
    400 434
             my $files = $config->{versions}{$version}{files};
    
    401 435
             foreach my $os (keys %$files) {