Commit b47dc236 authored by Tails developers's avatar Tails developers
Browse files

Optimize the startup of the chroot browsers.

Extracting and then compressing the whole langpack/omni.ja isn't
necessary and takes a lot of time. Tests show a 50% reduction in
startup time.
parent 3e80d570
...@@ -113,7 +113,6 @@ set_chroot_browser_name () { ...@@ -113,7 +113,6 @@ set_chroot_browser_name () {
NAME="${1}" NAME="${1}"
LOCALE="${2}" LOCALE="${2}"
EXT_DIR=${CHROOT}/"${TBB_EXT}" EXT_DIR=${CHROOT}/"${TBB_EXT}"
BRANDING=branding/brand.dtd
if [ "${LOCALE}" != en-US ]; then if [ "${LOCALE}" != en-US ]; then
PACK="${EXT_DIR}/langpack-${LOCALE}@firefox.mozilla.org.xpi" PACK="${EXT_DIR}/langpack-${LOCALE}@firefox.mozilla.org.xpi"
TOP=browser/chrome TOP=browser/chrome
...@@ -124,12 +123,12 @@ set_chroot_browser_name () { ...@@ -124,12 +123,12 @@ set_chroot_browser_name () {
REST=en-US/locale REST=en-US/locale
fi fi
TMP=$(mktemp -d) TMP=$(mktemp -d)
BRANDING="${TOP}/${REST}/branding/brand.dtd"
# Non-zero exit code due to non-standard ZIP archive. # Non-zero exit code due to non-standard ZIP archive.
# The following steps will fail soon if the extraction failed anyway. # The following steps will fail soon if the extraction failed anyway.
7z x -o"${TMP}" "${PACK}" || true 7z x -o"${TMP}" "${PACK}" "${BRANDING}" || true
sed -i "s/<"'!'"ENTITY\s\+brand\(Full\|Short\)Name.*$/<"'!'"ENTITY brand\1Name \"${NAME}\">/" "${TMP}/${TOP}/${REST}/${BRANDING}" sed -i "s/<"'!'"ENTITY\s\+brand\(Full\|Short\)Name.*$/<"'!'"ENTITY brand\1Name \"${NAME}\">/" "${TMP}/${BRANDING}"
rm "${PACK}" (cd $TMP ; 7z u -tzip "${PACK}" .)
(cd $TMP ; 7z a -tzip "${PACK}" .)
chmod a+r "${PACK}" chmod a+r "${PACK}"
rm -Rf "${TMP}" rm -Rf "${TMP}"
} }
......
...@@ -113,7 +113,6 @@ set_chroot_browser_name () { ...@@ -113,7 +113,6 @@ set_chroot_browser_name () {
NAME="${1}" NAME="${1}"
LOCALE="${2}" LOCALE="${2}"
EXT_DIR=${CHROOT}/"${TBB_EXT}" EXT_DIR=${CHROOT}/"${TBB_EXT}"
BRANDING=branding/brand.dtd
if [ "${LOCALE}" != en-US ]; then if [ "${LOCALE}" != en-US ]; then
PACK="${EXT_DIR}/langpack-${LOCALE}@firefox.mozilla.org.xpi" PACK="${EXT_DIR}/langpack-${LOCALE}@firefox.mozilla.org.xpi"
TOP=browser/chrome TOP=browser/chrome
...@@ -124,12 +123,12 @@ set_chroot_browser_name () { ...@@ -124,12 +123,12 @@ set_chroot_browser_name () {
REST=en-US/locale REST=en-US/locale
fi fi
TMP=$(mktemp -d) TMP=$(mktemp -d)
BRANDING="${TOP}/${REST}/branding/brand.dtd"
# Non-zero exit code due to non-standard ZIP archive. # Non-zero exit code due to non-standard ZIP archive.
# The following steps will fail soon if the extraction failed anyway. # The following steps will fail soon if the extraction failed anyway.
7z x -o"${TMP}" "${PACK}" || true 7z x -o"${TMP}" "${PACK}" "${BRANDING}" || true
sed -i "s/<"'!'"ENTITY\s\+brand\(Full\|Short\)Name.*$/<"'!'"ENTITY brand\1Name \"${NAME}\">/" "${TMP}/${TOP}/${REST}/${BRANDING}" sed -i "s/<"'!'"ENTITY\s\+brand\(Full\|Short\)Name.*$/<"'!'"ENTITY brand\1Name \"${NAME}\">/" "${TMP}/${BRANDING}"
rm "${PACK}" (cd $TMP ; 7z u -tzip "${PACK}" .)
(cd $TMP ; 7z a -tzip "${PACK}" .)
chmod a+r "${PACK}" chmod a+r "${PACK}"
rm -Rf "${TMP}" rm -Rf "${TMP}"
} }
......
Markdown is supported
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