gitit 0.10.1.1 → 0.10.1.2
raw patch · 3 files changed
+24/−23 lines, 3 filesdep ~SHAPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: SHA
API changes (from Hackage documentation)
Files
- CHANGES +5/−0
- gitit.cabal +2/−2
- gitit.hs +17/−21
CHANGES view
@@ -1,3 +1,8 @@+Version 0.10.1.2 released 11 Jan 2013++* Fixed regression in option parsing. An earlier patch+ caused the '-f' option not to work. Closes #336.+ Version 0.10.1.1 released 01 Jan 2013 * Allow compilation with directory < 1.2.
gitit.cabal view
@@ -1,5 +1,5 @@ name: gitit-version: 0.10.1.1+version: 0.10.1.2 Cabal-version: >= 1.6 build-type: Simple synopsis: Wiki using happstack, git or darcs, and pandoc.@@ -148,7 +148,7 @@ random, network >= 2.1.0.0 && < 2.5, utf8-string >= 0.3 && < 0.4,- SHA > 1 && < 1.6,+ SHA > 1 && < 1.7, HTTP >= 4000.0 && < 4000.3, HStringTemplate >= 0.6 && < 0.7, old-locale >= 1,
gitit.hs view
@@ -58,8 +58,12 @@ readFileUTF8 >>= B.putStrLn . fromString >> exitWith ExitSuccess Right xs -> return xs - defaultConfig <- getDefaultConfig- conf <- foldM handleFlag defaultConfig opts+ conf' <- case [f | ConfigFile f <- opts] of+ (x:_) -> getConfigFromFile x+ [] -> getDefaultConfig++ let conf = foldl handleFlag conf' opts+ -- check for external programs that are needed let repoProg = case repositoryType conf of Mercurial -> "hg"@@ -79,28 +83,26 @@ saveGlobalLogger $ setLevel level $ setHandlers [logFileHandler] serverLogger saveGlobalLogger $ setLevel level $ setHandlers [logFileHandler] gititLogger - let conf' = conf{logLevel = level}- -- setup the page repository, template, and static files, if they don't exist- createRepoIfMissing conf'- createStaticIfMissing conf'- createTemplateIfMissing conf'+ createRepoIfMissing conf+ createStaticIfMissing conf+ createTemplateIfMissing conf -- initialize state- initializeGititState conf'+ initializeGititState conf - let serverConf = nullConf { validator = Nothing, port = portNumber conf',+ let serverConf = nullConf { validator = Nothing, port = portNumber conf, timeout = 20, logAccess = Nothing } -- open the requested interface sock <- socket AF_INET Stream defaultProtocol setSocketOption sock ReuseAddr 1 device <- inet_addr (getListenOrDefault opts)- bindSocket sock (SockAddrInet (toEnum (portNumber conf')) device)+ bindSocket sock (SockAddrInet (toEnum (portNumber conf)) device) listen sock 10 -- start the server- simpleHTTPWithSocket sock serverConf $ msum [ wiki conf'+ simpleHTTPWithSocket sock serverConf $ msum [ wiki conf , dir "_reloadTemplates" reloadTemplates ] @@ -155,10 +157,7 @@ usageMessage :: IO String usageMessage = do progname <- getProgName- confLoc <- getDataFileName "data/default.conf" return $ usageInfo ("Usage: " ++ progname ++ " [opts...]") flags- ++ "\nDefault configuration file path:\n " ++ confLoc- ++ "\nSet the `gitit_datadir' environment variable to change this." copyrightMessage :: String copyrightMessage = "\nCopyright (C) 2008 John MacFarlane\n" ++@@ -173,13 +172,10 @@ " -plugins" #endif -handleFlag :: Config -> ConfigOpt -> IO Config-handleFlag conf opt =- case opt of- Debug -> return conf{ debugMode = True }- Port p -> return conf{ portNumber = p }- ConfigFile fname -> getConfigFromFile fname- Listen _ -> return conf+handleFlag :: Config -> ConfigOpt -> Config+handleFlag conf Debug = conf{ debugMode = True, logLevel = DEBUG }+handleFlag conf (Port p) = conf { portNumber = p }+handleFlag conf _ = conf putErr :: ExitCode -> String -> IO a putErr c s = B.hPutStrLn stderr (fromString s) >> exitWith c