FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 03-30-2012, 11:59 AM
"Paweł Hajdan, Jr."
 
Default 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
> }
 
Old 03-31-2012, 09:20 AM
Sergei Trofimovich
 
Default haskell-cabal.eclass suggestions

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
 

Thread Tools




All times are GMT. The time now is 04:27 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org