Squeeze now follows haskell-platform-2011.4.0.0
[darcs-mirror-hpvt.git] / Main.hs
1 import Data.Maybe
2 import Data.List
3 import qualified Data.Map as M
4 import System.Time
5 import Control.Applicative ((<$>))
6
7 import Distribution.PackageDescription.Parse
8 import Distribution.PackageDescription.Configuration
9 import Distribution.Verbosity
10
11 import Hackage as H
12 import Debian as D
13
14 import HTMLOutput
15 import CabalDebianMap
16 import PlatformOutput
17 import Types
18 import Utils
19
20
21 main = do 
22         putStrLn "Haskell Package Version Tracker"
23
24         hackage <- H.readFile "00-index.tar.gz"
25         putStrLn $ "Read " ++ show (M.size hackage) ++ " packages from Hackage"
26
27         debian_unstable <- D.readFile "Sources.unstable" "sid" hackage
28         putStrLn $ "Read " ++ show (M.size debian_unstable) ++ " packages from Debian (Unstable)"
29
30         debian_squeeze <- D.readFile "Sources.squeeze" "squeeze" hackage
31         putStrLn $ "Read " ++ show (M.size debian_squeeze) ++ " packages from Debian (Squeeze)"
32
33         debian_wheezy <- D.readFile "Sources.wheezy" "wheezy" hackage
34         putStrLn $ "Read " ++ show (M.size debian_wheezy) ++ " packages from Debian (Wheezy)"
35
36         platform_2010_1_0_0 <- flattenPackageDescription <$> readPackageDescription normal "haskell-platform-2010.1.0.0.cabal"
37         platform_2011_4_0_0 <- flattenPackageDescription <$> readPackageDescription normal "haskell-platform-2011.4.0.0.cabal"
38         platform_darcs <- flattenPackageDescription <$> readPackageDescription normal "haskell-platform-darcs.cabal"
39         putStrLn $ "Read platform package descriptions"
40         
41         let combined = stopCombine $ startCombine (,,)
42                                      `mapCombine` hackage
43                                      `mapCombine` debian_unstable
44                                      `mapCombine` debian_squeeze
45         putStrLn $ "Found " ++ show (M.size combined) ++ " total packages"
46
47         time <- getClockTime
48         writeFile "output.html" $ outputHTML combined time
49         writeFile "cabalDebianMap.txt" $ outputCabalDebianMap combined
50         writeFile "platform.html" $ outputPlatform time hackage [
51                 (platform_2010_1_0_0, [
52                     ("Squeeze", debian_squeeze)
53                 ])
54                 , (platform_2011_4_0_0, [
55                     ("Wheezy", debian_wheezy)
56                 ])
57                 , (platform_darcs, [
58                     ("Unstable", debian_unstable)
59                 ])
60             ]
61
62
63