Skip to content

Commit b77a26e

Browse files
committed
Merge remote-tracking branch 'origin/master' into release
2 parents d97359b + 0932411 commit b77a26e

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

booster/tools/rpc-client/RpcClient.hs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ parseMode =
483483
maybeReader $ \s -> case split (== '=') s of [k, v] -> Just (k, v); _ -> Nothing
484484

485485
----------------------------------------
486-
-- Running all requests contained in the `rpc_*` directory of a tarball
486+
-- Running all requests contained in the subdirectories of the tarball
487487

488488
runTarball ::
489489
CommonOptions ->
@@ -542,27 +542,25 @@ runTarball common (Just sock) tarFile keepGoing runOnly compareDetails = do
542542
throwAnyError :: Either Tar.FormatError Tar.FileNameError -> IO a
543543
throwAnyError = either throwIO throwIO
544544

545-
-- unpack all rpc_*/*.json files into dir and return their names
545+
-- unpack all */*.json files into dir and return their names
546546
unpackIfRpc :: FilePath -> Tar.Entry -> IO [FilePath] -> IO [FilePath]
547547
unpackIfRpc tmpDir entry acc = do
548548
case splitFileName (Tar.entryPath entry) of
549-
-- unpack all directories "rpc_<something>" containing "*.json" files
549+
-- unpack all directories "<something>" containing "*.json" files
550550
(dir, "") -- directory
551-
| Tar.Directory <- Tar.entryContent entry
552-
, "rpc_" `isPrefixOf` dir -> do
553-
createDirectoryIfMissing False dir -- create rpc dir so we can unpack files there
551+
| Tar.Directory <- Tar.entryContent entry -> do
552+
createDirectoryIfMissing True dir -- create rpc dir so we can unpack files there
554553
acc -- no additional file to return
555554
| otherwise ->
556555
acc -- skip other directories and top-level files
557556
(dir, file)
558-
| "rpc_" `isPrefixOf` dir
559-
, ".json" `isSuffixOf` file
557+
| ".json" `isSuffixOf` file
560558
, not ("." `isPrefixOf` file)
561559
, Tar.NormalFile bs _size <- Tar.entryContent entry -> do
562560
-- unpack json files into tmp directory
563561
let newPath = dir </> file
564562
-- current tarballs do not have dir entries, create dir here
565-
createDirectoryIfMissing False $ tmpDir </> dir
563+
createDirectoryIfMissing True $ tmpDir </> dir
566564
BS.writeFile (tmpDir </> newPath) bs
567565
(newPath :) <$> acc
568566
| otherwise ->

0 commit comments

Comments
 (0)