From a3b69c0d5c80062acf19a8858da2032d7b1b85b3 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sat, 3 Jun 2017 20:45:51 +0200 Subject: [PATCH] fetchgit: add postFetch argument --- pkgs/build-support/fetchgit/builder.sh | 1 + pkgs/build-support/fetchgit/default.nix | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/fetchgit/builder.sh b/pkgs/build-support/fetchgit/builder.sh index 4bbef1d6e62..6ae46469738 100644 --- a/pkgs/build-support/fetchgit/builder.sh +++ b/pkgs/build-support/fetchgit/builder.sh @@ -12,4 +12,5 @@ $SHELL $fetcher --builder --url "$url" --out "$out" --rev "$rev" \ ${fetchSubmodules:+--fetch-submodules} \ ${branchName:+--branch-name "$branchName"} +runHook postFetch stopNest diff --git a/pkgs/build-support/fetchgit/default.nix b/pkgs/build-support/fetchgit/default.nix index d85d2c893c5..a5f81ef1794 100644 --- a/pkgs/build-support/fetchgit/default.nix +++ b/pkgs/build-support/fetchgit/default.nix @@ -15,6 +15,9 @@ in , fetchSubmodules ? true, deepClone ? false , branchName ? null , name ? urlToName url rev +, # Shell code executed after the file has been fetched + # successfully. This can do things like check or transform the file. + postFetch ? "" }: /* NOTE: @@ -54,7 +57,7 @@ stdenv.mkDerivation { outputHashMode = "recursive"; outputHash = sha256; - inherit url rev leaveDotGit fetchSubmodules deepClone branchName; + inherit url rev leaveDotGit fetchSubmodules deepClone branchName postFetch; GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt";