Skip to content

patch-the-fox fails early at unzip. #8

Description

@ewtoombs

The newest versions you posted of the script read if [ "$status" -ne 0 ]; then instead of if [ "$status" -ne 2 ]; then, like the original version did. That causes the script to halt early, even if the unzip command succeeds. Here's my version. (I couldn't help but make a few other modifications. They aren't as important, though. And the patch itself is completely different. Just ignore that bit.)

#!/bin/bash

# Causes ctrl-T to make new windows instead of tabs in firefox.

set -e

tempdir="$(mktemp --tmpdir -d patch-the-fox.XXXX)"
mkdir "$tempdir/extract"
pushd "$tempdir/extract"

set +e
unzip /usr/lib/firefox/browser/omni.ja; res="$?"
if [ "$res" -ne 2 ]; then
  echo >&2 "Unexpected exit code from unzip: $res"
  exit "$res"
fi
set -e
patch -p0 <<EOF
--- chrome/browser/content/browser/browser.xhtml-	2010-01-01 00:00:00.000000000 +0000
+++ chrome/browser/content/browser/browser.xhtml	2020-06-04 13:25:15.312315566 +0000
@@ -279,7 +279,7 @@
          command="cmd_newNavigator"
          modifiers="accel" reserved="true"/>
     <key id="key_newNavigatorTab" data-l10n-id="tab-new-shortcut" modifiers="accel"
-         command="cmd_newNavigatorTabNoEvent" reserved="true"/>
+         command="cmd_newNavigator" reserved="true"/>
     <key id="focusURLBar" data-l10n-id="location-open-shortcut" command="Browser:OpenLocation"
          modifiers="accel"/>
     <key id="focusURLBar2" data-l10n-id="location-open-shortcut-alt" command="Browser:OpenLocation"
EOF
zip -qr9XD ../omni.ja *
sudo cp "$tempdir/omni.ja" /usr/lib/firefox/browser
find ~/.cache/mozilla/firefox -type d -name startupCache -exec rm -rf {} \;
popd
rm -r "$tempdir"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions