nixpkgs/pkgs/development/compilers/ghc/ghc-get-packages.sh
Marc Weber eccd5d5a41 ghc-get-packages.sh no array at all: roughly 20% faster
svn path=/nixpkgs/trunk/; revision=16399
2009-07-16 15:18:21 +00:00

21 lines
375 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