Skip to content
  • Duncan Coutts's avatar
    Provide the pkgroot value in ghc-pkg dump & describe when necessary · f35a3d24
    Duncan Coutts authored
    Tools handling installed packages need to be able to interpret the
    paths which are relative to the ${pkgroot} which means they need to
    know the value of ${pkgroot}. With ghc-pkg this is not always obvious
    since ghc-pkg does not currently have any way machine interface for
    reporting the location of its package dbs (global, user). The solution
    we have arrived at is simply to emit the pkgroot as an extra field
    when it is needed.
    
    There are two cases:
     * --no-expand-pkgroot: ghc-pkg dump/describe will not expand the
       ${pkgroot} var, so it will appear literally in the output and the
       pkgroot field will be generated so that tools know what value to
       use for the ${pkgroot}.
     * --expand-pkgroot: ghc-pkg dump/describe will expand the ${pkgroot}
       and ${pkgrooturl} vars and will not generate the pkgroot field.
    
    The defaults are:
     * ghc-pkg dump/describe --no-expand-pkgroot
     * ghc-pkg field --expand-pkgroot
    f35a3d24