diff options
author | Marco TĂșlio Gontijo e Silva <marcot@debian.org> | 2010-05-21 20:00:16 +0000 |
---|---|---|
committer | Marco TĂșlio Gontijo e Silva <marcot@debian.org> | 2010-05-21 20:00:16 +0000 |
commit | 81e0f98e34e6998668a67aec55e2b7eca6e9dea2 (patch) | |
tree | 9884e7f1b5507b5de66b2bd86a7ffe9e7f19ee5c /Dh_Haskell.sh | |
parent | e46e01b7b85a271954e8cc8e8f1ac6cc4705b741 (diff) |
Dh_Haskell.sh: ghc_pkg_field.
Diffstat (limited to 'Dh_Haskell.sh')
-rw-r--r-- | Dh_Haskell.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Dh_Haskell.sh b/Dh_Haskell.sh index 7ffc738..5243d61 100644 --- a/Dh_Haskell.sh +++ b/Dh_Haskell.sh @@ -20,6 +20,10 @@ dependency(){ echo "$package (>= $version), $package (<< $next_upstream_version)" } +ghc_pkg_field(){ + ghc-pkg6 --global field $@ | head -n1 +} + providing_package_for_ghc6(){ local package local dep @@ -27,8 +31,8 @@ providing_package_for_ghc6(){ local dirs local lib dep=`strip_hash $1` - dirs=`ghc-pkg6 field $dep library-dirs | grep -i ^library-dirs | cut -d':' -f 2` - lib=`ghc-pkg6 field $dep hs-libraries | grep -i ^hs-libraries | sed -e 's|hs-libraries: *\([^ ]*\).*|\1|' ` + dirs=`ghc_pkg_field $dep library-dirs | grep -i ^library-dirs | cut -d':' -f 2` + lib=`ghc_pkg_field $dep hs-libraries | grep -i ^hs-libraries | sed -e 's|hs-libraries: *\([^ ]*\).*|\1|' ` for dir in $dirs ; do if [ -e "${dir}/lib${lib}.a" ] ; then package=`dpkg-query -S ${dir}/lib${lib}.a | cut -d':' -f 1` || exit $? @@ -45,8 +49,8 @@ providing_package_for_ghc6_prof(){ local dirs local lib dep=`strip_hash $1` - dirs=`ghc-pkg6 field $dep library-dirs | grep -i ^library-dirs | cut -d':' -f 2` - lib=`ghc-pkg6 field $dep hs-libraries | grep -i ^hs-libraries | sed -e 's|hs-libraries: *\([^ ]*\).*|\1|' ` + dirs=`ghc_pkg_field $dep library-dirs | grep -i ^library-dirs | cut -d':' -f 2` + lib=`ghc_pkg_field $dep hs-libraries | grep -i ^hs-libraries | sed -e 's|hs-libraries: *\([^ ]*\).*|\1|' ` for dir in $dirs ; do if [ -e "${dir}/lib${lib}_p.a" ] ; then package=`dpkg-query -S ${dir}/lib${lib}_p.a | cut -d':' -f 1` || exit $? |