[project @ 2005-11-04 15:48:25 by simonmar]
authorsimonmar <unknown>
Fri, 4 Nov 2005 15:48:26 +0000 (15:48 +0000)
committersimonmar <unknown>
Fri, 4 Nov 2005 15:48:26 +0000 (15:48 +0000)
commitbe8b6cd519e181e2553ee48ef4a82b8d56a4e9b6
treecd8fb6fef09fc730f0730864a549ce79fec03e68
parentde808d3b036673f29693f8380e1114c19d0d3493
[project @ 2005-11-04 15:48:25 by simonmar]
- Add support for the GHC_PACKAGE_PATH environment variable, which
  specifies a :-separated (;-separated on Windows) list of package
  database files.  If the list ends in : (; on Windows), then the
  normal user and global databases are added.

  GHC_PACKAGE_PATH is searched left-to-right for packages, like
  $PATH, but unlike -package-conf flags, which are searched
  right-to-left.  This isn't ideal, but it seemed the least worst to me
  (command line flags always override right-to-left (except -i),
  whereas the PATH environment variable overrides left-to-right, I chose
  to follow the environment variable convention).  I can always change
  it if there's an outcry.

- Rationalise the interpretation of --user, --global, and -f on the
  ghc-pkg command line.  The story is now this: --user and --global
  say which package database to *act upon*, they do not change the
  shape of the database stack.  -f pushes a database on the stack, and
  also requests that the specified database be the one to act upon, for
  commands that modify the database.  If a database is already on the stack,
  then -f just selects it as the one to act upon.

  This means you can have a bunch of databases in GHC_PACKAGE_PATH, and
  use -f to select the one to modify.
ghc/compiler/main/Packages.lhs
ghc/compiler/utils/Util.lhs
ghc/utils/ghc-pkg/Main.hs