gitRepo: Cleanup the patchPhase

This variant should be easier to read (it was pretty messy before...).
The end result stays the same.
This commit is contained in:
Michael Weiss 2019-01-19 12:23:08 +01:00
parent 74b7aae3af
commit cc5f7d9091
No known key found for this signature in database
GPG key ID: 5BE487C4D4771D83

View file

@ -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 = ''