Enable experimental, fix code
[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         debian_experimental <- D.readFile "Sources.experimental" "experimental" hackage
37         putStrLn $ "Read " ++ show (M.size debian_experimental) ++ " packages from Debian (Wheezy)"
38
39         platform_2010_1_0_0 <- flattenPackageDescription <$> readPackageDescription normal "haskell-platform-2010.1.0.0.cabal"
40         platform_2012_2_0_0 <- flattenPackageDescription <$> readPackageDescription normal "haskell-platform-2012.2.0.0.cabal"
41         platform_darcs <- flattenPackageDescription <$> readPackageDescription normal "haskell-platform-darcs.cabal"
42         putStrLn $ "Read platform package descriptions"
43         
44         let combined = stopCombine $ startCombine (,,)
45                                      `mapCombine` hackage
46                                      `mapCombine` debian_unstable
47                                      `mapCombine` debian_squeeze
48         putStrLn $ "Found " ++ show (M.size combined) ++ " total packages"
49
50         time <- getClockTime
51         writeFile "output.html" $ outputHTML combined time
52         writeFile "cabalDebianMap.txt" $ outputCabalDebianMap combined
53         writeFile "platform.html" $ outputPlatform time hackage [
54                 (platform_2010_1_0_0, [
55                     ("Squeeze", debian_squeeze)
56                 ])
57                 , (platform_2012_2_0_0, [
58                     ("Wheezy", debian_wheezy)
59                 ])
60                 , (platform_darcs, [
61                     ("Unstable", debian_unstable),
62                     ("Experimental", debian_experimental)
63                 ])
64             ]
65
66
67