[tbb-commits] [builders/tor-browser-build] 03/03: Bug 40641: Remove langpacks and single-locale support

gitolite role git at cupani.torproject.org
Mon Nov 7 17:52:53 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 98b4184d69ab7b6d55c90ef25ce6fc8005a589b8
Author: Pier Angelo Vendrame <pierov at torproject.org>
AuthorDate: Fri Nov 4 09:42:06 2022 +0100

    Bug 40641: Remove langpacks and single-locale support
    
    Since we have packaged locales, we do not have to include language packs
    anymore.
    
    Also, we have decided that we are not switching back from multi-lingual
    packages, so we remove the support to single-lingual packages to
    simplify the browser project.
---
 projects/browser/build            | 154 ++------------------------------------
 projects/browser/config           |   3 -
 projects/firefox-langpacks/build  |  16 ----
 projects/firefox-langpacks/config |  50 -------------
 rbm.conf                          |   1 -
 tools/signing/check_file_counts   |   7 --
 6 files changed, 6 insertions(+), 225 deletions(-)

diff --git a/projects/browser/build b/projects/browser/build
index c14e38f9..43cd81d7 100644
--- a/projects/browser/build
+++ b/projects/browser/build
@@ -194,10 +194,6 @@ tar -C Bundle-Data/[% bundledata_osname %] [% IF ! c("var/namecoin") %]--exclude
   bridges_conf snowflake
 [% END -%]
 
-[% IF ! c("var/multi_lingual") && c("var/tor-browser") %]
-  echo 'pref("extensions.torlauncher.prompt_for_locale", false);' >> "$GENERATEDPREFSPATH"
-[% END %]
-
 [% IF c("var/linux") %]
   chmod 700 ${TB_STAGE_DIR}/Browser/[% c('var/ProjectName') %]/Data/Browser
   [% IF c("var/tor-browser") -%]
@@ -205,18 +201,12 @@ tar -C Bundle-Data/[% bundledata_osname %] [% IF ! c("var/namecoin") %]--exclude
   [% END -%]
 [% END %]
 
-[% IF c("var/multi_lingual") %]
-  # If we are building a multi-lingual package, use "ALL" in the package name
-  # and as the locale for update purposes. We do not include "ALL" in the name
-  # of the directory that is inside the package (in other words, users will
-  # not see tor-browser_ALL after they install Tor Browser).
-  PKG_LOCALE="ALL"
-  PKG_DIR='[% c("var/project-name") %]'
-[% ELSE %]
-  PKG_LOCALE="en-US"
-  PKG_DIR="[% c('var/project-name') %]_${PKG_LOCALE}"
-[% END %]
-
+# With multi-lingual builds, we use "ALL" in the package name as the locale for
+# update purposes. But we do not include "ALL" in the name of the directory that
+# is inside the package (in other words, users will not see tor-browser_ALL
+# after they install Tor Browser).
+PKG_LOCALE="ALL"
+PKG_DIR='[% c("var/project-name") %]'
 
 pushd "$TBDIR[% IF c("var/osx") %]/Contents/Resources[% END %]/browser/"
 unzip omni.ja defaults/preferences/[% c("var/prefs_file") %] || [ $? -lt 3 ]
@@ -230,27 +220,6 @@ rm -rf defaults
 echo '{"version":"[% c("var/torbrowser_version") %]","architecture":"[% c("var/mar_osname") %]","channel":"[% c("var/channel") %]","locale":"en-US"}' > ../tbb_version.json
 popd
 
-[% IF c("var/osx") || c("var/multi_lingual") -%]
-  # Prepare our language packs to embed our default bookmarks.
-  # See bug 21879 for more details.
-  [% IF c("var/multi_lingual") -%]
-    [% SET locales = c("var/locales") -%]
-  [% ELSE -%]
-    [% SET locales = c("var/testbuild") ? [] : c("var/locales") -%]
-  [% END -%]
-  [% FOREACH lang = locales %]
-  [% SET lang = tmpl(lang);
-     SET xpi = '$rootdir/' _ c('input_files_by_name/firefox-langpacks') _ '/' _ lang _ '.xpi';
-     %]
-    # If we are building a multi-lingual package, add all of the language packs.
-    [% IF c("var/multi_lingual") %]
-      cp [% xpi %] "$TBDIR/$EXTSPATH/langpack-[% lang %]@firefox.mozilla.org.xpi"
-    [% END %]
-    cd ..
-    rm -rf prep_[% lang %]
-  [% END %]
-[% END %]
-
 [% IF c("var/windows") %]
   tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/nsis') %]
   export PATH="/var/tmp/dist/nsis/bin:$PATH"
