From be4efc801057e5d54c94374098a7862fe3d7a3b4 Mon Sep 17 00:00:00 2001 From: ryneeverett Date: Sun, 12 Jan 2020 21:41:31 +0000 Subject: [PATCH 1/2] gitstatus: patch fewer characters This is a followup to https://github.com/NixOS/nixpkgs/pull/76744. The patch is still too aggressive because it captures additional local variables declared in the same line. It should stop when it hits whitespace. See https://github.com/romkatv/gitstatus/pull/92. --- .../version-management/git-and-tools/gitstatus/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/version-management/git-and-tools/gitstatus/default.nix b/pkgs/applications/version-management/git-and-tools/gitstatus/default.nix index 94753275b613..429ab092f406 100644 --- a/pkgs/applications/version-management/git-and-tools/gitstatus/default.nix +++ b/pkgs/applications/version-management/git-and-tools/gitstatus/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation { buildInputs = [ (callPackage ./romkatv_libgit2.nix {}) ]; patchPhase = '' - sed -i "s|local daemon=.*|local daemon=$out/bin/gitstatusd|" gitstatus.plugin.zsh + sed -i "s|local daemon=\S*|local daemon=$out/bin/gitstatusd|" gitstatus.plugin.zsh ''; installPhase = '' install -Dm755 gitstatusd $out/bin/gitstatusd From f5e446b30fea10895bbd3ff90e27737d1754b899 Mon Sep 17 00:00:00 2001 From: ryneeverett Date: Sun, 12 Jan 2020 22:21:25 +0000 Subject: [PATCH 2/2] gitstatus: patch in variable rather than regexing Patching in the GITSTATUS_DAEMON variable seems like a more stable solution than doing inline replacements. --- .../version-management/git-and-tools/gitstatus/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/version-management/git-and-tools/gitstatus/default.nix b/pkgs/applications/version-management/git-and-tools/gitstatus/default.nix index 429ab092f406..9b77690868be 100644 --- a/pkgs/applications/version-management/git-and-tools/gitstatus/default.nix +++ b/pkgs/applications/version-management/git-and-tools/gitstatus/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation { buildInputs = [ (callPackage ./romkatv_libgit2.nix {}) ]; patchPhase = '' - sed -i "s|local daemon=\S*|local daemon=$out/bin/gitstatusd|" gitstatus.plugin.zsh + sed -i "1i GITSTATUS_DAEMON=$out/bin/gitstatusd" gitstatus.plugin.zsh ''; installPhase = '' install -Dm755 gitstatusd $out/bin/gitstatusd