Commit 6c822126 authored by Tails developers's avatar Tails developers

Rewrite Unsafe Browser branding patching mechanism for FF24.

Mozilla's .ja and .jar files are now optimized in a way that makes it basically
non-standard ZIP archives. 7z can't read them, so let's switch to unzip, that
warns and cries but manages to handle it (still have to ignore its non-zero exit
code, but well).

So, we need to install unzip.

https://bugzilla.mozilla.org/show_bug.cgi?id=605524
https://bugzilla.mozilla.org/show_bug.cgi?id=595473
parent 7a703b63
......@@ -123,11 +123,11 @@ set_chroot_browser_name () {
BRANDING=branding/brand.dtd
if [ -e "${EXT_DIR}/langpack-${LONG}@iceweasel.mozilla.org.xpi" ]; then
PACK="${EXT_DIR}/langpack-${LONG}@iceweasel.mozilla.org.xpi"
TOP=chrome
TOP=browser/chrome
REST=${LONG}/locale
elif [ -e "${EXT_DIR}/langpack-${SHORT}@iceweasel.mozilla.org.xpi" ]; then
PACK="${EXT_DIR}/langpack-${SHORT}@iceweasel.mozilla.org.xpi"
TOP=chrome
TOP=browser/chrome
REST=${SHORT}/locale
else
PACK=${CHROOT}/usr/share/iceweasel/browser/chrome/en-US.jar
......@@ -136,9 +136,12 @@ set_chroot_browser_name () {
fi
TMP=$(mktemp -d)
7z x "${PACK}" -o"${TMP}"
# Non-zero exit code due to non-standard ZIP archive.
# The following steps will fail soon if the extraction failed anyway.
unzip -d "${TMP}" "${PACK}" || true
sed -i "s/Iceweasel/${NAME}/" "${TMP}"/"${TOP}"/"${REST}"/"${BRANDING}"
7z u -tzip "${PACK}" "${TMP}"/"${TOP}"
rm "${PACK}"
(cd $TMP ; 7z a -tzip "${PACK}" .)
chmod a+r "${PACK}"
rm -Rf "${TMP}"
}
......
......@@ -52,6 +52,8 @@ xclip
libnotify-bin
# needed by live-persist
acl
# needed by the Unsafe Browser
unzip
### Software
......
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