2010-05-25 04:13:45 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-05-25 10:02:47 +00:00
|
|
|
# script to generate dependency graph for fedora haskell libraries
|
|
|
|
# requires ghc, ghc-*-devel and graphviz to be installed
|
|
|
|
|
2010-05-25 04:13:45 +00:00
|
|
|
set -e
|
|
|
|
|
|
|
|
mkdir -p .pkg-deps
|
|
|
|
|
|
|
|
cd .pkg-deps
|
|
|
|
|
2010-06-02 08:31:03 +00:00
|
|
|
# remove the closing line
|
|
|
|
ghc-pkg dot --global | sed '$d' > pkgs.dot
|
2010-05-25 04:13:45 +00:00
|
|
|
|
2010-06-02 08:31:03 +00:00
|
|
|
# check for binary deps too
|
2010-06-03 04:59:32 +00:00
|
|
|
for i in alex cabal-install cpphs darcs happy haskell-platform hedgewars hscolour kaya xmonad; do
|
2010-06-02 08:31:03 +00:00
|
|
|
PKG=`rpm -q --qf "%{name}-%{version}" $i` || echo $i is not installed
|
|
|
|
rpm -q --requires $i | grep ghc6 | sed -e "s/libHS/\"$PKG\" -> \"/g" -e "s/-ghc6.*/\"/" >> pkgs.dot
|
|
|
|
done
|
|
|
|
|
|
|
|
# and add it back
|
|
|
|
echo "}" >> pkgs.dot
|
2010-05-25 04:13:45 +00:00
|
|
|
|
2010-06-02 08:31:03 +00:00
|
|
|
cp -p pkgs.dot pkgs.dot.orig
|
2010-05-25 04:13:45 +00:00
|
|
|
|
|
|
|
# ignore library packages provided by ghc
|
2010-06-02 08:31:03 +00:00
|
|
|
GHC_PKGS="array base-4 base-3 bin-package-db bytestring Cabal containers directory dph extensible-exceptions filepath ffi ghc-6.12 ghc-binary ghc-prim haskell98 hpc integer-gmp old-locale old-time pretty process random rts syb template-haskell time unix utf8-string-0.3.4 Win32"
|
2010-05-25 04:13:45 +00:00
|
|
|
for i in $GHC_PKGS; do sed -i -e /$i/d pkgs.dot; done
|
|
|
|
|
|
|
|
cat pkgs.dot | tred | dot -Nfontsize=8 -Tsvg >pkgs.svg
|
2010-05-25 10:02:47 +00:00
|
|
|
|
2010-06-03 07:22:29 +00:00
|
|
|
if [ -n "$DISPLAY"]; then
|
|
|
|
xdg-open pkgs.svg
|
|
|
|
fi
|