From 9b3425d3e3a30b9e4f601ccb0026d15c43e2e028 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 23 Dec 2014 10:41:24 +0200 Subject: [PATCH] Back-fill core packages for homebrew users #68 --- Application.hs | 14 +++++++++++++- templates/stackage-home.hamlet | 6 ------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Application.hs b/Application.hs index 5482d97..56a7406 100644 --- a/Application.hs +++ b/Application.hs @@ -226,7 +226,8 @@ makeFoundation useEcho conf = do flip runLoggingT (messageLoggerSource foundation logger) $ flip (Database.Persist.runPool dbconf) p $ do runMigration migrateAll - checkMigration 1 $ fixSnapSlugs + checkMigration 1 fixSnapSlugs + checkMigration 2 setCorePackages let updateDB = lookup "STACKAGE_CABAL_LOADER" env /= Just "0" @@ -399,3 +400,14 @@ fixSnapSlugs = case ms of Nothing -> update sid [StackageSlug =. slug] Just _ -> loop (i + 1) + +setCorePackages :: MonadIO m => ReaderT SqlBackend m () +setCorePackages = + updateWhere [PackageName' <-. defaultCorePackages] [PackageCore =. True] + where + defaultCorePackages = map PackageName $ words =<< + [ "ghc hoopl bytestring unix haskeline Cabal base time xhtml" + , "haskell98 hpc filepath process array integer-gmp bin-package-db" + , "containers haskell2010 binary ghc-prim old-time old-locale rts" + , "terminfo transformers deepseq pretty template-haskell directory" + ] diff --git a/templates/stackage-home.hamlet b/templates/stackage-home.hamlet index e08f552..854e178 100644 --- a/templates/stackage-home.hamlet +++ b/templates/stackage-home.hamlet @@ -32,12 +32,6 @@ $newline never 3 cabal install -

- Note: # - Homebrew users please see # - - this page about potential issues. -

Note: # For a global installation, please use #