about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2006-11-08 09:26:18 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2006-11-08 09:26:18 +0000
commit36b1473e09f52ecae7e32c0fa2f21dcc5bfaa237 (patch)
tree384a7bf80b6d20eb1c37101c07f29aa698c507fb /pkgs
parent986ec9c8a12cef0c38d8f39edd1117e74d8b0f45 (diff)
downloadnixlib-36b1473e09f52ecae7e32c0fa2f21dcc5bfaa237.tar
nixlib-36b1473e09f52ecae7e32c0fa2f21dcc5bfaa237.tar.gz
nixlib-36b1473e09f52ecae7e32c0fa2f21dcc5bfaa237.tar.bz2
nixlib-36b1473e09f52ecae7e32c0fa2f21dcc5bfaa237.tar.lz
nixlib-36b1473e09f52ecae7e32c0fa2f21dcc5bfaa237.tar.xz
nixlib-36b1473e09f52ecae7e32c0fa2f21dcc5bfaa237.tar.zst
nixlib-36b1473e09f52ecae7e32c0fa2f21dcc5bfaa237.zip
* Allow the result to be stored somewhere else than $out.
svn path=/nixpkgs/trunk/; revision=6978
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/build-support/substitute/generic-substituter.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkgs/build-support/substitute/generic-substituter.sh b/pkgs/build-support/substitute/generic-substituter.sh
index 085e749c3313..51db11bfa79e 100644
--- a/pkgs/build-support/substitute/generic-substituter.sh
+++ b/pkgs/build-support/substitute/generic-substituter.sh
@@ -3,14 +3,20 @@ source $substitute
 
 args=
 
+target=$out
+if test -n "$dir"; then
+    target=$out/$dir/$name
+    ensureDir $out/$dir
+fi
+
 # Select all environment variables that start with a lowercase character.
 for envVar in $(env | sed "s/^[^a-z].*//" | sed "s/^\([^=]*\)=.*/\1/"); do
     echo "$envVar -> ${!envVar}"
     args="$args --subst-var $envVar"
 done
 
-substitute $src $out $args
+substitute $src $target $args
 
 if test -n "$isExecutable"; then
-    chmod +x $out
+    chmod +x $target
 fi