/[gentoo-x86]/eclass/haskell-cabal.eclass
Gentoo

Diff of /eclass/haskell-cabal.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.41 Revision 1.42
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v 1.41 2013/07/29 12:31:35 slyfox Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v 1.42 2013/11/20 09:19:19 slyfox Exp $
4 4
5# @ECLASS: haskell-cabal.eclass 5# @ECLASS: haskell-cabal.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Haskell herd <haskell@gentoo.org> 7# Haskell herd <haskell@gentoo.org>
8# @AUTHOR: 8# @AUTHOR:
636 done 636 done
637 637
638 echo "${new_c}" > "$cf" || 638 echo "${new_c}" > "$cf" ||
639 die "failed to update" 639 die "failed to update"
640} 640}
641
642# @FUNCTION: replace-hcflags
643# @USAGE: <old> <new>
644# @DESCRIPTION:
645# Replace the <old> flag with <new> in HCFLAGS. Accepts shell globs for <old>.
646# The implementation is picked from flag-o-matic.eclass:replace-flags()
647replace-hcflags() {
648 [[ $# != 2 ]] && die "Usage: replace-hcflags <old flag> <new flag>"
649
650 local f new=()
651 for f in ${HCFLAGS} ; do
652 # Note this should work with globs like -O*
653 if [[ ${f} == ${1} ]]; then
654 einfo "HCFLAGS: replacing '${f}' to '${2}'"
655 f=${2}
656 fi
657 new+=( "${f}" )
658 done
659 export HCFLAGS="${new[*]}"
660
661 return 0
662}

Legend:
Removed from v.1.41  
changed lines
  Added in v.1.42

  ViewVC Help
Powered by ViewVC 1.1.20