forked from mirrors/nixpkgs
ad0b6441f8
The wrapper script for ghc-pkg changes the command's default behavior such that global packages -- i.e. packages that are part of GHC itself -- are no longer found: $ ghc-pkg describe base ghc-pkg: cannot find package base This patch remedies the problem. svn path=/nixpkgs/trunk/; revision=19256
22 lines
478 B
Bash
Executable file
22 lines
478 B
Bash
Executable file
#! /bin/sh
|
|
# Usage:
|
|
# $1: version of GHC
|
|
# $2: invocation path of GHC
|
|
# $3: prefix
|
|
version="$1"
|
|
if test -z "$3"; then
|
|
prefix="-package-conf "
|
|
else
|
|
prefix="$3"
|
|
fi
|
|
PATH="$2:$PATH"
|
|
IFS=":"
|
|
for p in $PATH; do
|
|
PkgDir="$p/../lib/ghc-pkgs/ghc-$version"
|
|
for i in $PkgDir/*.installedconf; do
|
|
# output takes place here
|
|
test -f $i && echo -n " $prefix$i"
|
|
done
|
|
done
|
|
test -f "$2/../lib/ghc-$version/package.conf" && echo -n " $prefix$2/../lib/ghc-$version/package.conf"
|