Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal On branch : master
http://hackage.haskell.org/trac/ghc/changeset/df8ed61ddf18996e4c828bb86b25c62471f3adc3 >--------------------------------------------------------------- commit df8ed61ddf18996e4c828bb86b25c62471f3adc3 Author: Duncan Coutts <[email protected]> Date: Wed Oct 17 00:45:01 2007 +0000 Portability fixes to allow building with ghc-6.4 and ghc-6.6 >--------------------------------------------------------------- cabal-install/Hackage/List.hs | 11 +++++++---- cabal-install/cabal-install.cabal | 20 +++++++++++++------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/cabal-install/Hackage/List.hs b/cabal-install/Hackage/List.hs index 76eade1..5828fac 100644 --- a/cabal-install/Hackage/List.hs +++ b/cabal-install/Hackage/List.hs @@ -14,11 +14,8 @@ module Hackage.List ( list -- :: ConfigFlags -> [UnresolvedDependency] -> IO () ) where -import Text.Regex -import Data.Maybe (isJust) -import Data.List (nubBy, sortBy, groupBy, intersperse) +import Data.List (nubBy, sortBy, groupBy, intersperse, isPrefixOf, tails) import Data.Char as Char (toLower) -import Data.Ord (comparing) import Distribution.Package import Distribution.PackageDescription import Distribution.Version (showVersion) @@ -59,3 +56,9 @@ showPkgVersions pkgs = pkg = last pkgs versions = map (showVersion . pkgVersion . package) pkgs padTo n s = s ++ (replicate (n - length s) ' ') + +comparing :: (Ord a) => (b -> a) -> b -> b -> Ordering +comparing p x y = compare (p x) (p y) + +isInfixOf :: String -> String -> Bool +isInfixOf needle haystack = any (isPrefixOf needle) (tails haystack) diff --git a/cabal-install/cabal-install.cabal b/cabal-install/cabal-install.cabal index 8ac01b6..29ceb95 100644 --- a/cabal-install/cabal-install.cabal +++ b/cabal-install/cabal-install.cabal @@ -20,6 +20,8 @@ flag old-base description: Old, monolithic base default: False +flag bytestring-in-base + Executable cabal Main-Is: Main.hs Ghc-Options: -Wall @@ -38,11 +40,15 @@ Executable cabal Hackage.Update Hackage.Utils - build-depends: network, regex-compat, Cabal>=1.2, - zlib >= 0.3, HTTP >= 3000.0 && < 3000.1, filepath >= 1.0 + build-depends: Cabal >= 1.2, filepath >= 1.0, network, + zlib >= 0.3, HTTP >= 3000.0 && < 3000.1 + + if flag(old-base) + build-depends: base < 3 + else + build-depends: base >= 3, process, directory, pretty - if flag(old-base) { - build-depends: base == 2.0 || == 2.1.1 - } else { - build-depends: base >= 2.1, process, directory, pretty, bytestring >= 0.9 - } + if flag(bytestring-in-base) + build-depends: base >= 2.0 && < 2.2 + else + build-depends: base < 2.0 || >= 3.0, bytestring >= 0.9 _______________________________________________ Cvs-libraries mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-libraries
