--- toast	2005/09/05 22:29:42	1.396
+++ toast	2005/09/06 00:10:01	1.397
@@ -1440,7 +1440,7 @@
   push(@vars, newenvvar("CPATH", "include"));
   push(@vars, newenvvar("LIBRARY_PATH", "lib"));
   push(@vars, newenvvar("XML_CATALOG_FILES", $x, "/$x", " ")) if xmlcatalog;
-  push(@vars, newenvvar("HS_PKG_PATH", $hspkgdir)) if hspkg;
+  push(@vars, newenvvar("GHC_PKG_PATH", $hspkgdir)) if hspkg;
   # there's also a LIBRARY_RUN_PATH or something that affects ld somehow...
   return @vars;
 }
@@ -2644,7 +2644,8 @@
 }
 else
 {
-  push(@extra, "--package-conf=$_") for split(/:/, $ENV{"HS_PKG_PATH"} || "");
+  push(@extra, ($me =~ /-pkg/ ? "-" : "") . "-package-conf", $_)
+      for grep(-r, split(/:/, $ENV{"GHC_PKG_PATH"} || ""));
 }
 $ENV{"TOAST_HS_WRAPPER"} = $wrap .= $0;
 
@@ -2671,7 +2672,7 @@
 EOF
 
 chmod +x "$wrapper"
-for i in ghc; do
+for i in ghc ghci ghc-pkg runghc runhaskell; do
   path="$rootdir/bin/$i"
   if [ -r "$path" -a ! -r "$path.unwrapped" ] && ! diff -q "$path" "$wrapper"
   then
@@ -6849,7 +6850,7 @@
 automatically populated by a wrapper script whenever a Haskell library
 built via B<toast build> tries to register itself in the package database.
 If the package database already exists, it may be overwritten or deleted.
-The B<toast env> command will set C<HS_PKG_PATH> to point to this file
+The B<toast env> command will set C<GHC_PKG_PATH> to point to this file
 when this option is set, which will cause wrapper scripts installed with
 ghc and/or Haskell libraries to insert a --package-conf argument into
 the command lines of some of the appropriate programs.  If B<hspkg> is