@@ -15,7 +15,7 @@ module RpcClient (
15
15
) where
16
16
17
17
import Codec.Archive.Tar qualified as Tar
18
- import Codec.Archive.Tar.Check qualified as Tar
18
+ import Codec.Archive.Tar.Entry qualified as Tar
19
19
import Codec.Compression.BZip qualified as BZ2
20
20
import Codec.Compression.GZip qualified as GZip
21
21
import Control.Exception
@@ -505,20 +505,24 @@ runTarball common (Just sock) tarFile keepGoing runOnly compareDetails = do
505
505
| " .tar.bz2" `isSuffixOf` takeExtensions tarFile = Tar. read . BZ2. decompress
506
506
| otherwise = Tar. read
507
507
508
- containedFiles <- unpackTar <$> BS. readFile tarFile
509
- let checked = Tar. checkSecurity containedFiles
508
+ entries <- Tar. decodeLongNames . unpackTar <$> BS. readFile tarFile
510
509
-- probe server connection before doing anything, display
511
510
-- instructions unless server was found.
512
- runAllRequests checked sock
511
+ runAllRequests entries sock
513
512
where
514
513
runAllRequests ::
515
- Tar. Entries (Either Tar. FormatError Tar. FileNameError ) -> Socket -> IO ()
514
+ Tar. GenEntries
515
+ FilePath
516
+ a
517
+ (Either Tar. FormatError Tar. DecodeLongNamesError ) ->
518
+ Socket ->
519
+ IO ()
516
520
runAllRequests checked skt = cancelIfInterrupted skt $ do
517
521
withTempDir $ \ tmp -> withLogLevel common. logLevel $ do
518
522
-- unpack relevant tar files (rpc_* directories only)
519
523
logInfo_ $ unwords [" unpacking json files from tarball" , tarFile, " into" , tmp]
520
524
(jsonFiles, sequenceMap) <-
521
- liftIO $ Tar. foldEntries (unpackIfRpc tmp) (pure mempty ) throwAnyError checked
525
+ liftIO $ Tar. foldEntries (unpackIfRpc tmp) (pure mempty ) ( error . show ) checked
522
526
logInfo_ $ " RPC data:" <> show jsonFiles
523
527
logInfo_ $ " Sequence data:" <> show sequenceMap
524
528
@@ -543,10 +547,6 @@ runTarball common (Just sock) tarFile keepGoing runOnly compareDetails = do
543
547
liftIO $ shutdown skt ShutdownReceive
544
548
liftIO $ exitWith (if all isNothing results then ExitSuccess else ExitFailure 2 )
545
549
546
- -- complain on any errors in the tarball
547
- throwAnyError :: Either Tar. FormatError Tar. FileNameError -> IO a
548
- throwAnyError = either throwIO throwIO
549
-
550
550
compareSequence :: Ord a => Ord b => Map. Map a b -> a -> a -> Ordering
551
551
compareSequence seqMap a b = case (Map. lookup a seqMap, Map. lookup b seqMap) of
552
552
(Nothing , Nothing ) -> compare a b
@@ -557,11 +557,11 @@ runTarball common (Just sock) tarFile keepGoing runOnly compareDetails = do
557
557
-- unpack all */*.json files into dir and return their names
558
558
unpackIfRpc ::
559
559
FilePath ->
560
- Tar. Entry ->
560
+ Tar. GenEntry FilePath a ->
561
561
IO ([FilePath ], Map. Map FilePath Int ) ->
562
562
IO ([FilePath ], Map. Map FilePath Int )
563
563
unpackIfRpc tmpDir entry acc = do
564
- case splitFileName (Tar. entryPath entry) of
564
+ case splitFileName (Tar. entryTarPath entry) of
565
565
-- unpack all directories "<something>" containing "*.json" files
566
566
(dir, " " ) -- directory
567
567
| Tar. Directory <- Tar. entryContent entry -> do
0 commit comments