summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/haskell/generic/ghcPkgUtil.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkgs/development/libraries/haskell/generic/ghcPkgUtil.sh b/pkgs/development/libraries/haskell/generic/ghcPkgUtil.sh
index e265195b321..5760372888e 100644
--- a/pkgs/development/libraries/haskell/generic/ghcPkgUtil.sh
+++ b/pkgs/development/libraries/haskell/generic/ghcPkgUtil.sh
@@ -16,7 +16,11 @@
 # if not already contained
 setupHookRegisteringPackageDatabase(){
   ensureDir $out/nix-support;
-  local pkgdb=$out/nix-support/package.conf
+  if test -n "$1"; then
+    local pkgdb=$1
+  else
+    local pkgdb=$out/nix-support/package.conf
+  fi
   cat >> $out/nix-support/setup-hook << EOF
     
     echo \$GHC_PACKAGE_PATH | grep -l $pkgdb &> /dev/null || \
@@ -28,6 +32,6 @@ EOF
 createEmptyPackageDatabaseAndSetupHook(){
   ensureDir $out/nix-support;
   PACKAGE_DB=$out/nix-support/package.conf;
-  echo '[]' > $PACKAGE_DB";
+  echo '[]' > "$PACKAGE_DB";
   setupHookRegisteringPackageDatabase
 }