about summary refs log tree commit diff
path: root/pkgs/applications/version-management/git-repo
diff options
context:
space:
mode:
authorMichael Weiss <dev.primeos@gmail.com>2019-01-19 12:23:08 +0100
committerMichael Weiss <dev.primeos@gmail.com>2019-01-19 12:30:08 +0100
commitcc5f7d9091396fc328b789033b69730366bdd36f (patch)
tree390d45081aa557f36124fd4cd9896edcf020986e /pkgs/applications/version-management/git-repo
parent74b7aae3afde80f4627ae92a695073e167ccc39a (diff)
gitRepo: Cleanup the patchPhase
This variant should be easier to read (it was pretty messy before...).
The end result stays the same.
Diffstat (limited to 'pkgs/applications/version-management/git-repo')
-rw-r--r--pkgs/applications/version-management/git-repo/default.nix6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkgs/applications/version-management/git-repo/default.nix b/pkgs/applications/version-management/git-repo/default.nix
index 11fa892f135d1..b629c8fe9109b 100644
--- a/pkgs/applications/version-management/git-repo/default.nix
+++ b/pkgs/applications/version-management/git-repo/default.nix
@@ -16,10 +16,10 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ makeWrapper ];
   buildInputs = [ python ];
 
-  # TODO: Cleanup
   patchPhase = ''
-    CA_PATH="$(echo '${cacert}/etc/ssl/certs/ca-bundle.crt' | sed 's/\//\\\//g')" # / -> \/
-    sed -i -E 's/urlopen\(url\)/urlopen(url, cafile="'$CA_PATH'")/' repo
+    substituteInPlace repo --replace \
+      'urllib.request.urlopen(url)' \
+      'urllib.request.urlopen(url, cafile="${cacert}/etc/ssl/certs/ca-bundle.crt")'
   '';
 
   installPhase = ''