Guard quickcheck.1 regeneration
Without this guard it will be regenerate on each run, and cabal new-build considers whole package dirty.
This commit is contained in:
parent
5516596b26
commit
d510a3ef6c
15
Setup.hs
15
Setup.hs
|
@ -14,6 +14,7 @@ import Distribution.Simple (
|
||||||
import Distribution.Simple.Setup ( SDistFlags )
|
import Distribution.Simple.Setup ( SDistFlags )
|
||||||
|
|
||||||
import System.Process ( system )
|
import System.Process ( system )
|
||||||
|
import System.Directory ( doesFileExist, getModificationTime )
|
||||||
|
|
||||||
#ifndef MIN_VERSION_cabal_doctest
|
#ifndef MIN_VERSION_cabal_doctest
|
||||||
#define MIN_VERSION_cabal_doctest(x,y,z) 0
|
#define MIN_VERSION_cabal_doctest(x,y,z) 0
|
||||||
|
@ -61,10 +62,20 @@ main = defaultMainWithHooks myHooks
|
||||||
--
|
--
|
||||||
myPreSDist :: Args -> SDistFlags -> IO HookedBuildInfo
|
myPreSDist :: Args -> SDistFlags -> IO HookedBuildInfo
|
||||||
myPreSDist _ _ = do
|
myPreSDist _ _ = do
|
||||||
|
exists <- doesFileExist "shellcheck.1"
|
||||||
|
if exists
|
||||||
|
then do
|
||||||
|
source <- getModificationTime "shellcheck.1.md"
|
||||||
|
target <- getModificationTime "shellcheck.1"
|
||||||
|
if target < source
|
||||||
|
then makeManPage
|
||||||
|
else putStrLn "shellcheck.1 is more recent than shellcheck.1.md"
|
||||||
|
else makeManPage
|
||||||
|
return emptyHookedBuildInfo
|
||||||
|
where
|
||||||
|
makeManPage = do
|
||||||
putStrLn "Building the man page (shellcheck.1) with pandoc..."
|
putStrLn "Building the man page (shellcheck.1) with pandoc..."
|
||||||
putStrLn pandoc_cmd
|
putStrLn pandoc_cmd
|
||||||
result <- system pandoc_cmd
|
result <- system pandoc_cmd
|
||||||
putStrLn $ "pandoc exited with " ++ show result
|
putStrLn $ "pandoc exited with " ++ show result
|
||||||
return emptyHookedBuildInfo
|
|
||||||
where
|
|
||||||
pandoc_cmd = "pandoc -s -t man shellcheck.1.md -o shellcheck.1"
|
pandoc_cmd = "pandoc -s -t man shellcheck.1.md -o shellcheck.1"
|
||||||
|
|
|
@ -32,6 +32,7 @@ Extra-Source-Files:
|
||||||
custom-setup
|
custom-setup
|
||||||
setup-depends:
|
setup-depends:
|
||||||
base >= 4 && <5,
|
base >= 4 && <5,
|
||||||
|
directory >= 1.2 && <1.4,
|
||||||
process >= 1.0 && <1.7,
|
process >= 1.0 && <1.7,
|
||||||
cabal-doctest >= 1.0.6 && <1.1,
|
cabal-doctest >= 1.0.6 && <1.1,
|
||||||
Cabal >= 1.10 && <2.5
|
Cabal >= 1.10 && <2.5
|
||||||
|
|
Loading…
Reference in New Issue