build 950 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. [% c("var/set_default_env") -%]
  3. cat > l10n-changesets.json << 'EOF_CHANGESETS'
  4. [% pc('firefox', 'var/l10n-changesets.json') %]
  5. EOF_CHANGESETS
  6. clone_dir='[% c("basedir") %]/hg_clones/[% project %]'
  7. mkdir -p "$clone_dir"
  8. cd "$clone_dir"
  9. tmpdir=$(mktemp -d)
  10. [% FOREACH lang = c('var/locales') %]
  11. [% SET lang = tmpl(lang);
  12. # mk is unavailable on mobile.
  13. NEXT IF lang == 'mk';
  14. SET hgurl = "https://hg.mozilla.org/l10n-central/" _ lang %]
  15. if test -d [% lang %]
  16. then
  17. cd [% lang %]
  18. [% c("hg") %] pull [% hgurl %]
  19. else
  20. [% c("hg") %] clone [% hgurl %] [% lang %]
  21. cd [% lang %]
  22. fi
  23. hg_hash=$([% c("basedir") %]/projects/firefox-locale-bundle/get_hg_hash \
  24. $rootdir/l10n-changesets.json \
  25. [% lang %])
  26. [% c("hg") %] archive -r "$hg_hash" -t files "$tmpdir"/[% lang %]
  27. cd ..
  28. [% END %]
  29. tar -C "$tmpdir" -czf [% dest_dir %]/[% c("filename") %] .
  30. rm -Rf "$tmpdir"