* [gentoo-dev] haskell-cabal.eclass suggestions
@ 2012-03-30 11:59 "Paweł Hajdan, Jr."
2012-03-31 9:20 ` Sergei Trofimovich
0 siblings, 1 reply; 2+ messages in thread
From: "Paweł Hajdan, Jr." @ 2012-03-30 11:59 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 2111 bytes --]
Those are really just nits, but I thought I'd share what I've noticed.
> cabal-mksetup() {
> local setupdir
>
> if [[ -n $1 ]]; then
> setupdir=$1
> else
> setupdir=${S}
> fi
>
> rm -f "${setupdir}"/Setup.{lhs,hs}
>
> echo 'import Distribution.Simple; main = defaultMainWithHooks defaultUserHooks' \
> > $setupdir/Setup.hs
> }
I think there should be || die after echo, to catch out-of-disk-space
problems.
> cabal-copy() {
> has "${EAPI:-0}" 0 1 2 && ! use prefix && ED=${D}
>
> set -- copy --destdir="${D}" "$@"
> echo ./setup "$@"
> ./setup "$@" || die "setup copy failed"
>
> # cabal is a bit eager about creating dirs,
> # so remove them if they are empty
> rmdir "${ED}/usr/bin" 2> /dev/null
>
> # GHC 6.4 has a bug in get/setPermission and Cabal 1.1.1 has
> # no workaround.
> # set the +x permission on executables
> if [[ -d "${ED}/usr/bin" ]] ; then
> chmod +x "${ED}/usr/bin/"*
> fi
> # TODO: do we still need this?
> }
I think there should be || die after chmod.
> haskell-cabal_pkg_setup() {
> ghc-package_pkg_setup
> if [[ -z "${CABAL_BOOTSTRAP}" && -z "${CABAL_FROM_GHC}" ]] && ! ghc-sanecabal "${CABAL_MIN_VERSION}"; then
> eerror "The package dev-haskell/cabal is not correctly installed for"
> eerror "the currently active version of ghc ($(ghc-version)). Please"
> eerror "run ghc-updater or haskell-updater or re-build dev-haskell/cabal."
> die "cabal is not correctly installed"
> fi
> if [[ -z "${CABAL_HAS_BINARIES}" ]] && [[ -z "${CABAL_HAS_LIBRARIES}" ]]; then
> eerror "QA: Neither bin nor lib are in CABAL_FEATURES."
Shouldn't this be eqawarn?
> fi
> if [[ -n "${CABAL_UNKNOWN}" ]]; then
> ewarn "Unknown entry in CABAL_FEATURES: ${CABAL_UNKNOWN}"
Shouldn't this be eqawarn?
> fi
> if cabal-is-dummy-lib; then
> einfo "${P} is included in ghc-${CABAL_CORE_LIB_GHC_PV}, nothing to install."
> fi
> }
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 203 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [gentoo-dev] haskell-cabal.eclass suggestions
2012-03-30 11:59 [gentoo-dev] haskell-cabal.eclass suggestions "Paweł Hajdan, Jr."
@ 2012-03-31 9:20 ` Sergei Trofimovich
0 siblings, 0 replies; 2+ messages in thread
From: Sergei Trofimovich @ 2012-03-31 9:20 UTC (permalink / raw
To: gentoo-dev; +Cc: phajdan.jr
[-- Attachment #1: Type: text/plain, Size: 1190 bytes --]
On Fri, 30 Mar 2012 13:59:10 +0200
""Paweł Hajdan, Jr."" <phajdan.jr@gentoo.org> wrote:
> > echo 'import Distribution.Simple; main = defaultMainWithHooks defaultUserHooks' \
> > > $setupdir/Setup.hs
> > }
>
> I think there should be || die after echo, to catch out-of-disk-space
> problems.
Ok :]
> > # GHC 6.4 has a bug in get/setPermission and Cabal 1.1.1 has
> > # no workaround.
> > # set the +x permission on executables
> > if [[ -d "${ED}/usr/bin" ]] ; then
> > chmod +x "${ED}/usr/bin/"*
> > fi
> > # TODO: do we still need this?
> > }
>
> I think there should be || die after chmod.
I'll remove the whole block.
> > if [[ -z "${CABAL_HAS_BINARIES}" ]] && [[ -z "${CABAL_HAS_LIBRARIES}" ]]; then
> > eerror "QA: Neither bin nor lib are in CABAL_FEATURES."
>
> Shouldn't this be eqawarn?
>
> > fi
> > if [[ -n "${CABAL_UNKNOWN}" ]]; then
> > ewarn "Unknown entry in CABAL_FEATURES: ${CABAL_UNKNOWN}"
>
> Shouldn't this be eqawarn?
'eqawarn' sounds fine here. I'll push the changes to overlay first and then to the gx86.
Thanks for sharing!
--
Sergei
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-31 9:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-30 11:59 [gentoo-dev] haskell-cabal.eclass suggestions "Paweł Hajdan, Jr."
2012-03-31 9:20 ` Sergei Trofimovich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox