diff options
author | John MacFarlane <jgm@berkeley.edu> | 2011-01-31 09:34:15 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2011-01-31 09:34:15 -0800 |
commit | f879b99ad14588ef0585d580158040ae11a1a3e8 (patch) | |
tree | 51fb89e7a12c80d8f20dec4a2008258eee379ddd /Setup.hs | |
parent | 492d5e91d589b68dc61ce2927c7519ecc48ec3db (diff) | |
download | pandoc-f879b99ad14588ef0585d580158040ae11a1a3e8.tar.gz |
Setup.hs: Don't call MakeManPage.hs unless the man pages need making.
Diffstat (limited to 'Setup.hs')
-rw-r--r-- | Setup.hs | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -9,6 +9,7 @@ import Distribution.Verbosity ( Verbosity, silent ) import Distribution.Simple.InstallDirs (mandir, bindir, CopyDest (NoCopyDest)) import Distribution.Simple.Utils (copyFiles) import Control.Exception ( bracket_ ) +import Control.Monad ( unless ) import System.Process ( rawSystem, runCommand, waitForProcess ) import System.FilePath ( (</>) ) import System.Directory @@ -50,11 +51,19 @@ runTestSuite args _ pkg lbi = do makeManPages :: Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO () makeManPages _ flags _ _ = do let verbosity = fromFlag $ buildVerbosity flags + ds1 <- modifiedDependencies (manDir </> "man1" </> "pandoc.1") + ["README", manDir </> "man1" </> "pandoc.1.template"] + ds2 <- modifiedDependencies (manDir </> "man1" </> "markdown2pdf.1") + [manDir </> "man1" </> "markdown2pdf.1.md"] + ds3 <- modifiedDependencies (manDir </> "man5" </> "pandoc_markdown.5") + ["README", manDir </> "man5" </> "pandoc_markdown.5.template"] let cmd = "runghc -package-conf=dist/package.conf.inplace MakeManPage.hs" let cmd' = if verbosity == silent then cmd else cmd ++ " --verbose" - runCommand cmd' >>= waitForProcess >>= exitWith + -- Don't run MakeManPage.hs unless we have to + unless (null ds1 && null ds2 && null ds3) $ + runCommand cmd' >>= waitForProcess >>= exitWith manpages :: [FilePath] manpages = ["man1" </> "pandoc.1" |