From e2936f8773bf7d84d493020bfe2fab1d8d7f3819 Mon Sep 17 00:00:00 2001 From: defanor Date: Mon, 20 Nov 2017 01:55:15 +0300 Subject: Create man directory if it doesn't exist It may be missing when destdir is altered to prepare a binary release. --- Setup.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Setup.hs') diff --git a/Setup.hs b/Setup.hs index 1af2e43..e07df74 100644 --- a/Setup.hs +++ b/Setup.hs @@ -4,6 +4,7 @@ import Distribution.Simple.Utils import Distribution.PackageDescription import Distribution.Simple.Setup import System.FilePath +import System.Directory main = defaultMainWithHooks simpleUserHooks { postCopy = installManPage } @@ -12,9 +13,10 @@ installManPage :: Args -> PackageDescription -> LocalBuildInfo -> IO () -installManPage _ cf pd lbi = +installManPage _ cf pd lbi = do let dirs = absoluteInstallDirs pd lbi (fromFlag $ copyDest cf) man1 = mandir dirs "man1" fname = "pancake.1" target = man1 fname - in installOrdinaryFile (fromFlag $ copyVerbosity cf) fname target + createDirectoryIfMissing True man1 + installOrdinaryFile (fromFlag $ copyVerbosity cf) fname target -- cgit v1.2.3