[tor-commits] [tor-browser-build/master] Bug 26843: Get l10n-changesets.json from tor-browser.git

gk at torproject.org gk at torproject.org
Thu Dec 6 19:00:34 UTC 2018


commit bad46e532fa614ffdd3ed0e21f4b8fae3ba7793d
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Thu Dec 6 14:34:41 2018 +0000

    Bug 26843: Get l10n-changesets.json from tor-browser.git
    
    The json file used by projects/firefox-locale-bundle is only available
    from https://product-details.mozilla.org/ after a build has been
    shipped, which is too late for us. However, it is also available from
    the firefox sources tree, so we can get it from our tor-browser.git
    clone instead.
    
    The format of this json file is a little different, so we also need to
    adapt the get_hg_hash script.
---
 projects/firefox-locale-bundle/build       | 6 +++++-
 projects/firefox-locale-bundle/config      | 4 ----
 projects/firefox-locale-bundle/get_hg_hash | 2 +-
 projects/firefox/config                    | 2 ++
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/projects/firefox-locale-bundle/build b/projects/firefox-locale-bundle/build
index 3fec48e..7000300 100644
--- a/projects/firefox-locale-bundle/build
+++ b/projects/firefox-locale-bundle/build
@@ -2,6 +2,10 @@
 
 [% c("var/set_default_env") -%]
 
+cat > l10n-changesets.json << 'EOF_CHANGESETS'
+[% pc('firefox', 'var/l10n-changesets.json') %]
+EOF_CHANGESETS
+
 clone_dir='[% c("basedir") %]/hg_clones/[% project %]'
 mkdir -p "$clone_dir"
 cd "$clone_dir"
@@ -19,7 +23,7 @@ tmpdir=$(mktemp -d)
       cd [% lang %]
   fi
   hg_hash=$([% c("basedir") %]/projects/firefox-locale-bundle/get_hg_hash \
-                $rootdir/[% c('input_files_by_name/firefox_json') %] \
+                $rootdir/l10n-changesets.json \
                 [% lang %])
   [% c("hg") %] archive -r "$hg_hash" -t files "$tmpdir"/[% lang %]
   cd ..
diff --git a/projects/firefox-locale-bundle/config b/projects/firefox-locale-bundle/config
index 13c5fb8..2f4997f 100644
--- a/projects/firefox-locale-bundle/config
+++ b/projects/firefox-locale-bundle/config
@@ -6,7 +6,3 @@ var:
   use_container: 0
   ff_version: '[% pc("firefox", "var/firefox_version") %]'
   ff_build: build1
-
-input_files:
-  - name: firefox_json
-    URL: 'https://product-details.mozilla.org/1.0/l10n/Firefox-[% c("var/ff_version") %]-[% c("var/ff_build") %].json'
diff --git a/projects/firefox-locale-bundle/get_hg_hash b/projects/firefox-locale-bundle/get_hg_hash
index 0531113..9b2b5bd 100755
--- a/projects/firefox-locale-bundle/get_hg_hash
+++ b/projects/firefox-locale-bundle/get_hg_hash
@@ -16,6 +16,6 @@ exit_error("Error reading $file", 2) unless defined $json_text;
 
 my $data = decode_json($json_text);
 
-my $changeset = $data->{locales}{$locale}{changeset};
+my $changeset = $data->{$locale}{revision};
 exit_error("Can't find locale $locale in $file", 3) unless $changeset;
 print "$changeset\n";
diff --git a/projects/firefox/config b/projects/firefox/config
index 314326f..7ffaf43 100644
--- a/projects/firefox/config
+++ b/projects/firefox/config
@@ -24,6 +24,8 @@ var:
     use_container: 1
   # this should be updated when the list of gradle dependencies is changed
   gradle_dependencies_version: 3
+  # used by projects/firefox-locale-bundle
+  l10n-changesets.json: '[% exec("cat mobile/locales/l10n-changesets.json") %]'
 
 targets:
   release:



More information about the tor-commits mailing list