Unverified Commit 43c94529 authored by boklm's avatar boklm
Browse files

Bug 26843: add projects/firefox-locale-bundle

projects/firefox-locale-bundle will clone or pull the mercurial
repositories for each locale into the hg_clones/firefox-locale-bundle
directory, and generate tarballs using the changesets listed in the
firefox json file. The script get_hg_hash is used to parse
this json file and output the hg changeset for the selected locale.

Patch based on work started by GeKo.
parent 80d0df6b
......@@ -14,8 +14,10 @@ to extract container file systems, start containers and copy files to and
from containers.
The sources of most components are downloaded using git, which needs to
be installed. The sources of webrtc are downloaded using gclient, which
requires GTK+ 2.0 development files and curl to be installed.
be installed. Some components are downloaded using mercurial which also
needs to be installed. The sources of webrtc are downloaded using
gclient, which requires GTK+ 2.0 development files and curl to be
installed.
You also need a few perl modules installed:
- YAML::XS
......@@ -41,7 +43,8 @@ If you are running Debian or Ubuntu, you can install them with:
libio-captureoutput-perl libpath-tiny-perl \
libstring-shellquote-perl libsort-versions-perl \
libdigest-sha-perl libdata-uuid-perl libdata-dump-perl \
libfile-copy-recursive-perl git libgtk2.0-dev curl runc
libfile-copy-recursive-perl git libgtk2.0-dev curl runc \
mercurial
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
......
#!/bin/bash
[% c("var/set_default_env") -%]
clone_dir='[% c("basedir") %]/hg_clones/[% project %]'
mkdir -p "$clone_dir"
cd "$clone_dir"
tmpdir=$(mktemp -d)
[% FOREACH lang = c('var/locales') %]
[% SET lang = tmpl(lang);
SET hgurl = "https://hg.mozilla.org/l10n-central/" _ lang %]
if test -d [% lang %]
then
cd [% lang %]
[% c("hg") %] pull [% hgurl %]
else
[% c("hg") %] clone [% hgurl %] [% lang %]
cd [% lang %]
fi
hg_hash=$([% c("basedir") %]/projects/firefox-locale-bundle/get_hg_hash \
$rootdir/[% c('input_files_by_name/firefox_json') %] \
[% lang %])
[% c("hg") %] archive -r "$hg_hash" -t files "$tmpdir"/[% lang %]
cd ..
[% END %]
tar -C "$tmpdir" -czf [% dest_dir %]/[% c("filename") %] .
rm -Rf "$tmpdir"
# vim: filetype=yaml sw=2
version: '[% c("var/ff_version") %]-[% c("var/ff_build") %]'
filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
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'
#!/usr/bin/perl -w
use strict;
use File::Slurp;
use JSON;
sub exit_error {
print STDERR "Error: ", $_[0], "\n";
exit (exists $_[1] ? $_[1] : 1);
}
exit_error("Wrong number of arguments", 1) unless @ARGV == 2;
my ($file, $locale) = @ARGV;
my $json_text = read_file($file);
exit_error("Error reading $file", 2) unless defined $json_text;
my $data = decode_json($json_text);
my $changeset = $data->{locales}{$locale}{changeset};
exit_error("Can't find locale $locale in $file", 3) unless $changeset;
print "$changeset\n";
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment