@@ -16,6 +16,8 @@ import qualified Data.ByteString as Bytes
1616import qualified Data.ByteString.Char8 as Bytes.Char8
1717import qualified Data.ByteString.Lazy as Bytes.Lazy
1818import qualified Data.Serialize as Serial
19+ import qualified Data.Text as T (pack )
20+ import qualified Data.Text.Encoding as TE (encodeUtf8 )
1921import qualified System.Directory as Directory
2022import System.FilePath ((</>) )
2123
@@ -65,7 +67,7 @@ streamNarIO effs basePath yield = do
6567 if isSymLink then do
6668 target <- IO. liftIO $ Nar. narReadLink effs path
6769 yield $
68- strs [" type" , " symlink" , " target" , Bytes.Char8. pack target]
70+ strs [" type" , " symlink" , " target" , filePathToBS target]
6971 else do
7072 isDir <- IO. liftIO $ Nar. narIsDir effs path
7173 if isDir then do
@@ -75,7 +77,7 @@ streamNarIO effs basePath yield = do
7577 yield $ str " entry"
7678 parens $ do
7779 let fullName = path </> f
78- yield $ strs [" name" , Bytes.Char8. pack f, " node" ]
80+ yield $ strs [" name" , filePathToBS f, " node" ]
7981 parens $ go fullName
8082 else do
8183 isExec <- IO. liftIO $ isExecutable effs path
@@ -86,6 +88,8 @@ streamNarIO effs basePath yield = do
8688 yield $ int fSize
8789 yieldFile path fSize
8890
91+ filePathToBS = TE. encodeUtf8 . T. pack
92+
8993 parens act = do
9094 yield $ str " ("
9195 r <- act
0 commit comments