Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

guess-ghc-version: Add a executable to run with .cabal files to guess…

… its minimum ghc version
  • Loading branch information...
commit 4d29207af55b86175e4eddc7e278e6e315cbaab7 1 parent 9974fce
Lennart Kolmodin authored June 13, 2010

Showing 1 changed file with 28 additions and 0 deletions. Show diff stats Hide diff stats

  1. 28  Main-GuessGHC.hs
28  Main-GuessGHC.hs
... ...
@@ -0,0 +1,28 @@
  1
+module Main where
  2
+
  3
+import System.Environment
  4
+
  5
+import Distribution.PackageDescription
  6
+import Distribution.PackageDescription.Parse
  7
+
  8
+import Distribution.Text
  9
+import Distribution.Verbosity
  10
+
  11
+import Portage.GHCCore
  12
+
  13
+main :: IO ()
  14
+main = do
  15
+  args <- getArgs
  16
+  gpds <- mapM (readPackageDescription silent) args
  17
+  mapM_ guess gpds
  18
+
  19
+guess :: GenericPackageDescription -> IO ()
  20
+guess gpd = do
  21
+  --gpd <- readPackageDescription verbose fp
  22
+  let pkg = package . packageDescription $ gpd
  23
+  let mghc = minimumGHCVersionToBuildPackage gpd
  24
+  putStr (display pkg)
  25
+  putStr "\t\t"
  26
+  putStrLn $ case mghc of
  27
+              Nothing -> "Unknown"
  28
+              Just v -> display v

0 notes on commit 4d29207

Please sign in to comment.
Something went wrong with that request. Please try again.