Skip to content

Commit

Permalink
{tor,mullvad}-browser: replace some sed commands with substituteInPlace
Browse files Browse the repository at this point in the history
The new substituteInPlace commands will fail when they don't apply,
which will avoid some issues.
  • Loading branch information
felschr committed Apr 30, 2024
1 parent c69a216 commit f004811
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ stdenv.mkDerivation rec {
# fonts.conf; upstream uses FONTCONFIG_PATH, but FC_DEBUG=1024
# indicates the system fonts.conf being used instead.
FONTCONFIG_FILE=$MB_IN_STORE/fontconfig/fonts.conf
sed -i "$FONTCONFIG_FILE" \
-e "s,<dir prefix=\"cwd\">fonts</dir>,<dir>$MB_IN_STORE/fonts</dir>,"
substituteInPlace "$FONTCONFIG_FILE" \
--replace-fail '<dir prefix="cwd">fonts</dir>' "<dir>$MB_IN_STORE/fonts</dir>"
mkdir -p $out/bin
Expand Down
8 changes: 4 additions & 4 deletions pkgs/applications/networking/browsers/tor-browser/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ stdenv.mkDerivation rec {
''}
# Fixup paths to pluggable transports.
sed -i TorBrowser/Data/Tor/torrc-defaults \
-e "s,./TorBrowser,$TBB_IN_STORE/TorBrowser,g"
substituteInPlace TorBrowser/Data/Tor/torrc-defaults \
--replace-fail './TorBrowser' "$TBB_IN_STORE/TorBrowser"
# Fixup obfs transport. Work around patchelf failing to set
# interpreter for pre-compiled Go binaries by invoking the interpreter
Expand Down Expand Up @@ -263,8 +263,8 @@ stdenv.mkDerivation rec {
# fonts.conf; upstream uses FONTCONFIG_PATH, but FC_DEBUG=1024
# indicates the system fonts.conf being used instead.
FONTCONFIG_FILE=$TBB_IN_STORE/fontconfig/fonts.conf
sed -i "$FONTCONFIG_FILE" \
-e "s,<dir prefix=\"cwd\">fonts</dir>,<dir>$TBB_IN_STORE/fonts</dir>,"
substituteInPlace "$FONTCONFIG_FILE" \
--replace-fail '<dir prefix="cwd">fonts</dir>' "<dir>$TBB_IN_STORE/fonts</dir>"
# Hard-code paths to geoip data files. TBB resolves the geoip files
# relative to torrc-defaults_path but if we do not hard-code them
Expand Down

0 comments on commit f004811

Please sign in to comment.