Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Gentoo: Dev

haskell-cabal.eclass suggestions

 

 

Gentoo dev RSS feed   Index | Next | Previous | View Threaded


phajdan.jr at gentoo

Mar 30, 2012, 4:59 AM

Post #1 of 2 (379 views)
Permalink
haskell-cabal.eclass suggestions

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
> }
Attachments: signature.asc (0.20 KB)


slyfox at gentoo

Mar 31, 2012, 2:20 AM

Post #2 of 2 (368 views)
Permalink
Re: haskell-cabal.eclass suggestions [In reply to]

On Fri, 30 Mar 2012 13:59:10 +0200
""PaweĊ‚ Hajdan, Jr."" <phajdan.jr [at] gentoo> 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
Attachments: signature.asc (0.19 KB)

Gentoo dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.