windows and osx build fixes for recent ByteString conversion work

This commit is contained in:
Joey Hess 2025-01-24 11:37:17 -04:00
parent f0c206cea6
commit f0b9b46cb2
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 8 additions and 6 deletions

View file

@ -189,6 +189,6 @@ winLockFile pid pidfile = do
prefix = pidfile ++ "." prefix = pidfile ++ "."
suffix = ".lck" suffix = ".lck"
cleanstale = mapM_ (void . tryIO . removeFile) =<< cleanstale = mapM_ (void . tryIO . removeFile) =<<
(filter iswinlockfile <$> dirContents (fromRawFilePath (parentDir (toRawFilePath pidfile)))) (filter iswinlockfile . map fromRawFilePath <$> dirContents (parentDir (toRawFilePath pidfile)))
iswinlockfile f = suffix `isSuffixOf` f && prefix `isPrefixOf` f iswinlockfile f = suffix `isSuffixOf` f && prefix `isPrefixOf` f
#endif #endif

View file

@ -70,7 +70,8 @@ watchDir dir ignored scanevents hooks = do
scan d = unless (ignoredPath ignored d) $ scan d = unless (ignoredPath ignored d) $
-- Do not follow symlinks when scanning. -- Do not follow symlinks when scanning.
-- This mirrors the inotify startup scan behavior. -- This mirrors the inotify startup scan behavior.
mapM_ go =<< emptyWhenDoesNotExist (dirContentsRecursiveSkipping (const False) False d) mapM_ (go . fromRawFilePath) =<< emptyWhenDoesNotExist
(dirContentsRecursiveSkipping (const False) False (toRawFilePath d))
where where
go f go f
| ignoredPath ignored f = noop | ignoredPath ignored f = noop

View file

@ -43,7 +43,8 @@ watchDir dir ignored scanevents hooks = do
runhook h s = maybe noop (\a -> a (filePath evt) s) (h hooks) runhook h s = maybe noop (\a -> a (filePath evt) s) (h hooks)
scan d = unless (ignoredPath ignored d) $ scan d = unless (ignoredPath ignored d) $
mapM_ go =<< emptyWhenDoesNotExist (dirContentsRecursiveSkipping (const False) False d) mapM_ (go . fromRawFilePath) =<< emptyWhenDoesNotExist
(dirContentsRecursiveSkipping (const False) False (toRawFilePath d))
where where
go f go f
| ignoredPath ignored f = noop | ignoredPath ignored f = noop

View file

@ -179,10 +179,10 @@ feedRead cmd params passphrase feeder reader = do
go (passphrasefd ++ params) go (passphrasefd ++ params)
#else #else
-- store the passphrase in a temp file for gpg -- store the passphrase in a temp file for gpg
withTmpFile "gpg" $ \tmpfile h -> do withTmpFile (toOsPath "gpg") $ \tmpfile h -> do
liftIO $ B.hPutStr h passphrase liftIO $ B.hPutStr h passphrase
liftIO $ hClose h liftIO $ hClose h
let passphrasefile = [Param "--passphrase-file", File tmpfile] let passphrasefile = [Param "--passphrase-file", File (fromosPath tmpfile)]
go $ passphrasefile ++ params go $ passphrasefile ++ params
#endif #endif
where where

View file

@ -163,7 +163,7 @@ feedRead cmd subcmd params password emptydirectory feeder reader = do
withTmpFile (toOsPath "sop") $ \tmpfile h -> do withTmpFile (toOsPath "sop") $ \tmpfile h -> do
liftIO $ B.hPutStr h password liftIO $ B.hPutStr h password
liftIO $ hClose h liftIO $ hClose h
let passwordfile = [Param $ "--with-password="++tmpfile] let passwordfile = [Param $ "--with-password=" ++ fromOsPath tmpfile]
-- Don't need to pass emptydirectory since @FD is not used, -- Don't need to pass emptydirectory since @FD is not used,
-- and so tmpfile also does not need to be made absolute. -- and so tmpfile also does not need to be made absolute.
case emptydirectory of case emptydirectory of