[tor-commits] [builders/tor-browser-build] 01/03: Bug 40641: Add projects/firefox-l10n

gitolite role git at cupani.torproject.org
Mon Nov 7 17:52:51 UTC 2022


This is an automated email from the git hooks/post-receive script.

pierov pushed a commit to branch main
in repository builders/tor-browser-build.

commit 87987543961e8e5d3a108204034e34694b056519
Author: Nicolas Vigier <boklm at torproject.org>
AuthorDate: Tue Nov 1 17:14:29 2022 +0100

    Bug 40641: Add projects/firefox-l10n
---
 README                       |  4 ++--
 projects/firefox-l10n/build  |  6 ++++++
 projects/firefox-l10n/config | 45 ++++++++++++++++++++++++++++++++++++++++++++
 projects/firefox/config      |  2 ++
 rbm                          |  2 +-
 5 files changed, 56 insertions(+), 3 deletions(-)

diff --git a/README b/README
index 3bc81774..6a29f8e8 100644
--- a/README
+++ b/README
@@ -10,7 +10,7 @@ etc ...). You will need to install the uidmap package, providing the
 newuidmap and newgidmap commands.
 
 The sources of most components are downloaded using git, which needs to
-be installed.
+be installed. The mercurial package is also needed.
 
 You also need a few perl modules installed:
 - YAML::XS
@@ -40,7 +40,7 @@ If you are running Debian or Ubuntu, you can install them with:
                   libstring-shellquote-perl libsort-versions-perl \
                   libdigest-sha-perl libdata-uuid-perl libdata-dump-perl \
                   libfile-copy-recursive-perl libfile-slurp-perl git \
-                  uidmap
+                  mercurial uidmap
 
 The build system is based on rbm, which is included as a git submodule
 in the rbm/ directory. You can fetch the rbm git submodule by running
diff --git a/projects/firefox-l10n/build b/projects/firefox-l10n/build
new file mode 100644
index 00000000..270420db
--- /dev/null
+++ b/projects/firefox-l10n/build
@@ -0,0 +1,6 @@
+#!/bin/bash
+[% c("var/set_default_env") -%]
+
+rm -Rf '[% dest_dir %]/[% c("filename") %]'
+mkdir -p [% dest_dir %]/[% c("filename") %]
+mv -v *.tar.xz [% dest_dir %]/[% c("filename") %]
diff --git a/projects/firefox-l10n/config b/projects/firefox-l10n/config
new file mode 100644
index 00000000..2a2e585b
--- /dev/null
+++ b/projects/firefox-l10n/config
@@ -0,0 +1,45 @@
+# vim: filetype=yaml sw=2
+version: '[% pc("firefox", "abbrev") %]'
+filename: '[% project %]-[% c("var/osname") %]-[% c("version") %]-1'
+link_input_files: 1
+
+steps:
+  fetch_locale:
+    filename: 'l10n-[% c("input_file_var/locale") %]-[% c("hg_hash") %]-[% c("var/build_id") %].tar.xz'
+    version: '[% c("hg_hash") %]'
+    fetch_locale: |
+      [% c("var/set_default_env") -%]
+      tar xf '[% project %]-[% c("version") %].tar.gz'
+      mv [% project %]-[% c("version") %] [% c("input_file_var/locale") %]
+      tar caf '[% dest_dir %]/[% c("filename") %]' [% c("input_file_var/locale") %]
+    input_files: []
+--- |
+  # This part of the file contains options written in perl
+  use JSON;
+  use Path::Tiny;
+  (
+    input_files => sub {
+      my ($project, $options) = @_;
+      my @input_files;
+      my $changesets_json = project_config('firefox', 'var/l10n-changesets', { %$options, origin_project => $project });
+      my $d = decode_json $changesets_json;
+      my $locales = project_config($project, 'var/locales', $options);
+      foreach my $locale (@$locales) {
+        $locale = process_template($project, $locale, '.');
+        next unless my $revision = $d->{$locale}{revision};
+        my $input_file = {
+          name => $locale,
+          project => 'firefox-l10n',
+          pkg_type => 'fetch_locale',
+          hg_hash => $revision,
+          hg_url => "https://hg.mozilla.org/l10n-central/$locale",
+          hg_clone_subdir => $locale,
+          input_file_var => {
+            locale => $locale,
+          },
+        };
+        push @input_files, $input_file;
+      }
+      return [@input_files];
+    },
+  )
diff --git a/projects/firefox/config b/projects/firefox/config
index 38aef044..b3652b2e 100644
--- a/projects/firefox/config
+++ b/projects/firefox/config
@@ -37,6 +37,8 @@ var:
     mv -f -- "$rezip_tmpdir/new.zip" [% c("rezip_file") %]
     rm -Rf "$rezip_tmpdir"
 
+  l10n-changesets: '[% exec("cat browser/locales/l10n-changesets.json") %]'
+
 steps:
   src-tarballs:
     filename: 'src-[% project %]-[% c("version") %].tar.xz'
diff --git a/rbm b/rbm
index 8ed3aa1c..a6ccc103 160000
--- a/rbm
+++ b/rbm
@@ -1 +1 @@
-Subproject commit 8ed3aa1c0b65c711947df2f0d483215510514253
+Subproject commit a6ccc103fe59f6b520777308af92bf98113e2c90

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tor-commits mailing list