From 40d0b5f2ef274080b0c2398c96442818d4e2b891 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 16 Sep 2025 14:32:04 -0400 Subject: [PATCH] fix bug in recent commit --- Build/Mans.hs | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Build/Mans.hs b/Build/Mans.hs index 3eec54c6df..e4693a0fab 100644 --- a/Build/Mans.hs +++ b/Build/Mans.hs @@ -1,6 +1,6 @@ {- Build man pages. - - - Copyright 2016 Joey Hess + - Copyright 2016-2025 Joey Hess - - Licensed under the GNU AGPL version 3 or higher. -} @@ -9,11 +9,12 @@ module Build.Mans where +import Utility.Process import System.Directory import System.FilePath import Data.List import Control.Monad -import Utility.SafeCommand +import System.Exit import Data.Maybe import Utility.Exception import Control.Applicative @@ -36,16 +37,18 @@ buildMans = do destm <- catchMaybeIO $ getModificationTime dest if (Just srcm > destm) then do - -- Run with perl because in some - -- cases it may not be executable. - r <- boolSystem "perl" $ - [ Param "./Build/mdwn2man" - , Param $ progName src - , Param "1" - , Param src - , Param $ "> " ++ dest + (Nothing, Nothing, Nothing, pid) <- createProcess $ shell $ unwords $ + -- Run with perl because in some + -- cases it may not be executable. + [ "perl" + , "./Build/mdwn2man" + , progName src + , "1" + , src + , "> " ++ dest ] - if r == True + r <- waitForProcess pid + if r == ExitSuccess then return (Just dest) else return Nothing else return (Just dest) -- 2.30.2