@@ -8385,7 +8385,7 @@ def PackCatFileFromSevenZipFile(infile, outfile, fmttype="auto", compression="au
83858385def PackCatFileFromInFile (infile , outfile , fmttype = "auto" , compression = "auto" , compresswholefile = True , compressionlevel = None , compressionuselist = compressionlistalt , checksumtype = ["md5" , "md5" , "md5" , "md5" , "md5" ], extradata = [], jsondata = {}, formatspecs = __file_format_dict__ , saltkey = None , verbose = False , returnfp = False ):
83868386 checkcompressfile = CheckCompressionSubType (infile , formatspecs , 0 , True )
83878387 if (IsNestedDict (formatspecs ) and checkcompressfile in formatspecs ):
8388- formatspecs = formatspecs [checkcompressfile ]
8388+ ckformatspecs = formatspecs [checkcompressfile ]
83898389 if (checkcompressfile == "tarfile" and TarFileCheck (infile )):
83908390 return PackCatFileFromTarFile (infile , outfile , fmttype , compression , compresswholefile , compressionlevel , compressionuselist , checksumtype , extradata , jsondata , formatspecs , saltkey , verbose , returnfp )
83918391 elif (checkcompressfile == "zipfile" and zipfile .is_zipfile (infile )):
@@ -8394,7 +8394,7 @@ def PackCatFileFromInFile(infile, outfile, fmttype="auto", compression="auto", c
83948394 return PackCatFileFromRarFile (infile , outfile , fmttype , compression , compresswholefile , compressionlevel , compressionuselist , checksumtype , extradata , jsondata , formatspecs , saltkey , verbose , returnfp )
83958395 elif (py7zr_support and checkcompressfile == "7zipfile" and py7zr .is_7zfile (infile )):
83968396 return PackCatFileFromSevenZipFile (infile , outfile , fmttype , compression , compresswholefile , compressionlevel , compressionuselist , checksumtype , extradata , jsondata , formatspecs , saltkey , verbose , returnfp )
8397- elif (IsSingleDict ( formatspecs ) and checkcompressfile == formatspecs ['format_magic' ]):
8397+ elif (checkcompressfile == ckformatspecs ['format_magic' ]):
83988398 return RePackCatFile (infile , outfile , fmttype , compression , compresswholefile , compressionlevel , False , 0 , 0 , checksumtype , False , extradata , jsondata , formatspecs , saltkey , verbose , returnfp )
83998399 else :
84008400 return PackCatFileFromBSDTarFile (infile , outfile , fmttype , compression , compresswholefile , compressionlevel , compressionuselist , checksumtype , extradata , jsondata , formatspecs , saltkey , verbose , returnfp )
@@ -8744,14 +8744,20 @@ def TarFileToArray(infile, seekstart=0, seekend=0, listonly=False, contentasfile
87448744 return listarrayfiles
87458745
87468746
8747- def BSDTarFileToArray (infile , seekstart = 0 , seekend = 0 , listonly = False , contentasfile = True , skipchecksum = False , formatspecs = __file_format_dict__ , seektoend = False , returnfp = False ):
8748- checkcompressfile = CheckCompressionSubType (infile , formatspecs , filestart , True )
8749- if (IsNestedDict (formatspecs ) and checkcompressfile in formatspecs ):
8750- formatspecs = formatspecs [checkcompressfile ]
8751- fp = MkTempFile ()
8752- fp = PackArchiveFileFromBSDTarFile (infile , fp , "auto" , True , None , compressionlistalt , "md5" , [], formatspecs , None , False , True )
8753- listarrayfiles = ArchiveFileToArray (fp , "auto" , 0 , seekstart , seekend , listonly , contentasfile , True , skipchecksum , formatspecs , None , seektoend , returnfp )
8754- return listarrayfiles
8747+ if (not libarchive_support ):
8748+ def BSDTarFileToArray (infile , seekstart = 0 , seekend = 0 , listonly = False , contentasfile = True , skipchecksum = False , formatspecs = __file_format_dict__ , seektoend = False , returnfp = False ):
8749+ checkcompressfile = CheckCompressionSubType (infile , formatspecs , filestart , True ):
8750+ return False
8751+
8752+ if (libarchive_support ):
8753+ def BSDTarFileToArray (infile , seekstart = 0 , seekend = 0 , listonly = False , contentasfile = True , skipchecksum = False , formatspecs = __file_format_dict__ , seektoend = False , returnfp = False ):
8754+ checkcompressfile = CheckCompressionSubType (infile , formatspecs , filestart , True ):
8755+ if (IsNestedDict (formatspecs ) and checkcompressfile in formatspecs ):
8756+ formatspecs = formatspecs [checkcompressfile ]
8757+ fp = MkTempFile ()
8758+ fp = PackArchiveFileFromBSDTarFile (infile , fp , "auto" , True , None , compressionlistalt , "md5" , [], formatspecs , None , False , True )
8759+ listarrayfiles = ArchiveFileToArray (fp , "auto" , 0 , seekstart , seekend , listonly , contentasfile , True , skipchecksum , formatspecs , None , seektoend , returnfp )
8760+ return listarrayfiles
87558761
87568762
87578763def ZipFileToArray (infile , seekstart = 0 , seekend = 0 , listonly = False , contentasfile = True , skipchecksum = False , formatspecs = __file_format_dict__ , seektoend = False , returnfp = False ):
@@ -10405,7 +10411,7 @@ def SevenZipFileListFile(infile, verbose=False, returnfp=False):
1040510411def InFileListFiles (infile , fmttype = "auto" , filestart = 0 , seekstart = 0 , seekend = 0 , skipchecksum = False , formatspecs = __file_format_multi_dict__ , saltkey = None , seektoend = False , verbose = False , newstyle = False , returnfp = False ):
1040610412 checkcompressfile = CheckCompressionSubType (infile , formatspecs , filestart , True )
1040710413 if (IsNestedDict (formatspecs ) and checkcompressfile in formatspecs ):
10408- formatspecs = formatspecs [checkcompressfile ]
10414+ ckformatspecs = formatspecs [checkcompressfile ]
1040910415 if (checkcompressfile == "tarfile" and TarFileCheck (infile )):
1041010416 return TarFileListFiles (infile , formatspecs , verbose , returnfp )
1041110417 elif (checkcompressfile == "zipfile" and zipfile .is_zipfile (infile )):
@@ -10414,8 +10420,8 @@ def InFileListFiles(infile, fmttype="auto", filestart=0, seekstart=0, seekend=0,
1041410420 return RarFileListFiles (infile , verbose , returnfp )
1041510421 elif (py7zr_support and checkcompressfile == "7zipfile" and py7zr .is_7zfile (infile )):
1041610422 return SevenZipFileListFiles (infile , verbose , returnfp )
10417- elif (checkcompressfile == formatspecs ['format_magic' ]):
10418- return CatFileListFiles (infile , fmttype , filestart , seekstart , seekend , skipchecksum , formatspecs , saltkey , seektoend , verbose , newstyle , returnfp )
10423+ elif (checkcompressfile == ckformatspecs ['format_magic' ]):
10424+ return ArchiveFileListFiles (infile , fmttype , filestart , seekstart , seekend , skipchecksum , formatspecs , saltkey , seektoend , verbose , newstyle , returnfp )
1041910425 else :
1042010426 return BSDTarFileListFiles (infile , formatspecs , verbose , returnfp )
1042110427 return False
0 commit comments