build 887 B

12345678910111213141516171819202122232425262728293031323334
  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. SET hgurl = "https://hg.mozilla.org/l10n-central/" _ lang %]
  13. if test -d [% lang %]
  14. then
  15. cd [% lang %]
  16. [% c("hg") %] pull [% hgurl %]
  17. else
  18. [% c("hg") %] clone [% hgurl %] [% lang %]
  19. cd [% lang %]
  20. fi
  21. hg_hash=$([% c("basedir") %]/projects/firefox-locale-bundle/get_hg_hash \
  22. $rootdir/l10n-changesets.json \
  23. [% lang %])
  24. [% c("hg") %] archive -r "$hg_hash" -t files "$tmpdir"/[% lang %]
  25. cd ..
  26. [% END %]
  27. tar -C "$tmpdir" -czf [% dest_dir %]/[% c("filename") %] .
  28. rm -Rf "$tmpdir"