Skip to content

Commit

Permalink
Fix backwards-compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Lennart Spitzner committed Oct 24, 2015
1 parent 36174a5 commit 8e9c7fa
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions cabal-install/Distribution/Client/Status.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# LANGUAGE CPP #-}

-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Status
Expand Down Expand Up @@ -85,6 +87,9 @@ import System.FilePath ( splitFileName
, joinPath
, takeDirectory
)
#if __GLASGOW_HASKELL__ < 710
import Data.Functor ( (<$) )
#endif
import Control.Monad ( when
, forM
, guard
Expand All @@ -94,8 +99,10 @@ import Data.Version ( showVersion
)
import Data.Maybe ( isJust
)
import Data.List ( sortOn
, groupBy
import Data.List ( groupBy
, sortBy
)
import Data.Ord ( comparing
)
import Text.PrettyPrint ( empty
, ($$)
Expand All @@ -106,7 +113,11 @@ import Text.PrettyPrint ( empty
, ($+$)
, (<+>)
)
import Data.Monoid ( (<>) )
import Data.Monoid ( (<>)
#if __GLASGOW_HASKELL__ < 710
, mappend
#endif
)
import Data.List ( inits )
import Data.Foldable ( asum )

Expand Down Expand Up @@ -307,7 +318,9 @@ status verbosity globalFlags statusFlags = do
installedPackageIndex <- getInstalledPackages verbosity comp dbs conf
let pkgs = allPackages installedPackageIndex
pkgTuples = [ (root, disp $ sourcePackageId pkg) | pkg <- pkgs, root <- [x | Just x <- [pkgRoot pkg]]]
grouped = groupBy (\a b -> fst a == fst b) $ sortOn fst pkgTuples
grouped = groupBy (\a b -> fst a == fst b)
$ sortBy (comparing fst)
$ pkgTuples
groups = [(fst (head x), map snd x) | x <- grouped]
let packageDoc ps = if Cabal.fromFlag (statusPackages statusFlags)
|| Cabal.fromFlag (statusAll statusFlags)
Expand Down

0 comments on commit 8e9c7fa

Please sign in to comment.