Qf֧  dZdZdZddlmZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZ ddlZ ddlZeeefZgdZdZdZed zZd Zd Zd Zd Zd ZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1e1Z2e e!e"e#e&e'e(e$e%e)e*e+f Z3e e!e(e+fZ4e)e*e+fZ5dZ6hdZ7e8e8e8e9e9e9d Z:ejvd!k(rd"Zd$Z?d%Z@d&e2fd'ZAd(ZBdedfd)ZCd*ZDGd+d,eEZFGd-d.eFZGGd/d0eFZHGd1d2eFZIGd3d4eFZJGd5d6eFZKGd7d8eKZLGd9d:eKZMGd;deKZOGd?d@eKZPGdAdBZQGdCdDZRGdEdFeSZTGdGdHeSZUGdIdJejZWGdKdLeFZXGdMdNeXZYGdOdPeXZZGdQdReXZ[GdSdTeXZ\GdUdVeXZ]dddWZ^dXZ_dYZ`dZZae_e`ead[ZbeSZcejd\ZeGd]d^eSZfGd_d`eSZgdaZhegjZdbZiejdck(reiyy#e$rdZYwxYw#e$rdZYwxYw)ez0.9.0u"Lars Gustäbel (lars@gustaebel.de)u4Gustavo Niemeyer, Niels Gustäbel, Richard Townsend.)openN)TarFileTarInfo is_tarfileTarError ReadErrorCompressionError StreamError ExtractError HeaderErrorENCODING USTAR_FORMAT GNU_FORMAT PAX_FORMATDEFAULT_FORMATrfully_trusted_filter data_filter tar_filter FilterErrorAbsoluteLinkErrorOutsideDestinationErrorSpecialFileErrorAbsolutePathErrorLinkOutsideDestinationErrorisustar sustar00d01234567LKSxgX)pathlinkpathsizemtimeuidgidunamegname>r/r6r5r0)atimectimer2r3r4r1ntutf-8cx | td|j||}|d||t|z tzzS)Nzmetadata cannot contain None) ValueErrorencodelenNUL)slengthencodingerrorss ./opt/alt/python312/lib64/python3.12/tarfile.pystnrEsFy788 6"A Wf:#a&C/ //c^ |jd}|dk7r|d|}|j||S)Nr)finddecode)r@rBrCps rDntsrLs7 u ABw bqE 88Hf %%rFc8 |ddvrMd}tt|dz D]}|dz}|||dzz }|ddk(rdt|dz z|z }|S t|dd}t|j xsd d}|S#t $r t d wxYw) Nr)r-rOasciistrict0invalid header)ranger>rLintstripr<InvalidHeaderError)r@nis rDntir\s t~ s1vz"A !GA 1q5MA# Q45=#a&1*%)*A H  7Aw)AAGGI$a(A H 7$%56 6 7s +BBrPc |}t|}d|cxkr d|dz zkr nntd|dz |fzdtz}|S|tk(rzd|dz z |cxkr d|dz zkrbn td |dk\r t dg}nt dg}d|z|z}t |dz D]}|j d|dz|dz}|Std ) NrrPr-z%0*orRrQrNrOzoverflow in number field)rWbytesr?r bytearrayrVinsertr<)rZdigitsformat original_nr@r[s rDitnrdsJ AAA!fqj!! &FQJ?*G 4s : H : 36A:#6"6!"Qcfqj>Q"Q344 65'"A5'"Av !Avz"A HHQE " !GA# H344rFc dttjd|z}dttjd|z}||fS)NrQ 148B8x356B 148b8x356b)sumstruct unpack_from)bufunsigned_chksum signed_chksums rD calc_chksumsrnsLC 2 2< EFFO#f00sCDDM M ))rFcz |xsd}|dk(ry|tj|||yt||\}}t|D]:}|j |}t ||kr|d|j |<|dk7r8|j |}t ||kr|d|j |y)Ni@runexpected end of data)shutil copyfileobjdivmodrVreadr>write) srcdstrA exceptionbufsizeblocks remainderbrks rDrrrrs"G { ~3W-vw/FI 6]hhw s8g 45 5 #  A~hhy! s8i 45 5 # rFcttjdd}|!|j|dj |}t |dy)NrBbackslashreplace )end)getattrsysstdoutr=rJprint)r@rBs rD _safe_printrs@szz:t4H HHX1 2 9 9( C !rFceZdZ y)rN__name__ __module__ __qualname__rFrDrrsrFrceZdZ y)r NrrrFrDr r s/rFr ceZdZ y)rNrrrFrDrrs0rFrceZdZ y)r NrrrFrDr r s8rFr ceZdZ y)r NrrrFrDr r sGrFr ceZdZ y)r NrrrFrDr r s+rFr ceZdZ y)EmptyHeaderErrorNrrrFrDrr s&rFrceZdZ y)TruncatedHeaderErrorNrrrFrDrr#s*rFrceZdZ y)EOFHeaderErrorNrrrFrDrr&s,rFrceZdZ y)rYNrrrFrDrYrY)s(rFrYceZdZ y)SubsequentHeaderErrorNrrrFrDrr,s=rFrc&eZdZ dZdZdZdZy) _LowLevelFilectjtjtjztjzd|}t tdr|tj z}tj||d|_y)NrwO_BINARYi) osO_RDONLYO_WRONLYO_CREATO_TRUNChasattrrrfd)selfnamemodes rD__init__z_LowLevelFile.__init__9sarzz)BJJ6   2z " BKK D''$e,rFcBtj|jyN)rcloserrs rDrz_LowLevelFile.closeBs rFcBtj|j|Sr)rrtrrr1s rDrtz_LowLevelFile.readEswwtww%%rFcDtj|j|yr)rrurrr@s rDruz_LowLevelFile.writeHs !rFN)rrrrrrtrurrFrDrr3s -&rFrcXeZdZ dZdZdZdZdZdZdZ dZ dd Z d Z d Z d Zy )_Streamc d|_|t||}d|_|dk(rt|}|j}|xsd|_||_||_||_||_d|_ d|_ d|_ |dk(r[ ddl }||_ |jd|_|d k(r"|j"|_|j'y|j)|y|d k(rI ddl}|d k(r(d|_|j/|_t2|_y|j5||_y|d k(rN ddl} |d k(r.d|_| j9|_| j:|_y| j=|_y|dk7rtd|zy#t$r tddwxYw#t$r td dwxYw#t$r td dwxYw#|js|jj?d|_ xYw)NTF*rFrgzzzlib module is not availablerbz2bz2 module is not availablexzlzma module is not availabletarunknown compression type %r) _extfileobjr _StreamProxy getcomptyperrcomptypefileobjryrkposclosedzlib ImportErrorr crc32crcerrorrx _init_read_gz_init_write_gzrdbufBZ2DecompressorcmpOSError BZ2CompressorlzmaLZMADecompressor LZMAErrorLZMACompressorr) rrrrrry compresslevelrrrs rDrz_Stream.__init__Ws   ?#D$/G$D  s?#7+G**,H        - 4U! ::c?3;%)ZZDN&&('' 6U"T3; #DI"224DH%,DN"00?DHT!U3; #DI#446DH%)^^DN#224DHU"&'Dx'OPP#E#U*+IJPTTU#T*+HItST#U*+IJPTTU ## ""$DK sy;GFAG GG!F)%,GG)G/G32G&G<GF&&G)F??GGG0H cXt|dr|js|jyyy)Nr)rrrrs rD__del__z_Stream.__del__s# 4 "4;; JJL,7 "rFcv |jj||jj|jj |jjd|_t jdttj}|jd|zdz|jjdr|jdd|_ tjj|j|_ |j|jj!ddt"zy) NrDErFc, |jdk(r+|jj||j|_|xjt |z c_|jdk7r|j j|}|j|y)Nrr) rrrrrr>rcompressrrs rDruz _Stream.writesj ==D yyq$((3DH CF ==E !!!!$A QrFc\ |xj|z c_t|j|jkDrt|jj |jd|j|j|jd|_t|j|jkDrsyyr)rkr>ryrrurs rD__writez_Stream.__writesw  A $((mdll* LL  txx 6 7xx .DH$((mdll*rFc |jryd|_ |jdk(r<|jdk7r-|xj|jj z c_|jdk(r|jr|j j|jd|_|jdk(ru|j jtjd|j|j jtjd|jdz|js|j jyy#|js|j jwwxYw)NTrrrFrrl)rrrrkrflushrrurirrrrrrs rDrz _Stream.closes  ;;   %yyCDMMU$:DHHNN,,yyCDHH ""488,==D(LL&&v{{4'BCLL&&v{{4J9N'OP## ""$$4## ""$$s DE)E>c |jj|jj |_d|_|j ddk7r t d|j ddk7r tdt|j d}|j d|d zrIt|j dd t|j dzz}|j||d zr |j d}|r |tk(rn|d zr |j d}|r |tk(rn|dzr|j dyy) NrFr.snot a gzip filer-zunsupported compression methodrQrP) r decompressobjrrr _Stream__readrr ordrtr?)rflagxlenr@s rDrz_Stream._init_read_gzs. 99**DII,?,?+?@  ;;q>[ (-. . ;;q>W $"#CD D4;;q>" A !8t{{1~&s4;;q>/B)BBD IIdO !8KKNAH "9KKNAH !8 KKN rFc |jSr)rrs rDtellz _Stream.tells xxrFc ||jz dk\rnt||jz |j\}}t|D]}|j |j|j ||jSt d)Nrz seeking backwards is not allowed)rrsryrVrtr )rrrzr{r[s rDseekz _Stream.seeksy  >Q  &sTXX~t|| D FI6] $,,'# IIi xx@A ArFcf |j|}|xjt|z c_|Sr)_readrr>)rr1rks rDrtz _Stream.read s*Cjj CH rFc* |jdk(r|j|St|j}|jg}||kr|jr|j}d|_n(|j j |j}|snA |jj|}|j||t|z }||krdj|}||d|_|d|S#|j$r}td|d}~wwxYw)NrrFzinvalid compressed data)rrr>rrkrrtryr decompressrxrappendjoin)rr1ctrkes rDrz _Stream._reads ==E !;;t$ $  N YYK$hxxhhll'' 5 Bhh))#. HHSM SMA$h HHQKdeH $x >> B 9:A BsC22D D  Dc, t|j}|jg}||krM|jj|j}|sn%|j ||t|z }||krMdj |}||d|_|d|S)NrF)r>rkrrtryrr)rr1rrrks rD__readz_Stream.__read/s  M XXJ$h,,##DLL1C HHSM SMA $h HHQKTU8$xrFN)r)rrrrrrrurrrrrrtrrrrFrDrrKsF ENF"/%,> 6rFrc&eZdZ dZdZdZdZy)rcZ||_|jjt|_yr)rrt BLOCKSIZErk)rrs rDrz_StreamProxy.__init__Es <<$$Y/rFcP|jj|_|jSr)rrtrkrs rDrtz_StreamProxy.readIsLL%% xxrFc|jjdry|jdddk(r|jdddk(ry |jjd ry y ) NsrrsBZhr s1AY&SYr)s]s7zXZrr)rk startswithrs rDrz_StreamProxy.getcomptypeMsV 88   / XXa]f $!B9)D XX !C DrFc8|jjyr)rrrs rDrz_StreamProxy.closeWs rFN)rrrrrtrrrrFrDrr@s0rFrcfeZdZ d dZdZdZdZdZdZe jfdZ d d Z d Z d Zy) _FileInFileNc||_||_||_d|_||_d|_|d|fg}d|_g|_d}|j}|D]U\}}||kDr|jjd||df|jjd|||z|f||z }||z}W||jkr*|jjd||jdfyy)NrFT) roffsetr1positionrr map_indexmapr)rrrr1r blockinfolastposrealposs rDrz_FileInFile.__init__ds       T I++%LFD >? HHOOT66D='B C tOGtmG & TYY  HHOOUGTYY= > rFcyrrrs rDrz_FileInFile.flush}s rFcyNTrrs rDreadablez_FileInFile.readablesrFcyNFrrs rDwritablez_FileInFile.writablesrFc6|jjSr)rseekablers rDr$z_FileInFile.seekables||$$&&rFc |jSr)rrs rDrz_FileInFile.tells }}rFc0 |tjk(r1tt|d|j|_|j S|tj k(rc|dkr*t|j |zd|_|j St|j |z|j|_|j S|tjk(r>tt|j|z|jd|_|j Std)NrzInvalid argument) ioSEEK_SETminmaxr1rSEEK_CURSEEK_ENDr<)rrwhences rDrz_FileInFile.seeks R[[ Ha 0$))rrrtrr?) rr1rkdatastartstoprrAr|s rDrtz_FileInFile.readsG <99t}},DtTYY67DQh,0HHT^^,D)eT6DMM0D0NNa'N~~TXX6)*tdmm34F !!&DMME,A"BCLL%%f-q6V##$<==qsV|# FND MMV #M'Qh( rFch|jt|}||dt|t|Sr)rtr>)rr|rks rDreadintoz_FileInFile.readintos,iiA)3s8 3xrFcd|_yr)rrs rDrz_FileInFile.closes  rFr)rrrrrrr"r$rr'r(rrtr3rrrFrDrr^sB ?2 ' %'KK > rFrceZdZfdZxZS) ExFileObjectct|j|j|j|j|j }t ||yr)rr offset_datar1rsparsesuperr)rtarfiletarinfor __class__s rDrzExFileObject.__init__s;goow/B/B gllGNN< !rFrrrr __classcell__r=s@rDr6r6s ""rFr6c eZdZy)rNrrrFrDrrsrFrceZdZfdZxZS)rcN||_t| d|jdy)Nzmember z has an absolute pathr<r:rrrr<r=s rDrzAbsolutePathError.__init__s&  77<<"22GHIrFr>r@s@rDrrsJJrFrceZdZfdZxZS)rcf||_||_t| |jd|ddzy)Nz would be extracted to , which is outside the destinationr<_pathr:rrrr<r/r=s rDrz OutsideDestinationError.__init__s;   GLL++B4("M=> ?rFr>r@s@rDrr ??rFrceZdZfdZxZS)rcL||_t| |jdy)Nz is a special filerDrEs rDrzSpecialFileError.__init__s$  GLL++=>?rFr>r@s@rDrrs@@rFrceZdZfdZxZS)rcL||_t| |jdy)Nz is a link to an absolute pathrDrEs rDrzAbsoluteLinkError.__init__s$  GLL++IJKrFr>r@s@rDrrsLLrFrceZdZfdZxZS)rcf||_||_t| |jd|ddzy)Nz would link to rHrIrJrLs rDrz$LinkOutsideDestinationError.__init__s:   GLL+?4("E=> ?rFr>r@s@rDrrrMrFrci}|j}tjj|}|j dtj fr1|jj dtj zx}|d<tjj|r t|tjjtjj||}tjj||g|k7r t|||j}|y|dz}|r^|js|jr|dzs|dz}|dz}n.|js|j!rd}n t#|||jk7r||d<|rk|j$d|d<|j&d|d <|j(d|d <|j*d|d <|js|j!rtjj|j,r t/||j!rItjj|tjj1||j,}n*tjj||j,}tjj|}tjj||g|k7r t3|||S) N/ri@irr3r4r5r6)rrr/realpathrseplstripisabsrr commonpathrrisregislnkisdirissymrr3r4r5r6linknamerdirnamer)member dest_pathfor_data new_attrsr target_pathrs rD_get_filtered_attrsrhs^I ;;D  +I RVV}%#);;#5#5cBFFl#CCy  ww}}T ''''""277<< 4#@AK ww; 23y@%fk:: ;;D e| ||~e|FND 6<<>'v.. 6;;  $If  :: !#Ie  :: !#Ie  << #!%Ig  << #!%Ig  <<>V\\^ww}}V__-'//||~ ggll9+-77??4+@+1??< !ggll9+1??< ''**;7Kww!!; ":;yH1&+FF rFc|Srr)rcrds rDrr2s MrFcPt||d}|r|jdi|ddiS|S)NFdeeprrhrrcrdrfs rDrr5s1#FIu=Iv~~6 666 MrFcPt||d}|r|jdi|ddiS|S)NTrkFrrlrms rDrr;s1#FItZd?Zd@Z dAZ!dBZ"dCZ#dDZ$dEZ%dFZ&dGZ'dHZ(dIZ)dJZ*dKZ+dLZ,dMZ-dNZ.dOZ/dPZ0dQZ1dRZ2y$)UrrzName of the archive member.rzPermission bits.r3z6User ID of the user who originally stored this member.r4z7Group ID of the user who originally stored this member.r1zSize in bytes.r2zTime of last modification.chksumzHeader checksum.typezFile type. type is usually one of these constants: REGTYPE, AREGTYPE, LNKTYPE, SYMTYPE, DIRTYPE, FIFOTYPE, CONTTYPE, CHRTYPE, BLKTYPE, GNUTYPE_SPARSE.razcName of the target file name, which is only present in TarInfo objects of type LNKTYPE and SYMTYPE.r5z User name.r6z Group name.devmajorzDevice major number.devminorzDevice minor number.rzThe tar header starts here.r8zThe file's data starts here. pax_headerszMA dictionary containing key-value pairs of an associated pax extended header.r9zSparse member information.r;N_sparse_structs _link_targetc ||_d|_d|_d|_d|_d|_d|_t|_d|_ d|_ d|_ d|_ d|_ d|_d|_d|_i|_y)Nirr)rrr3r4r1r2rqREGTYPErrrar5r6rsrtrr8r9rurrs rDrzTarInfo.__init__ts              rFc |jSrrrs rDr/z TarInfo.paths2yyrFc||_yrr|rzs rDr/z TarInfo.paths  rFc |jSrrars rDr0zTarInfo.linkpaths:}}rFc||_yrr)rras rDr0zTarInfo.linkpaths   rFc`d|jj|jt|fzS)Nz<%s %r at %#x>)r=rridrs rD__repr__zTarInfo.__repr__s&4>>#:#:499RX"NNNrFT) rr2rrar3r4r5r6rk_KEEPc  | rtj|} ntj|} || ur|| _|| ur|| _|| ur|| _|| ur|| _|| ur|| _|| ur|| _|| ur|| _|| ur|| _ | Sr) copydeepcopyrr2rrar3r4r5r6) rrr2rrar3r4r5r6rkrresults rDrzTarInfo.replaces ]]4(FYYt_F u FK   FL u FK 5 &FO e FJ e FJ   FL   FL rFc |jd}n|jdz}|j||j|j|j|j |j |j|j|j|j|j|jd }|dtk(r!|djds |dxxdz cc<|S)N) rrr3r4r1r2rqrrrar5r6rsrtrrrrU)rrr3r4r1r2rqrrrar5r6rsrtDIRTYPEr)rrinfos rDget_infozTarInfo.get_infos 99 D99v%D            <7 "4<+@+@+E LC L rFsurrogateescapec0 |j}|jD]\}}| td|z|tk(r|j |||S|t k(r|j |||S|tk(r|j||Std)Nz%s may not be Nonezinvalid format) ritemsr<rcreate_ustar_headerrcreate_gnu_headerrcreate_pax_header)rrbrBrCrrvalues rDtobufz TarInfo.tobufs }}::r= LENGTH_LINKr< LENGTH_NAME_posix_split_name_create_headerr)rrrBrCs rDrzTarInfo.create_ustar_headers #W tJ&&x8 9K G34 4 tF|""8V4 5 C+/+A+A$v,PXZ`+a (DNDL""4xHHrFc\ t|d<d}t|dj||tkDr||j |dt ||z }t|dj||t kDr||j |dt||z }||j|t||zS)NrrFrar) GNU_MAGICr>r=r_create_gnu_long_headerGNUTYPE_LONGLINKrGNUTYPE_LONGNAMErr)rrrBrCrks rDrzTarInfo.create_gnu_headers !W  tJ&&x8 9K G 4//Z0@BRT\^de eC tF|""8V4 5 C 4//V >NPXZ`a aCT((z8VLLLrFc^ t|d<|jj}ddtfddtfddfD];\}}}||vr ||j dd t|||kDs4||||<=d D]e\}}d }||} t| t} | r t| n| } d | cxkr d |dz zks nd ||<d}n | r| ||<d}|sS||vsXt| ||<g|r|j|t|} nd} | |j|tddzS#t $r ||||<YwxYw)Nrrr/rar0)r5r5 )r6r6rrRrS))r3rP)r4rP)r1 )r2rFrrPr-TrFr)rrurrrr=UnicodeEncodeErrorr> isinstancefloatroundstr_create_pax_generic_headerXHDTYPErr) rrrBrurhnamerAra needs_paxval val_is_floatval_intrks rDrzTarInfo.create_pax_headers $W &&++- - J /T&(>$@ D% # T !!'84 4:'%)$Z E"!$@(RLD&It*C%c51L$0eCjcG3! "33T  %T  T4$'H D!%R* 11+wQCCT((|WiPPPG& %)$Z E" sDD,+D,c2 |j|tdS)Nr:)rXGLTYPE)clsrus rDcreate_pax_global_headerz TarInfo.create_pax_global_header?s --k7GLLrFcT |jd}tdt|D]t}dj|d|}dj||d}t|j ||t ksNt|j ||t ksq||fStd)NrUr-zname is too long)splitrVr>rr= LENGTH_PREFIXrr<)rrrBrC componentsr[rs rDrzTarInfo._posix_split_nameEs ZZ_ q#j/*AXXj!n-F88JqrN+D6==623}D Hf56+Et|+/0 0rFcj |jdttfv}|r;t|jddd|}t|jddd|}nt dd||}t dd||}|jdt }| t dt |jddd ||t|jd dd zd|t|jd dd|t|jd dd|t|jddd|t|jddd|d|t |jddd |||jdtt |jddd||t |jddd||||t |jddd||g}tjdtzdj|} t| t dd} | ddtd| zdz| ddz} | S)NrrrsrrPrtrzTarInfo.type must not be Nonerrrrr3r4r1rr2s rarr5rr6rrz%dsrFiz%06orRi)getCHRTYPEBLKTYPErdrEryr<rrirr rrnr^) rrbrBrChas_device_fieldsrsrtfiletypepartsrkrqs rDrzTarInfo._create_headerUs !HHV,'0BB 488J2Av>H488J2Av>H2q(F3H2q(F3H88FG,  <= = $c8V < #f,a 8 "Av . "Av . #R 0 !$b& 1   R(#x @ HHWk * "%r8V < "%r8V <   2&Xv > $kk%)+SXXe_=c9*+./2%4j5F!2G<r r?)payloadrzr{s rD_create_payloadzTarInfo._create_payloads> #3w<; q=  I-4 4GrFc |j||tz}i}d|d<||d<t||d<t|d<|j |t |||j |zS)Nz ././@LongLinkrrrr1r)r=r?r>rrrr)rrrrrBrCrs rDrzTarInfo._create_gnu_long_headersy {{8V,s2&V V 4yV !W !!$ hG##D)* *rFc d}|jD]\}} |jddd}|r|dz }|jD]\}}|jd}|r|j|d}n|jd}t|t|zdz}d x} } |tt | z} | | k(rn| } |t t | d d z|zd z|zd zz }i} d| d<|| d<t|| d<t | d<|j| td d|j|zS#t$rd}YwxYw)NFr:rSTrFs21 hdrcharset=BINARY rrrrR = z././@PaxHeaderrrrr1rr) rr=rr>rr^rrrr) rrurrrBbinarykeywordrrecordslrZrKrs rDrz"TarInfo._create_pax_generic_headers )//1NGU  Wh/2  0 0G)//1NGUnnW-G X/@A W-G s5z)A-AIACF O6  uSVW-4w>EMPUU UG!2('V V 7|V #W !!$ gyI##G,- -I&  sD:: E  E cn t|dk(r tdt|tk7r td|j t tk(r t dt|dd}|t|vr td|}t|dd|||_ t|dd |_ t|d d |_ t|d d |_t|d d |_t|d d|_||_|dd |_t|d d|||_t|dd|||_t|dd|||_t|dd|_t|dd|_t|dd||}|j$t0k(r&|jj3dr t4|_|j$t6k(rxd}g}t9dD]@} t|||dz} t||dz|dz} |j=| | f|dz }Bt?|d} t|dd} || | f|_ |jCr |jjEd|_ |r)|j$tFvr|dz|jz|_ |S#t:$rYwxYw)Nrz empty headerztruncated headerzend of file headerz bad checksumrlt|ii i)iIiQiYirUirriii)$r>rr rcountr?rr\rnrYrLrrr3r4r1r2rqrrrar5r6rsrtAREGTYPErrGNUTYPE_SPARSErVr<rboolrvr_rstrip GNU_TYPES)rrkrBrCrqobjrrstructsr[rnumbytes isextendedorigsizes rDfrombufzTarInfo.frombufs s8q=">2 2 s8y &'9: : 99S>Y & !56 6SS\" c* *$^4 4es1Sz8V4s3s|$c#cl#c#cl#s3s|$C %  s3<3s3<6: C h7 C h7 3s3<( 3s3<( SS\8V4 88x CHH$5$5c$:CH 88~ %CG1X Sr!23F"3sRxb#9:H12r c#hJ3s3<(H#*J"AC  99;xxs+CH chhi/|chh.CH "s%%J'' J43J4c |jjt}|j||j|j }|jj tz |_|j|Sr) rrtr rrBrCrr _proc_member)rr;rkrs rD fromtarfilezTarInfo.fromtarfile sc oo""9-kk#w//@__))+i7 ((rFc |jttfvr|j|S|jtk(r|j |S|jt ttfvr|j|S|j|Sr) rrrr _proc_gnulongr _proc_sparserrSOLARIS_XHDTYPE _proc_pax _proc_builtin)rr;s rDrzTarInfo._proc_member!s}  99)+;< <%%g. . YY. ($$W- - YY7G_= =>>'* *%%g. .rFc |jj|_|j}|js|jt vr||j |jz }||_|j|j|j|j|jr |jjd|_|SNrU)rrr8r]rrSUPPORTED_TYPES_blockr1r_apply_pax_inforurBrCr_rr)rr;rs rDrzTarInfo._proc_builtin.s #??//1!! ::<499O; dkk$)), ,F W00'2B2BGNNS ::< ((-DI rFcH |jj|j|j} |j |}|j|_|jtk(r't||j|j|_n9|jtk(r&t||j|j|_|j#r |jj%d|_|S#t $r}t t|dd}~wwxYwr)rrtrr1rr rrrrrrrLrBrCrrrar_ removesuffix)rr;rknextrs rDrzTarInfo._proc_gnulongDs oo""4;;tyy#9: :##G,D kk 99( (C!1!17>>BDI YY* *W%5%5w~~FDM ::< ..s3DI ! :'A/T 9 :sC>> D!DD!c  |j\}}}|`|r|jjt}d}t dD]D} t |||dz}t ||dz|dz} |r| r|j|| f|dz }Ft|d}|r||_ |jj|_ |j|j|jz|_||_ |S#t $rYywxYw)Nrrri)rvrrtr rVr\r<rrr9rr8rr1r) rr;rrrrkrr[rrs rDrzTarInfo._proc_sparse_s )-(<(<%X  //&&y1CC2Y Sr!23F"3sRxb#9:HhNNFH#56r c#hJ "??//1))DKK ,BB  "s%C66 DDc |jj|j|j}|jt k(r |j }n|j j}d}d}g}t||kDr||dk7rtj||x}s td t|jd}|dkr td||zt|kDr td|jd|zdz } ||j!ddz| } | j#d\} } } | r | dk7s|| dk7r td|j%|| | f| dk(r|| dk(r |j&}nd }||z }t||kDr ||dk7r|d }|D]x\}} } |j)| d d |j*}|t,vr)|j)| ||j&|j*}n|j)| d d |j*}|||<z |j/|}d |vr|j7||nRd |vr|j9||n;|j;d d k(r'|j;ddk(r|j=||||jt>t@fvr|jC||j&|j*|jD|_"d|vrS|jF}|jIs|jtJvr||j|jz }||_"|S#t$r tdwxYw#t0$r}t3t5|dd}~wwxYw)NrrUr-rrs hdrcharsetsBINARYr:GNU.sparse.mapGNU.sparse.sizezGNU.sparse.major1zGNU.sparse.minorrTr1)&rrtrr1rrrrurr>_header_length_prefix_rematchrYrWgroupr<r0r partitionrrB_decode_pax_fieldrCPAX_NAME_FIELDSrr rr_proc_gnusparse_01_proc_gnusparse_00r_proc_gnusparse_10rrrrr8r]r)rr;rkrurrB raw_headersrrAheader_value_end_offsetkeyword_and_value raw_keywordequals raw_valuerrrrrs rDrzTarInfo._proc_pax{s oo""4;;tyy#9: 99 !--K!--224K  #hnST!15;;CEEEE()9:: ;U[[^, z()9::V|c#h&()9::&+kk!nv&=&A # #EIIaL1$45L M ->-H-H-N *K&D.C8O4PTX4X()9::    Y? @m+0@ )&//H&H 6MCM#hnST!1R  H/: *FK,,['7NN$G/)..y(GDTDT(..y'7($)K #/:( :##G,D { *  # #D+ 6 + -  # #D+ 6 __/ 0C 7KOOL^<_cf.> O++DK$))::<499O#Cdkk$))44F!' y ;()9:: ;| :'A/T 9 :s$2M#MM N'M<<Nct g}g}|D]d\}}}|dk(r* |jt|j6|dk(s< |jt|jft t |||_y#t$r t dwxYw#t$r t dwxYw)NsGNU.sparse.offsetrUsGNU.sparse.numbytes)rrWrJr<rYlistzipr9)rrroffsetsr_rrs rDrzTarInfo._proc_gnusparse_00s !, Aw..?NN3u||~#6722?OOC $78"-3w12 "?,-=>>? "?,-=>>?s(B (B" B"B7c  |djdDcgc] }t|}}tt|ddd|ddd|_ycc}w)Nr,r.r-)rrWr r r9)rrruxr9s rDrzTarInfo._proc_gnusparse_01s] "-.>"?"E"Ec"JK"JQ#a&"JK3vcc{F14a4L9: LsAc  d}g}|jjt}|jdd\}}t |}t ||dzkrgd|vr"||jjtz }|jdd\}}|j t |t ||dzkrg|jj|_tt|ddd|ddd|_ y)Nrr-r.) rrtr rrWr>rrr8r r r9)rrrur;fieldsr9rknumbers rDrzTarInfo._proc_gnusparse_10s oo""9-iiq) V&kFQJ&Cw++I66))E1-KFC MM#f+ & &kFQJ& #??//13vcc{F14a4L9: rFc |jD]\}}|dk(rt|d||dk(rt|dt|5|dk(rt|dt|Q|tvsZ|tvr t ||}|dk(r|j d}t||||j|_y#t $rd}YHwxYw)NzGNU.sparse.namer/rr1zGNU.sparse.realsizerrU) rsetattrrW PAX_FIELDSPAX_NUMBER_FIELDSr<rrru)rrurBrCrrs rDrzTarInfo._apply_pax_infos *//1NGU++fe,--fc%j111fc%j1J&//" 1' :5 Af$!LL-Egu-2"'++- &" !"s5B>> C  C cl |j|dS#t$r|j||cYSwxYw)NrS)rJUnicodeDecodeError)rrrBfallback_encodingfallback_errorss rDrzTarInfo._decode_pax_field5sA  D<<(3 3! D<< 1?C C Ds 33cJ t|t\}}|r|dz }|tzS)Nr-)rsr )rrrzr{s rDrzTarInfo._block=s1 #5)4  aKF !!rFc( |jtvSr)rr REGULAR_TYPESrs rDr]z TarInfo.isregFs>yyM))rFc$ |jSr)r]rs rDisfilezTarInfo.isfileJs>zz|rFc* |jtk(Sr)rrrrs rDr_z TarInfo.isdirN+yyG##rFc* |jtk(Sr)rrSYMTYPErs rDr`z TarInfo.issymRs/yyG##rFc* |jtk(Sr)rrLNKTYPErs rDr^z TarInfo.islnkVr"rFc* |jtk(Sr)rrrrs rDischrz TarInfo.ischrZs2yyG##rFc* |jtk(Sr)rrrrs rDisblkz TarInfo.isblk^s.yyG##rFc* |jtk(Sr)rrFIFOTYPErs rDisfifozTarInfo.isfifobs&yyH$$rFc|jduSr)r9rs rDissparsezTarInfo.issparsefs{{$&&rFc> |jtttfvSr)rrrrr,rs rDisdevz TarInfo.isdevisMyyWgx888rFr)r)3rrrdict __slots__rpropertyr/setterr0rrrrrr rrrr classmethodrr staticmethodrrrrrrrrrrrrrrrrrr]r r_r`r^r(r*r-r/r1rrFrDrrQs , ! G H    -  $ > F   * *! "/# $5% &9' *.+ ,- ./ 01 I60 [[__!!O%eeuE88*HEV/" I M8QtMM  ''R** 0-0-d<<|))( /,68wr3(; ; ..D"*$$$$$%'9rFrceZdZ dZdZdZdZeZe Z dZ e Z eZdZ d7dZedddefdZed8dZed9d Zed9d Zed:d Zd d dddZdZdZdZdZd;dZddZ!dZ"d?ddddZ#d@ddddZ$dZ%d Z&d!Z'd"Z(d#Z) dAd$Z*d%Z+d&Z,d'Z-d(Z.d)Z/d*Z0d+Z1d,Z2d-Z3d.Z4dBd/Z5d0Z6d>d1Z7d2Z8d3Z9d4Z:d5Z;d6ZrFrrTrr>rr)-r<r_moderr/exists bltn_openrrrrrr^abspathrrbr< dereference ignore_zerosrBrCrrudebug errorlevel copybufsizermembers_loadedrrinodes firstmemberrrrrrr rrrrur>r)rrrrrbr<rErFrBrCrurGrHrImodesrrks rDrzTarFile.__init__s T= u @A A 4[ yyCt(< ! djj1G$D  &!97<<#u6||w'$\\ #D -1BGGOOD)t     DK  "DL  "*D   # ,D   $DM  "t{{j'@*D !D   DJ  !(DO'   ll'')   yyC#' #'99; yyCLL%%dkk2:"&,,":":4"@ ++G4 yyO+# ##,,??@P@P@U@U@WXCLL&&s+KK3s8+K$, * ))$++6&:'A/T9: ## ""$DK s>?A L< 6K'BL<'.L9L<L9L44L99L<<0M,c  |s |s td|dvrzfd}g}tj|D]:}tj|} ||j } | |d|fi|cSdj|} t d | d |vrb|jd d \} }| xsd} |xsd }|jvrtj|} nt d |z| || |fi|Sd|vrg|jdd \} }| xsd} |xsd }| dvr td|jdd}t|| ||||} || |fi|}d|_|S|dvrj|||fi|Std#t t f$r5} |jd|d| ||j Yd} ~ d} ~ wwxYw#|jxYw)Nznothing to open)rr:*c(j|dk(S)Ntaropen) OPEN_METH)rrs rDnot_compressedz$TarFile.open..not_compressed#s}}X.);;rF)keyrz - method z:  z'file could not be opened successfully: :r-rr|rzmode must be 'r' or 'w'r Fr@zundiscernible mode)r<sortedrSrrrr rrrrpoprrrrR)rrrrrykwargsrT error_msgsrfunc saved_posrerror_msgs_summaryfilemoderstreamrs` rDrz TarFile.opens:! FG./ / <  <J"3==nEsCMM($;<& ' Ic7=f== F"&:!6 FGYFZ[\ \ D[!%C!3 Hh3H(5H3==(sCMM($;<&'Dx'OPPh:6: : D[!%C!3 Hh3H(5Hz) !:;;"JJ:MT8Xw*,F h9&9"AMH _ $3;;tT7=f= =-..W"#34%% (2aU&CD* Y/ D  s$# F G G *GG  Gc 8 |dvr td||||fi|S)Nr=r?)r<)rrrrr\s rDrRzTarFile.taropenYs0 + +@A A4w1&11rFc  |dvr td ddlm} |||dz||} |j|||fi|}d |_ |S#t$r t ddwxYw#t $r}||dk(r t d|d}~wwxYw#t $r'}|j|dk(r t d|d}~w|jxYw) Nrrrmode must be 'r', 'w' or 'x'r)GzipFilezgzip module is not availabler|rrF) r<gziprgrr rrrRrr) rrrrrr\rgrrs rDgzopenzTarFile.gzopenas   &;< < M % tTCZHG  D$:6:A + M"#AB L M  "ts{ 129    MMOs{ 129   MMO s9AABA B(A<<B C "B//Cc R |dvr td ddlm}||xs|||} |j |||fi|}d |_ |S#t$r t ddwxYw#t tf$r'}|j|dk(r td|d}~w|jxYw) Nrerfr)BZ2Filer)rrznot a bzip2 fileF) r<rrkrr rRrEOFErrorrrr) rrrrrr\rkrrs rDbz2openzTarFile.bz2opens   &;< < L #'/T4}M  D$:6:A ! L"#@At K L"  MMOs{ 23:   MMO s"AAAB&."BB&c N |dvr td ddlm}m}||xs|||} |j |||fi|}d |_ |S#t$r t ddwxYw#|tf$r'} |j|dk(r td| d} ~ w|jxYw) Nrerfr)LZMAFilerr)presetrznot an lzma fileF) r<rrorrr rRrlrrr) rrrrrpr\rorrrs rDxzopenzTarFile.xzopens   &;< < M 07?dD@  D$:6:A ! M"#AB L M8$  MMOs{ 23:   MMO s"AA!A! B$,"BB$rRrirmrq)rrrrc |jryd|_ |jdvr|jjtt dzz|xj t dzz c_t|j t\}}|dkDr)|jjtt|z z|js|jjyy#|js|jjwwxYw)NTr@r.r) rrrrur?r rrs RECORDSIZErr)rrzr{s rDrz TarFile.closes  ;;   %yyO+ ""3)a-#89 A . %+4;; $C! q=LL&&sj9.D'EF## ""$$4## ""$$s BC)Dch |j|jd}|td|z|S)NrUzfilename %r not found) _getmemberrKeyError)rrr<s rD getmemberzTarFile.getmembers; //$++c"23 ?2T9: :rFct |j|js|j|jSr)_checkrK_loadrJrs rD getmemberszTarFile.getmemberss,  || JJL||rFc^ |jDcgc]}|jc}Scc}wr)r{r)rr<s rDgetnameszTarFile.getnamess. -1OO,=>,= ,=>>>s*c0 |jd| |j}||}tjj |\}}|j tj d}|jd}|j}||_ |8|jstj|}n9tj|}n#tj|j}d}|j}tj |r|j"|j$f} |jsE|j&dkDr6| |j(vr(||j(| k7rt*} |j(| }nt,} | dr||j(| <ntj.|rt0} ntj2|rt4} njtj6|rt8} tj:|}n9tj<|rt>} ntj@|rtB} ny||_||_"|jF|_$|jJ|_&| t,k(r|jN|_(nd|_(|jR|_*| |_+||_,tZr( t[j\|jHd|_/tbr( tcjd|jLd|_3| t>tBfvrhtitdrXtitdrHtjj|jl|_7tjp|jl|_9|S#t`$rYwxYw#t`$rYwxYw)NawxrUrr-rmajorminor):ryrrr/ splitdriverrYrZr<r;rElstatstatfstatfilenost_modeS_ISREGst_inost_devst_nlinkrLr&ryS_ISDIRrS_ISFIFOr,S_ISLNKr$readlinkS_ISCHRrS_ISBLKrrst_uidr3st_gidr4st_sizer1st_mtimer2rrrapwdgetpwuidr5rvgrpgetgrgidr6rrst_rdevrsrrt) rrarcnamerdrvr<statresrastmdinoderrs rD gettarinfozTarFile.gettarinfos  E  < zlink to )ryrrrrar5r3r6r4r(r*rsrtr1r2r localtimerr_r`rar^r)rverboserJr<s rDr z TarFile.listXsk ?GG<<' - gll ;<w}}'C 'C'.}}'C 'CEF==?gmmo$(8(8':J:J'KK!MN  56==( 56 ="&.."?"C!DE  w}}BG H==?(8(8 89==? W-=-= => G5rFfiltercd |jd||}|jBtjj ||jk(r|j dd|zy|j d||j ||}||j dd|zy| ||}||j dd|zy|jr(t|d5}|j||dddy|jr|j||ruttj|D]S}|jtjj||tjj||||Uyy|j|y#1swYyxYw) Nrr.ztarfile: Skipped %rr-ztarfile: Unsupported type %rtarfile: Excluded %rr:r)ryrrr/rD_dbgrr]rCaddfiler_rZlistdiraddr)rrr recursiverr<fs rDrz TarFile.add~sv  E ?G 99 RWW__T%:dii%G IIa.5 6  !T//$0 ? IIa7$> ?   WoG !3d:; ==?4&! Wa('&]]_ LL ! 4 01AHHRWW\\$2BGGLL!4L%f62 LL !'&s F&&F/c |jdtj|}|j|j|j|j }|j j||xjt|z c_|j}|t||j |j|t|jt\}}|dkDr.|j jtt|z z|dz }|xj|tzz c_|j j#|y)Nr)ryrr-)ryrrrbrBrCrrurr>rIrrr1rsr r?rJr)rr<rrkryrzr{s rDrzTarFile.addfiles E))G$mmDKK D 3 s3x      w||W M &w||Y ? FI1} ""3)i*?#@A!  KK6I- -K G$rFc|M|j}|"tjdtdtSt |t r td|St|r|S t|S#t$rtd|ddwxYw)NzPython 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior.r) stacklevelzrString names are not supported for TarFile.extraction_filter. Use a function such as tarfile.data_filter directly.zfilter z not found) extraction_filterwarningswarnDeprecationWarningrrr TypeErrorcallable_NAMED_FILTERSrvr<)rrs rD_get_filter_functionzTarFile._get_filter_functions >++F~ J'1 6 ,+&#&677M F M G!&) ) Gwvj ;<$ F Gs A''B) numeric_ownerrcB g}|j|}||}|D]]}|j|||}||jr|j||j |||j |_|j dd|D]e}t jj||j} |j|| ||j|| |j|| gy#t$r} |j| Yd} ~ d} ~ wwxYw)N set_attrsrc|jSrr|)r>s rDz$TarFile.extractall.. sqvvrFT)rUreverse)r)r_get_extract_tarinfor_r _extract_onesortrr/rrchownutimechmodr _handle_nonfatal_error) rr/rJrr directoriesfilter_functionrcr<dirpathrs rD extractallzTarFile.extractalls  33F; ?GF//NG}}""7+   gt7==?7J,9  ; -t<#Gggll46G / 7G= I 7G, 7G, #   /++A.. /s?8C:: DDDc| |j|}|j|||}||j||||yyr)rrr)rrcr/rrrrr<s rDextractzTarFile.extract sL 33F;++FOTJ     gtY F rFc t|tr|j|}n|}|} |||}| |jdd|jzy|jrDtj|}tjj||j|_|S#ttf$r}|j |Yd}~d}~wt $r}|j|Yd}~d}~wwxYw)Nr.r)rrrwrr_handle_fatal_errorr rrrr^rrr/rrarw)rrcrr/r< unfilteredrs rDrzTarFile._get_extract_tarinfo! sN fc "nnV,GG  +%gt4G ? IIa/*//A B ==?ii(G#%77<<g6F6F#GG % (  $ $Q ' ' +  ' ' * * +s# B**C69C C6C11C6c6 |jd |j|tjj ||j ||y#t $r}|j|Yd}~yd}~wt$r}|j|Yd}~yd}~wwxYw)Nrr) ry_extract_memberrr/rrrrr r)rr<r/rrrs rDrzTarFile._extract_one8 s3 C +  "'',,tW\\*J+4/< ! > (  $ $Q ' ' +  ' ' * * +s#=A BA11 B=BBcP |jdkDr|jdd|zy)Nr- tarfile: %s)rHrrrs rDrzTarFile._handle_nonfatal_errorE s'K ??Q   IIa* +rFcN |jdkDrt|trY|j |j dd|j zy|j dd|j d|jy|j ddt |jd|y)Nrr-rz tarfile: r)rHrrfilenamerstrerrorrrrrs rDrzTarFile._handle_fatal_errorL sw? ??Q   7 #zz! !]QZZ78 !QZZHI IIaT!W-=-=qA BrFc |jdt|tr|j|}n|}|j s|j t vr|j||S|js|jrEt|jtr td|j|j|Sy)Nrz'cannot extract (sym)link as file object)ryrrrwr]rrr fileobjectr^r`rrr extractfile_find_link_target)rrcr<s rDrzTarFile.extractfileX s C fc "nnV,GG ==?gll/A??41 1 ]]_ $,,0""KLL''(>(>w(GHHrFc |jd}|jdtj}tjj |}|r4tjj |stj||js|jr,|jd|jd|jn|jd|j|jr|j||n|jr|j!||n|j#r|j%||n|j's|j)r|j+||nj|js|jr|j-||n7|j.t0vr|j3||n|j|||rI|j5||||js%|j7|||j9||yyy)NrUr-z -> )rrrrYr/rbrBmakedirsr^r`rrrar]makefiler_makedirr-makefifor(r*makedevmakelinkrrr makeunknownrrr)rr< targetpathrr upperdirss rDrzTarFile._extract_memberx s  &&s+ ''RVV4 GGOOJ/ RWW^^I6 KK " ==?gmmo IIaw||W5E5EF G IIa & ==? MM': . ]]_ LL* - ^^  MM': . ]]_  LL* - ]]_  MM': . \\ 0   Wj 1 MM': .  JJw M :==? 7J/ 7J/# rFc |jtj|ytj|dy#t$r#tjj |sYywxYw)Ni)rrmkdirFileExistsErrorr/r_rr<rs rDrzTarFile.makedir sY  ||#$U+ 77==,- s!<<)A('A(c  |j}|j|j|j}t |d5}|j d|j D])\}}|j|t |||t|+|j|j|jnt |||jt|dddy#1swYyxYw)Nr;) rrr8rIrCr9rrrr1truncate)rr<rsourcerytargetrr1s rDrzTarFile.makefile s  G''("" z4 (F~~)$+NNLFDKK'iI%3 GLL)!FFGLL)WM) ( (s BCC!ch |j|||jdd|jzy)Nr-z9tarfile: Unknown file type %r, extracted as regular file.)rrrrrs rDrzTarFile.makeunknown s8  gz* !24;LLA BrFcf ttdrtj|ytd)Nmkfifozfifo not supported by system)rrrr rs rDrzTarFile.makefifo s) 2x IIj !=> >rFch ttdrttds td|j}|d}|j r|t j z}n|t jz}tj||tj|j|jy)Nmknodrz'special devices not supported by systemrW) rrr rr*rS_IFBLKS_IFCHRrrrsrt)rr<rrs rDrzTarFile.makedev s r7#72y+AHI I|| <D ==? DLL D DLL D TG,,g.>.>? ArFc< |jrUtjj|rtj|tj |j |ytjj|jr!tj|j|y|j|j||y#t$r> |j|j||Yy#t$r tddwxYwwxYw)Nz%unable to resolve link inside archive)r`rr/lexistsunlinksymlinkrarBrwlinkrrsymlink_exceptionrvr rs rDrzTarFile.makelink s  V}}77??:.IIj) 7++Z877>>'"6"67GGG00*=(()?)?)H)35  V V$$T%;%;G%D%/1 V"#JKQUU V  Vs+A$C(A C2!C D!DDDc ttdrtjdk(r|j}|j}|sj t r.|j r"t j|j d} tr.|jr"tj|jd}|d}|d} |jr(ttdrtj|||ytj|||yyy#t$rYwxYw#t$rYuwxYw#t$r}t!d|d}~wwxYw)Ngeteuidrr.rHlchownzcould not change owner)rrrr4r3rr6getgrnamrvrr5getpwnamr`rrrr )rr<rrgurs rDrz TarFile.chown s 2y !bjjla&7 A A w}}LL7:w}}LL7:yy D==?wr8'<IIj!Q/HHZA./'8 !    D"#; ?s 1 A  AA c |j}|yttdsy tj|||fy#t$r}t d|d}~wwxYw)Nrz"could not change modification time)r2rrrrr )rr<rr2rs rDrz TarFile.utime. s]   = r7#  L HHZ% 0 LCD! K Ls< A AAcN |jd|j|j}d|_|S|j|jj k7r^|jdk(ry|jj |jdz |jj ds tdd} |jj|} ||j0j3||Sd|_|S#t$rU}|jr?|jdd|j|fz|xjtz c_Yd}~Yd}~d}~wt$rz}|jr?|jdd|j|fz|xjtz c_Yd}~|jdk(rtt|dYd}~d}~wt $r|jdk(r tddY-t"$r/}|jdk(rtt|dYd}~_d}~wt$$r}tt|dd}~wt&$r@} ddl}t+||j,rtd |d|#t.$r|wxYwd}~wwxYw) Nrarr-rpTr.z0x%X: %sz empty filez zlib error: )ryrMrrrrrtrr<rrrFrr rYrrrr ExceptionrrrrrJrrK)rmr<rrs rDrz TarFile.next< sW  D    '  A#D H ;;$,,++- -{{a LL  dkkAo .<<$$Q' 899 ,,2248<    LL   ( DLI" $$IIat{{A.>!>?KK9,K%& 6$$IIat{{A.>!>?KK9,K[[A%#CF+5&# <;;!##L1t;$' 6;;!##CF+5$( 2A'T1 !!TZZ0',qc(:;E"G sb=D J$ AE J$&AG1$G'J$J$ $H77 J$I J$%+J JJJ$c |j}d}| |j|}|d|}|rtjj |}t |D]a}|r|j|jk(rd}!|r*tjj |j}n |j}||k(s_|cS|r t|y#t$rd}YwxYw)NFT) r{indexr<rr/normpathreversedrr) rrr< normalizerJskippingr rc member_names rDruzTarFile._getmember} s //#   * g."&5/ 77##D)Dw'F>>V]]2$H gg..v{{; $kk {" ( W% % 1   sC CCcX |j |jd|_yr)rrKrs rDrzz TarFile._load s- iik% iik% rFc |jr"td|jjz|'|j|vrtd|jzyy)Nz %s is closedzbad operation for mode %r)rrr=rr)rrs rDryzTarFile._check sX  ;;.4>>+B+BBC C    55 AB B!6 rFc. |jrQdjtdtjj |j |jf}d}n|j}|}|j||d}|td|z|S)NrUT)r<r zlinkname %r not found) r`rrrr/rbrrarurv)rr<ralimitrcs rDrzTarFile._find_link_target s  ==?xxtbggoogll.KWM]M]-^ _`HE''HE5DI >2X=> > rFc#TK |jr|jEd{yd}|j|j}|dz }| |t |jkr|j|}n'|js|j}|s d|_yy|dz }|Y7w)Nrr-T)rKrJrMrr>)rr r<s rD__iter__zTarFile.__iter__ s <<|| # #     'iikG QJEMs4<<((,,u-\\))+#'DL QJEM $sB(B&BB(c\ ||jkrt|tjyy)Nfile)rGrrstderr)rlevelmsgs rDrz TarFile._dbg s& DJJ  #CJJ ' rFc&|j|Sr)ryrs rD __enter__zTarFile.__enter__ s  rFc||jy|js|jjd|_yr)rrrr)rrrr tracebacks rD__exit__zTarFile.__exit__ s2 < JJL## ""$DKrF) NrNNNNNNrNNNN)rN)rNrY)rNN)NNNTrr).N)rT)TFr!)=rrrrGrErFrHrrbr rBrCrr<r6rrrr6rsrrRrirmrqrSrrwr{r}rr rrrrrrrrrrrrrrrrrrrrrrurzryrrrrrrrFrDrrns EKLJFH FGJAEHL>B)-b^#tZ]/]/~22@6: I%* ? aF$D$L1"1"f%2G.+/%+/ZGG&. +, C@>B&+*0b N B?A$V2DB? L<B&&PC&>( rFrc t|dr.|j}t|}|j|n t|}|j y#t $rYywxYw)Nrt)rTF)rrrrrr)rrrs rDrr s]  4 ))+CT"A IIcNT A   sAA A%$A%c ddl}d}|j|}|jddddd |jd d td |j d}|jdddd|jddddd|jddddd|jdd dd!|j }|j r|j|jd"d#|j|j}t|rut|d$5}|jt|jtj%ddd|j r=td&j#|y|jd"d'j#|yy|j$u|j$}t|rzFilter for extraction)metavarchoicesr(T)requiredz-lz--list zShow listing of a tarfile)r)r(z-ez --extract+)r,z zExtract tarfile into target dir)nargsr)r(z-cz--create)zzzCreate tarfile from sourcesz-tz--testzTest if a tarfile is validr-z&--filter is only valid for extraction rrz{!r} is a tar archive.z{!r} is not a tar archive. rP)rr.)r/rr!z{!r} file is extracted.z+{!r} file is extracted into {!r} directory.rrr)rz.tgzz.xzz.txzz.bz2z.tbzz.tbz2z.tb2zw:rz{!r} file created.)argparseArgumentParser add_argumentradd_mutually_exclusive_group parse_argsrrexittestrrr{rrrrrbr rr>rcurdir format_helprcreater[r/splitextr)r/r$parserrargsrvrtfr6rtar_namer ext compressionstar_mode tar_files file_names rDmainrC sGK  $ $ $ =F k,-/  N .46  / / / >E tX{79 t[<=? tZs39; tX{8:    D {{t||+ A@A yyii c?c33 cnn&SZZ8 ||.55c:; KK9@@E F  ii c?c5)R -*) KK9@@E F  ! t||  !,,q/CYYF  ! #,,KC KK6--/ 0 c?c5)R 6$++ >*||S=3::3?C2396#v3Fc KK9@@E F  ;;??1%!!(+3  03l/B4,s++KK \\(H -& y!'. << &--h7 8 / !M *)*)>. -s0:P-P:Q"Q-P7:QQQ__main__r )kversion __author__ __credits__builtinsrrCrrr'rqrrrirrerrrrAttributeErrorNotImplementedErrorrr__all__r?r rsrrrrrryrr&r$rrrr,CONTTYPErrrrrrrrrrrrrrrrrWrrr getfilesystemencodingrErLr\rdrnrrrrrr rr r r rrrrYrrrobjectrrBufferedReaderr6rrrrrrrhrrrrrcompilerrrrrCrrrFrDrRs:6 H ' $%8'B *   ^                    HgGXWg#%5! #(>+ /   . 9       77d?H(s((*H 0& (N < *"&$ 2 y  8    x  (  (  {  ;  [    K 0rrj6