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

[tor-commits] [tor-browser-bundle/hardened-builds-6.5] Bug 19348: Windows %BUILD_TARGET% changed in Tor Browser 6.0



commit 4569eee1f94ad008c9a4b3d3924e6fed0b2e1926
Author: Nicolas Vigier <boklm@xxxxxxxxxxxxxx>
Date:   Mon Jun 13 18:15:54 2016 +0200

    Bug 19348: Windows %BUILD_TARGET% changed in Tor Browser 6.0
    
    The values in build_targets can now be a list of values rather than a
    single value and are all included in the generated .htaccess file. They
    are also all tested in check_update_responses_deployement.
    
    Additionally, a trailing '/' in the last RewriteRule in the .htaccess has
    been added. This missing '/' was the reason why the requests using the
    new BUILD_TARGET values were returning the en-US complete mar file
    rather than an error.
---
 tools/update-responses/config.yml       |  5 ++++-
 tools/update-responses/update_responses | 29 ++++++++++++++++++-----------
 2 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/tools/update-responses/config.yml b/tools/update-responses/config.yml
index 5e4d463..179f882 100644
--- a/tools/update-responses/config.yml
+++ b/tools/update-responses/config.yml
@@ -5,7 +5,10 @@ download:
 build_targets:
     linux32: Linux_x86-gcc3
     linux64: Linux_x86_64-gcc3
-    win32: WINNT_x86-gcc3
+    win32:
+        - WINNT_x86-gcc3
+        - WINNT_x86-gcc3-x86
+        - WINNT_x86-gcc3-x64
     osx32: Darwin_x86-gcc3
     osx64: Darwin_x86_64-gcc3
 channels:
diff --git a/tools/update-responses/update_responses b/tools/update-responses/update_responses
index 72a19d7..1a7cb14 100755
--- a/tools/update-responses/update_responses
+++ b/tools/update-responses/update_responses
@@ -39,8 +39,10 @@ sub exit_error {
     exit (exists $_[1] ? $_[1] : 1);
 }
 
-sub build_target_by_os {
-    $config->{build_targets}{$_[0]} ? $config->{build_targets}{$_[0]} : $_[0];
+sub build_targets_by_os {
+    return ($_[0]) unless $config->{build_targets}{$_[0]};
+    my $r = $config->{build_targets}{$_[0]};
+    return ref $r eq 'ARRAY' ? @$r : ($r);
 }
 
 sub get_nbprocs {
@@ -313,16 +315,17 @@ sub write_htaccess {
         my $files = $config->{versions}{$version}{files};
         $htaccess .= "RewriteRule ^[^\/]+/$version/ no-update.xml $flags\n";
         foreach my $os (sort keys %$files) {
-            my $bt = build_target_by_os($os);
-            foreach my $lang (sort keys %{$files->{$os}}) {
-                foreach my $from_version (sort keys %{$files->{$os}{$lang}{partial}}) {
-                    $htaccess .= "RewriteRule ^$bt/$from_version/$lang "
-                              .  "$from_version-$version-$os-$lang.xml $flags\n";
+            foreach my $bt (build_targets_by_os($os)) {
+                foreach my $lang (sort keys %{$files->{$os}}) {
+                    foreach my $from_version (sort keys %{$files->{$os}{$lang}{partial}}) {
+                        $htaccess .= "RewriteRule ^$bt/$from_version/$lang "
+                                  .  "$from_version-$version-$os-$lang.xml $flags\n";
+                    }
+                    $htaccess .= "RewriteRule ^$bt/[^\/]+/$lang "
+                              .  "$version-$os-$lang.xml $flags\n";
                 }
-                $htaccess .= "RewriteRule ^$bt/[^\/]+/$lang "
-                          .  "$version-$os-$lang.xml $flags\n";
+                $htaccess .= "RewriteRule ^$bt/ $version-$os-en-US.xml $flags\n";
             }
-            $htaccess .= "RewriteRule ^$bt $version-$os-en-US.xml $flags\n";
         }
         write_htdocs($channel, '.htaccess', $htaccess);
     }
@@ -426,10 +429,14 @@ sub check_has_incremental {
     return undef;
 }
 
+sub build_targets_list {
+    map { ref $_ eq 'ARRAY' ? @$_ : $_ } values %{$config->{build_targets}};
+}
+
 sub check_update_responses_channel {
     my ($config, $base_url, $channel) = @_;
     my $channel_version = $config->{channels}{$channel};
-    foreach my $build_target (values %{$config->{build_targets}}) {
+    foreach my $build_target (build_targets_list()) {
         foreach my $lang (qw(en-US de)) {
             my $url = "$base_url/$channel/$build_target/1.0/$lang";
             my $dom = get_remote_xml($url);

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