Gentoo Archives: gentoo-dev

From: "PaweĊ‚ Hajdan
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] haskell-cabal.eclass suggestions
Date: Fri, 30 Mar 2012 19:19:36
Message-Id: 4F75A00E.3060006@gentoo.org
1 Those are really just nits, but I thought I'd share what I've noticed.
2
3 > cabal-mksetup() {
4 > local setupdir
5 >
6 > if [[ -n $1 ]]; then
7 > setupdir=$1
8 > else
9 > setupdir=${S}
10 > fi
11 >
12 > rm -f "${setupdir}"/Setup.{lhs,hs}
13 >
14 > echo 'import Distribution.Simple; main = defaultMainWithHooks defaultUserHooks' \
15 > > $setupdir/Setup.hs
16 > }
17
18 I think there should be || die after echo, to catch out-of-disk-space
19 problems.
20
21 > cabal-copy() {
22 > has "${EAPI:-0}" 0 1 2 && ! use prefix && ED=${D}
23 >
24 > set -- copy --destdir="${D}" "$@"
25 > echo ./setup "$@"
26 > ./setup "$@" || die "setup copy failed"
27 >
28 > # cabal is a bit eager about creating dirs,
29 > # so remove them if they are empty
30 > rmdir "${ED}/usr/bin" 2> /dev/null
31 >
32 > # GHC 6.4 has a bug in get/setPermission and Cabal 1.1.1 has
33 > # no workaround.
34 > # set the +x permission on executables
35 > if [[ -d "${ED}/usr/bin" ]] ; then
36 > chmod +x "${ED}/usr/bin/"*
37 > fi
38 > # TODO: do we still need this?
39 > }
40
41 I think there should be || die after chmod.
42
43 > haskell-cabal_pkg_setup() {
44 > ghc-package_pkg_setup
45 > if [[ -z "${CABAL_BOOTSTRAP}" && -z "${CABAL_FROM_GHC}" ]] && ! ghc-sanecabal "${CABAL_MIN_VERSION}"; then
46 > eerror "The package dev-haskell/cabal is not correctly installed for"
47 > eerror "the currently active version of ghc ($(ghc-version)). Please"
48 > eerror "run ghc-updater or haskell-updater or re-build dev-haskell/cabal."
49 > die "cabal is not correctly installed"
50 > fi
51 > if [[ -z "${CABAL_HAS_BINARIES}" ]] && [[ -z "${CABAL_HAS_LIBRARIES}" ]]; then
52 > eerror "QA: Neither bin nor lib are in CABAL_FEATURES."
53
54 Shouldn't this be eqawarn?
55
56 > fi
57 > if [[ -n "${CABAL_UNKNOWN}" ]]; then
58 > ewarn "Unknown entry in CABAL_FEATURES: ${CABAL_UNKNOWN}"
59
60 Shouldn't this be eqawarn?
61
62 > fi
63 > if cabal-is-dummy-lib; then
64 > einfo "${P} is included in ghc-${CABAL_CORE_LIB_GHC_PV}, nothing to install."
65 > fi
66 > }

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] haskell-cabal.eclass suggestions Sergei Trofimovich <slyfox@g.o>