From c79b72163e7f4020a3f37bec7499af5ac21d7884 Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 4 Nov 2005 16:23:20 +0000 Subject: [PATCH] [project @ 2005-11-04 16:23:20 by simonmar] Document GHC_PACKAGE_PATH, and changes to the ghc-pkg command line interface. --- ghc/docs/users_guide/packages.xml | 84 ++++++++++++++++++++++++++----------- 1 file changed, 59 insertions(+), 25 deletions(-) diff --git a/ghc/docs/users_guide/packages.xml b/ghc/docs/users_guide/packages.xml index 8b47325..b955f00 100644 --- a/ghc/docs/users_guide/packages.xml +++ b/ghc/docs/users_guide/packages.xml @@ -55,9 +55,9 @@ $ ghc-pkg list ghc-pkg list. To expose a package which is hidden by default, use the flag (see below). - - To see which modules are exposed by a package: - + + To see which modules are exposed by a package: + $ ghc-pkg field network exposed-modules exposed-modules: Network.BSD, @@ -223,8 +223,7 @@ exposed-modules: Network.BSD, Windows it will be something like C:\Documents And Settings\user\ghc. The ghc-pkg tool knows where this file should be - located, and will create it if it doesn't exist (see ). + located, and will create it if it doesn't exist (see ). @@ -272,6 +271,34 @@ exposed-modules: Network.BSD, added to the file using the ghc-pkg tool, described in . + + + The <literal>GHC_PACKAGE_PATH</literal> environment variable + Environment variableGHC_PACKAGE_PATH + + GHC_PACKAGE_PATH + The GHC_PACKAGE_PATH environment variable may be + set to a :-separated (;-separated + on Windows) list of files containing package databases. This list of + package databases is used by GHC and ghc-pkg, with earlier databases in + the list overriding later ones. This order was chosen to match the + behaviour of the PATH environment variable; think of + it as a list of package databases that are searched left-to-right for + packages. + + If GHC_PACKAGE_PATH ends in a separator, then + the default user and system package databases are appended, in that + order. e.g. to augment the usual set of packages with a database of + your own, you could say (on Unix): + +$ export GHC_PACKAGE_PATH=$HOME/.my-ghc-packages.conf: + (use ; instead of : on + Windows). + + To check whether your GHC_PACKAGE_PATH setting + is doing the right thing, ghc-pkg list will list all + the databases in use, in the reverse order they are searched. + @@ -361,12 +388,20 @@ exposed-modules: Network.BSD, the user's local package database or another specified file can be used. - Commands which only inspect the database (list, - describe, field) will take into - account the user's local package database too, unless the - --global option is given. This matches the behaviour - of GHC, which automatically reads the user's local database if it is - available. + To see what package databases are in use, say + ghc-pkg list. The stack of databases that + ghc-pkg knows about can be modified using the + GHC_PACKAGE_PATH environment variable (see , and using + --package-conf options on the + ghc-pkg command line. + + When asked to modify a database, ghc-pkg modifies + the global database by default. Specifying + causes it to act on the user database, or + can be used to act on another database entirely. When multiple of these + options are given, the rightmost one is used as the database to act + upon. The ghc-pkg program may be run in the ways listed below. Where a package name is required, the package can be named in @@ -432,9 +467,8 @@ exposed-modules: Network.BSD, This option displays the currently installed packages, for each of the databases known to ghc-pkg. That includes the global database, the - user's local database (if is given), and - any further files specified using the option on - the command line. + user's local database, and any further files specified using the + option on the command line. Hidden packages (those for which the exposed flag is False) are shown in parentheses in the @@ -486,7 +520,7 @@ exposed-modules: Network.BSD, - + @@ -518,13 +552,13 @@ exposed-modules: Network.BSD, - Operate on the package database in - file. - - When multiple options are given, or - is used in conjunction with - or , the last - one on the command-line is the one that will be modified. + Adds file to the stack of package + databases. Additionally, file will + also be the database modified by a register, + unregister, expose or + hide command, unless it is overriden by a later + , or + option. @@ -546,7 +580,7 @@ exposed-modules: Network.BSD, - + @@ -560,7 +594,7 @@ exposed-modules: Network.BSD, - + @@ -592,7 +626,7 @@ exposed-modules: Network.BSD, - + -- 1.7.10.4