git.iko.soy/typeable/pandoc
on master help sign in
Setup.hs: Only make pandoc.1 if README modified, be more verbose.
commit491eb00e403f9a796bbf1b5ae5be82b623ce579d authorJohn MacFarlane <jgm@berkeley.edu> dateSun 16 Jan 2011, 09:27 (16 years ago) parentab20da4
1 file changed+14−3
Setup.hs+14−3
Setup.hs+14−3
@@ -52,9 +52,20 @@ runTestSuite args _ pkg lbi = do
5252makeManPages :: Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()
5353makeManPages _ flags _ bi = do
5454 let pandocPath = (buildDir bi) </> "pandoc" </> "pandoc"
55− makeManPage pandocPath (fromFlag $ buildVerbosity flags) "markdown2pdf.1"
56− let testCmd = "runghc -package-conf=dist/package.conf.inplace MakeManPage.hs" -- makes pandoc.1 from README
57− runCommand testCmd >>= waitForProcess >>= exitWith
55+ let verbosity = fromFlag $ buildVerbosity flags
56+ -- make markdown2pdf.1 from markdown2pdf.1.md
57+ makeManPage pandocPath verbosity "markdown2pdf.1"
58+ -- make pandoc.1 from README
59+ let pandocpage = manDir </> "pandoc.1"
60+ modifiedDeps <- modifiedDependencies pandocpage ["README"]
61+ unless (null modifiedDeps) $ do
62+ let cmd = "runghc -package-conf=dist/package.conf.inplace MakeManPage.hs"
63+ ec <- runCommand cmd >>= waitForProcess
64+ case ec of
65+ ExitSuccess -> unless (verbosity == silent) $
66+ putStrLn $ "Created " ++ pandocpage
67+ ExitFailure n -> putStrLn ("Error creating " ++ pandocpage ++
68+ ". Exit code = " ++ show n) >> exitWith ec
5869
5970manpages :: [FilePath]
6071manpages = ["pandoc.1", "markdown2pdf.1"]