git.iko.soy/typeable/pandoc
on master help sign in
Setup.hs: Don't call MakeManPage.hs unless the man pages need making.
commitf879b99ad14588ef0585d580158040ae11a1a3e8 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 31 Jan 2011, 09:34 (16 years ago) parent492d5e9
1 file changed+10−1
Setup.hs+10−1
Setup.hs+10−1
@@ -9,6 +9,7 @@ import Distribution.Verbosity ( Verbosity, silent )
99import Distribution.Simple.InstallDirs (mandir, bindir, CopyDest (NoCopyDest))
1010import Distribution.Simple.Utils (copyFiles)
1111import Control.Exception ( bracket_ )
12+import Control.Monad ( unless )
1213import System.Process ( rawSystem, runCommand, waitForProcess )
1314import System.FilePath ( (</>) )
1415import System.Directory
@@ -50,11 +51,19 @@ runTestSuite args _ pkg lbi = do
5051makeManPages :: Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()
5152makeManPages _ flags _ _ = do
5253 let verbosity = fromFlag $ buildVerbosity flags
54+ ds1 <- modifiedDependencies (manDir </> "man1" </> "pandoc.1")
55+ ["README", manDir </> "man1" </> "pandoc.1.template"]
56+ ds2 <- modifiedDependencies (manDir </> "man1" </> "markdown2pdf.1")
57+ [manDir </> "man1" </> "markdown2pdf.1.md"]
58+ ds3 <- modifiedDependencies (manDir </> "man5" </> "pandoc_markdown.5")
59+ ["README", manDir </> "man5" </> "pandoc_markdown.5.template"]
5360 let cmd = "runghc -package-conf=dist/package.conf.inplace MakeManPage.hs"
5461 let cmd' = if verbosity == silent
5562 then cmd
5663 else cmd ++ " --verbose"
57− runCommand cmd' >>= waitForProcess >>= exitWith
64+ -- Don't run MakeManPage.hs unless we have to
65+ unless (null ds1 && null ds2 && null ds3) $
66+ runCommand cmd' >>= waitForProcess >>= exitWith
5867
5968manpages :: [FilePath]
6069manpages = ["man1" </> "pandoc.1"