@@ -333,116 +302,5 @@ cp $rootdir/[% c('input_files_by_name/firefox') %]/mar-tools-*.zip "$OUTDIR"/
   cp $rootdir/[% c('input_files_by_name/firefox') %]/build-infos.json "$OUTDIR"/build-infos-[% c("var/mar_osname") %].json
 [% END -%]
 
-# Create a tarball with all Linux x86_64 language packs (Bug 32676)
-[% IF c("var/tor-browser") && c("var/linux-x86_64") && ! c("var/multi_lingual") && ! c("var/testbuild") -%]
-  pushd $rootdir/[% c('input_files_by_name/firefox-langpacks') %]
-  [% c('tar', {
-           tar_src => [ '.' ],
-           tar_args => '-cJf $OUTDIR/langpacks-tor-browser-linux64-' _ c("var/torbrowser_version") _ '.tar.xz',
-     })
-  %]
-  popd
-[% END -%]
-
-# If we did not create a multi-lingual package above, create a package for
-# each locale.
-[% IF ! c("var/multi_lingual") %]
-  [% SET locales = c("var/testbuild") ? [] : c("var/locales") -%]
-  [% FOREACH lang = locales %]
-    [% SET lang = tmpl(lang);
-       SET xpi = '$rootdir/' _ c('input_files_by_name/firefox-langpacks') _ '/' _ lang _ '.xpi';
-       SET tbdir = '$distdir/' _ c("var/project-name") _ '_' _ lang;
-       SET mar_file = c("var/project-name") _ '-' _ c("var/mar_osname") _ '-' _ c("var/torbrowser_version") _ '_' _ lang _ '.mar';
-       IF c("var/osx");
-         SET browserdir = tbdir _ '/' _ c("var/Project_Name") _ '.app';
-       ELSIF c("var/windows");
-         SET browserdir = tbdir _ '/' _ c("var/Project_Name") _ '/Browser';
-       ELSE;
-         SET browserdir = tbdir _ '/Browser';
-       END;
-       SET build_mar = c("var/build_mar");
-       # On nightly we only build mar files for some locales
-       IF c("var/nightly") && c("var/build_mar");
-         build_mar = 0;
-         FOREACH mar_lang = c("var/mar_locales");
-           mar_lang = tmpl(mar_lang);
-           IF mar_lang == lang;
-             build_mar = 1;
-           END;
-         END;
-       END;
-    %]
-      cat > "$scripts_dir/create-browser_[% lang %]" << SCRIPT_EOF
-#!/bin/bash
-      set -e
-      cp -a ${TB_STAGE_DIR} [% tbdir %]
-      cp [% xpi %] "[% browserdir %]/$EXTSPATH/langpack-[% lang %]@firefox.mozilla.org.xpi"
-
-      pushd "[% browserdir %]/[% IF c("var/osx") %]Contents/Resources/[% END %]browser/"
-      mkdir -p defaults/preferences
-      cp $rootdir/[% c("var/prefs_file") %] defaults/preferences/
-      # Set the locale of the bundle.
-      echo "pref(\"intl.locale.requested\", \"[% lang %]\");" >> defaults/preferences/[% c("var/prefs_file") %]
-      [% c("touch") %] defaults/preferences/[% c("var/prefs_file") %]
-      zip -Xm omni.ja defaults/preferences/[% c("var/prefs_file") %]
-      rm -rf defaults
-      # create tbb_version.json file for #25020
-      echo '{"version":"[% c("var/torbrowser_version") %]","architecture":"[% c("var/mar_osname") %]","channel":"[% c("var/channel") %]","locale":"[% lang %]"}' > ../tbb_version.json
-      popd
-
-      # Set the update.locale (it is used to replace %LOCALE% within
-      # app.update.url), remove the en-US spellchecking dictionary, and
-      # recreate precomplete file (needs to be accurate for full MAR updates).
-      pushd "[% browserdir %]/[% IF c("var/osx") %]Contents/Resources/[% END %]"
-      echo "[% lang %]" > update.locale
-      [% c("touch") %] update.locale
-      zip -Xm omni.ja update.locale
-      rm -rf dictionaries
-      rm -f precomplete
-      python $MARTOOLS/createprecomplete.py
-      popd
-
-      cd $distdir
-
-      [% IF build_mar -%]
-        # Create full MAR file and compressed package for this locale.
-        MAR=$MARTOOLS/mar \
-        MOZ_PRODUCT_VERSION=[% c("var/torbrowser_version") %] \
-        MAR_CHANNEL_ID=torbrowser-torproject-[% c("var/channel") %] \
-        $MARTOOLS/make_full_update.sh -q $OUTDIR/[% mar_file %] "[% browserdir %]"
-      [% END -%]
-
-      [% IF c("var/linux") %]
-        [% SET tardir = c("var/project-name") _ '_' _ lang;
-          c('tar', {
-                tar_src => [ tardir ],
-                tar_args => '-cJf $OUTDIR/' _ c("var/project-name") _ '-' _ c("var/mar_osname") _ '-' _ c("var/torbrowser_version") _ '_' _ lang _ '.tar.xz',
-            }) %]
-      [% ELSIF c("var/osx") %]
-        [% # Rename the Japanese bundle to not confuse users
-           IF lang == 'ja-JP-mac';
-             SET lang = 'ja';
-           END; -%]
-        [% c('var/ddmg', {
-          dmg_src => tbdir,
-          dmg_out => '$OUTDIR/' _ c('var/ProjectName') _ '-' _ c("var/torbrowser_version") _ '-' _ c("var/dmg_name") _ '_' _ lang _ '.dmg',
-        }) %]
-      [% ELSIF c("var/windows") %]
-        find "[% tbdir %]" -exec [% c("touch") %] {} \;
-        pushd "[% tbdir %]"
-        makensis [% c("var/projectname") %].nsi
-        # Working around NSIS braindamage
-        mv [% c("var/projectname") %]-install.exe browser-install-tmp.exe
-        python3 $rootdir/pe_checksum_fix.py
-        mv browser-install-tmp2.exe [% c("var/projectname") %]-install.exe
-        rm browser-install-tmp.exe
-        mv [% c("var/projectname") %]-install.exe $OUTDIR/[% c("var/projectname") %]-install[% IF c("var/windows-x86_64") %]-win64[% END %]-[% c("var/torbrowser_version") %]_[% lang %].exe
-        popd
-      [% END %]
-      rm -rf [% tbdir %]
-SCRIPT_EOF
-  [% END %]
-[% END %]
-
 chmod 775 $rootdir/run_scripts "$scripts_dir"/*
 $rootdir/run_scripts [% c("num_procs") %] "$scripts_dir"
diff --git a/projects/browser/config b/projects/browser/config
index 4ae3e4f9..29d65f7e 100644
--- a/projects/browser/config
+++ b/projects/browser/config
@@ -73,9 +73,6 @@ input_files:
   - project: tor-expert-bundle
     name: tor-expert-bundle
     enable: '[% c("var/tor-browser") %]'
-  - project: firefox-langpacks
-    name: firefox-langpacks
-    enable: '[% (!c("var/testbuild") || c("var/multi_lingual")) && ! c("var/android") %]'
   - project: fonts
     name: fonts
     enable: '[% ! c("var/android") %]'
diff --git a/projects/firefox-langpacks/build b/projects/firefox-langpacks/build
deleted file mode 100644
index 6bc18101..00000000
--- a/projects/firefox-langpacks/build
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-[% c("var/set_default_env") -%]
-
-[% FOREACH lang = c('var/locales') %]
-  [% SET lang = tmpl(lang) %]
-  [% SET filename = c("var/input_filename") _ '/' _ lang _ '.xpi'; %]
-  shasum=$(grep '[% c("var/ff_arch") %]/xpi/[% lang %].xpi$' SHA512SUMS-[% c("version") %] | sed 's|  [% c("var/ff_arch") %]/xpi/[% lang %].xpi$||')
-  echo "$shasum  [% filename %]" | sha512sum -c
-[% END %]
-
-mkdir -p [% dest_dir %]/[% c("filename") %]
-[% FOREACH lang = c('var/locales') %]
-  [% SET lang = tmpl(lang) %]
-  [% SET filename = c("var/input_filename") _ '/' _ lang _ '.xpi'; %]
-  cp -a [% filename %] [% dest_dir %]/[% c("filename") %]/
-[% END %]
diff --git a/projects/firefox-langpacks/config b/projects/firefox-langpacks/config
deleted file mode 100644
index c2a11970..00000000
--- a/projects/firefox-langpacks/config
+++ /dev/null
@@ -1,50 +0,0 @@
-# vim: filetype=yaml sw=2
-version: '[% c("var/ff_version") %]-[% c("var/ff_build") %]'
-filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %]'
-
-var:
-  ff_version: '[% pc("firefox", "var/firefox_version") %]'
-  ff_build: build1
-  input_filename: 'dl-langpack-[% c("var/ff_arch") %]-[% c("version") %]'
-
-targets:
-  linux:
-    var:
-      ff_arch: 'linux-[% c("arch") %]'
-  windows-i686:
-    var:
-      ff_arch: win32
-  windows-x86_64:
-    var:
-      ff_arch: win64
-  osx:
-    var:
-      ff_arch: mac
-
-input_files:
-  - URL: 'https://ftp.mozilla.org/pub/firefox/candidates/[% c("var/ff_version") %]-candidates/[% c("var/ff_build") %]/SHA512SUMS'
-    filename: 'SHA512SUMS-[% c("version") %]'
-    gpg_keyring: firefox.gpg
-    sig_ext: asc
-    file_gpg_id: 1
-
-  - filename: '[% c("var/input_filename") %]'
-    refresh_input: 1
-    exec: |
-      #!/bin/bash
-      set -e
-      [% SET outdir = c("var/input_filename") %]
-      mkdir -p [% dest_dir %]/[% outdir %]
-      [% FOREACH lang = c('var/locales') %]
-      [% SET lang = tmpl(lang) %]
-      [% SET ffver = c("var/ff_version");
-         SET ffbuild = c("var/ff_build");
-         SET ffarch = c("var/ff_arch");
-         SET URL = "https://ftp.mozilla.org/pub/firefox/candidates/" _ ffver _ '-candidates/' _ ffbuild _ '/' _ ffarch _ '/xpi/' _ lang _ '.xpi';
-         SET filename = outdir _ '/' _ lang _ '.xpi'; %]
-      test -f [% dest_dir %]/[% filename %] || \
-         [% GET c("urlget", { filename => filename _ '-tmp', URL => URL }); %]
-      test -f [% dest_dir %]/[% filename %] || \
-         mv -f [% dest_dir %]/[% filename %]-tmp [% dest_dir %]/[% filename %]
-      [% END %]
-
diff --git a/rbm.conf b/rbm.conf
index 9f778028..4313cdc7 100644
--- a/rbm.conf
+++ b/rbm.conf
@@ -75,7 +75,6 @@ var:
   torbrowser_build: 'build1'
   torbrowser_incremental_from:
     - 12.0a3
-  multi_lingual: 1
   build_mar: 1
   # By default, we sort the list of installed packages. This allows sharing
   # containers with identical list of packages, even if they are not listed
diff --git a/tools/signing/check_file_counts b/tools/signing/check_file_counts
index a0524c8d..d374aa0a 100755
--- a/tools/signing/check_file_counts
+++ b/tools/signing/check_file_counts
@@ -149,13 +149,6 @@ total_count=$(( total_count + 2 ))
 remaining_files="$(echo "${remaining_files}" | sed 's/[ ]*'"${f}"'[ ]*/ /')"
 remaining_files="$(echo "${remaining_files}" | sed 's/[ ]*'"${f}.asc"'[ ]*/ /')"
 
-test "$(ls langpacks-tor-browser-linux64-*.tar.xz 2>/dev/null | wc -l)" = 1 || echo langpacks-tor-browser-linux64-*.tar.xz is wrong
-test "$(ls langpacks-tor-browser-linux64-*.tar.xz.asc 2>/dev/null | wc -l)" = 1 || echo langpacks-tor-browser-linux64-*.tar.xz.asc is wrong
-total_count=$(( total_count + 2 ))
-f="$(ls langpacks-tor-browser-linux64-*.tar.xz)"
-remaining_files="$(echo "${remaining_files}" | sed 's/[ ]*'"${f}"'[ ]*/ /')"
-remaining_files="$(echo "${remaining_files}" | sed 's/[ ]*'"${f}.asc"'[ ]*/ /')"
-
 # Expected file endings
 file_count_by_ending="$(ls ./*.tar.xz{,.asc} ./*.zip{,.asc} ./*.exe{,.asc} ./*.mar ./*.dmg{,.asc} ./*.apk{,.asc} ./*.txt{,.asc} ./*.txt.asc-* | wc -l)"
 test "${file_count_by_ending}" -eq ${total_count} || echo "Unexpected file endings: counted ${file_count_by_ending} vs ${total_count}"

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


More information about the tbb-commits mailing list