[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser-bundle/hardened-builds] Bug 18915: Use our search plugins in localized builds



commit 467796a7b7901fc22f26716860ed6ed8d4102416
Author: Georg Koppen <gk@xxxxxxxxxxxxxx>
Date:   Wed May 11 19:37:29 2016 +0000

    Bug 18915: Use our search plugins in localized builds
    
    We are preparing the language packs we ship for using our
    search engines in the order we want. This is necessary due
    to https://bugzilla.mozilla.org/show_bug.cgi?id=1162569.
---
 gitian/descriptors/linux/gitian-bundle.yml   | 19 +++++++++++++
 gitian/descriptors/mac/gitian-bundle.yml     | 19 +++++++++++++
 gitian/descriptors/windows/gitian-bundle.yml | 40 +++++++++++++++++++++-------
 3 files changed, 68 insertions(+), 10 deletions(-)

diff --git a/gitian/descriptors/linux/gitian-bundle.yml b/gitian/descriptors/linux/gitian-bundle.yml
index b9bf0f9..eca8d0f 100644
--- a/gitian/descriptors/linux/gitian-bundle.yml
+++ b/gitian/descriptors/linux/gitian-bundle.yml
@@ -184,6 +184,10 @@ script: |
   cp -a ${TB_STAGE_DIR} ${PKG_DIR}
   #
   pushd ${PKG_DIR}/Browser/browser/
+  # For the proper search engines in our language packs
+  unzip omni.ja chrome/en-US/locale/browser/searchplugins*
+  mv chrome/en-US/locale/browser/searchplugins ~/build
+  rm -rf chrome
   unzip omni.ja defaults/preferences/000-tor-browser.js
   cp defaults/preferences/000-tor-browser.js ~/build/
   # Set the locale of the bundle.
@@ -194,6 +198,21 @@ script: |
   #
   unzip linux-langpacks.zip
   LINUX_LOCALES="$BUNDLE_LOCALES $BUNDLE_LOCALES_LINUX"
+  # Prepare our language packs for using the proper search engines. See bug
+  # 18915 for more details.
+  for LANG in $LINUX_LOCALES
+  do
+    xpi=linux-langpacks/$LANG.xpi
+    unzip -d prep_$LANG $xpi
+    search_plugins_path=prep_$LANG/browser/chrome/$LANG/locale/browser
+    rm -rf $search_plugins_path/searchplugins
+    cp -rf ~/build/searchplugins $search_plugins_path
+    rm $xpi
+    cd prep_$LANG
+    zip -r9 ../$xpi *
+    cd ..
+    rm -rf prep_$LANG
+  done
   # If we are building a multi-lingual package, add all of the language packs.
   if [ "z$MULTI_LINGUAL" = "z1" ]; then
     pushd linux-langpacks
diff --git a/gitian/descriptors/mac/gitian-bundle.yml b/gitian/descriptors/mac/gitian-bundle.yml
index 0199cca..e046b57 100644
--- a/gitian/descriptors/mac/gitian-bundle.yml
+++ b/gitian/descriptors/mac/gitian-bundle.yml
@@ -184,6 +184,10 @@ script: |
   cd ..
   #
   pushd $TORBROWSER_NAME.app/Contents/Resources/browser/
+  # For the proper search engines in our language packs
+  unzip omni.ja chrome/en-US/locale/browser/searchplugins*
+  mv chrome/en-US/locale/browser/searchplugins ~/build
+  rm -rf chrome
   unzip omni.ja defaults/preferences/000-tor-browser.js
   cp defaults/preferences/000-tor-browser.js ~/build/
   # Set the locale of the bundle.
@@ -203,6 +207,21 @@ script: |
 
   unzip mac-langpacks.zip
   MAC_LOCALES="$BUNDLE_LOCALES $BUNDLE_LOCALES_MAC"
+  # Prepare our language packs for using the proper search engines. See bug
+  # 18915 for more details.
+  for LANG in $MAC_LOCALES
+  do
+    xpi=mac-langpacks/$LANG.xpi
+    unzip -d prep_$LANG $xpi
+    search_plugins_path=prep_$LANG/browser/chrome/$LANG/locale/browser
+    rm -rf $search_plugins_path/searchplugins
+    cp -rf ~/build/searchplugins $search_plugins_path
+    rm $xpi
+    cd prep_$LANG
+    zip -r9 ../$xpi *
+    cd ..
+    rm -rf prep_$LANG
+  done
   PKG_LOCALE="en-US"
   # If we are building a multi-lingual package, add all of the language packs
   # and use "ALL" in the package name and as the locale for update purposes.
diff --git a/gitian/descriptors/windows/gitian-bundle.yml b/gitian/descriptors/windows/gitian-bundle.yml
index 51565bf..5473bf3 100644
--- a/gitian/descriptors/windows/gitian-bundle.yml
+++ b/gitian/descriptors/windows/gitian-bundle.yml
@@ -152,8 +152,38 @@ script: |
   cp ../versions "Tor Browser"/Browser/TorBrowser/Docs/sources/
   cp ../bundle.inputs "Tor Browser"/Browser/TorBrowser/Docs/sources/
 
+  #
+  pushd "Tor Browser"/Browser/browser/
+  # For the proper search engines in our language packs
+  unzip omni.ja chrome/en-US/locale/browser/searchplugins*
+  mv chrome/en-US/locale/browser/searchplugins ~/build
+  rm -rf chrome
+  unzip omni.ja defaults/preferences/000-tor-browser.js
+  cp defaults/preferences/000-tor-browser.js ~/build/
+  # Set the locale bundle.
+  echo "pref(\"general.useragent.locale\", \"en-US\");" >> defaults/preferences/000-tor-browser.js
+  zip -Xm omni.ja defaults/preferences/000-tor-browser.js
+  rm -rf defaults
+  popd
+  #
+
   unzip ../win32-langpacks.zip
   WIN32_LOCALES="$BUNDLE_LOCALES $BUNDLE_LOCALES_WIN32"
+  # Prepare our language packs for using the proper search engines. See bug
+  # 18915 for more details.
+  for LANG in $WIN32_LOCALES
+  do
+    xpi=win32-langpacks/$LANG.xpi
+    unzip -d prep_$LANG $xpi
+    search_plugins_path=prep_$LANG/browser/chrome/$LANG/locale/browser
+    rm -rf $search_plugins_path/searchplugins
+    cp -rf ~/build/searchplugins $search_plugins_path
+    rm $xpi
+    cd prep_$LANG
+    zip -r9 ../$xpi *
+    cd ..
+    rm -rf prep_$LANG
+  done
   PKG_LOCALE="en-US"
   # If we are building a multi-lingual package, add all of the language packs
   # and use "ALL" in the package name and as the locale for update purposes.
@@ -175,16 +205,6 @@ script: |
     popd
   fi
 
-  #
-  pushd "Tor Browser"/Browser/browser/
-  unzip omni.ja defaults/preferences/000-tor-browser.js
-  cp defaults/preferences/000-tor-browser.js ~/build/
-  # Set the locale bundle.
-  echo "pref(\"general.useragent.locale\", \"en-US\");" >> defaults/preferences/000-tor-browser.js
-  zip -Xm omni.ja defaults/preferences/000-tor-browser.js
-  rm -rf defaults
-  popd
-  #
   # Recreate precomplete file (needs to be accurate for full MAR updates).
   pushd "Tor Browser"/Browser/
   rm -f precomplete

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits