summaryrefslogtreecommitdiff
path: root/custom/redo.patch
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2015-07-16 11:54:00 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2015-07-16 11:54:00 +0200
commit0c7281ee4a7858b8288cd6c3d60da8b40cb2e698 (patch)
treebaa8f914f99425cc8807efa46a503289db5e6d40 /custom/redo.patch
parentda267a7cf4459ce35901c83e3423fff7767244a0 (diff)
downloadnixos-0c7281ee4a7858b8288cd6c3d60da8b40cb2e698.tar
nixos-0c7281ee4a7858b8288cd6c3d60da8b40cb2e698.tar.gz
nixos-0c7281ee4a7858b8288cd6c3d60da8b40cb2e698.tar.bz2
nixos-0c7281ee4a7858b8288cd6c3d60da8b40cb2e698.tar.xz
nixos-0c7281ee4a7858b8288cd6c3d60da8b40cb2e698.zip
Wrapper around redo for $PATH reasons
Diffstat (limited to 'custom/redo.patch')
-rw-r--r--custom/redo.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/custom/redo.patch b/custom/redo.patch
new file mode 100644
index 00000000..cd3a678e
--- /dev/null
+++ b/custom/redo.patch
@@ -0,0 +1,18 @@
1diff --git a/redo.hs b/redo.hs
2index f0e816a..01c6a2e 100644
3--- a/redo.hs
4+++ b/redo.hs
5@@ -48,7 +48,12 @@ redo target dir = do
6 createDirectoryIfMissing True metaDepsDir
7 writeMD5 target path
8 oldEnv <- getEnvironment
9- let newEnv = toList $ adjust (++ ":.") "PATH" $ insert "REDO_TARGET" target $ fromList oldEnv
10+ redoPath <- lookupEnv "REDO_PATH"
11+ let
12+ redoPath' = case redoPath of
13+ Just p -> p
14+ _ -> "."
15+ newEnv = toList $ adjust (++ (':' : redoPath')) "PATH" $ insert "REDO_TARGET" target $ fromList oldEnv
16 (_, _, _, ph) <- createProcess $ (shell $ cmd path) {env = Just newEnv}
17 exit <- waitForProcess ph
18 case exit of