mς P΄ήIc@sΊdkTdkTdkTdkTdkTdkZdkZdkZdkZdk Z ha ha da d„Z d„Zdefd„ƒYZdefd„ƒYZd efd „ƒYZdS( (t*NicCsd}tiidƒo;y)tddƒ}|iƒ}|iƒWqXdSqXXndSx¨|D] }|i dƒdjoq_n|i ƒi dƒ}t|ƒdjoq_n|ddjo|dt|d  s (deletable)(R'R)RRtbasenameR(tsR+(R'R0((Rtstrgs $+ cCstii|iƒS(N(RRR/R'R((R'((RtdownfilenscCs#t|dƒo |iSndSdS(NR+i(thasattrR'R+(R'((Rt getDeletableos cCstƒS(N(tReason(R'td((Rt compatibletscCstd|id|i ƒS(Nt[s] has not yet been downloaded.(R5R'R(tacquired(R'((Rt satisfiedwscCs€tƒ}|itii|iƒjptd|idƒ}n:d|ijo)tdƒ otd|idƒ}n|S(Ns Download [s"] refers to a user home directory.t$snon-snapshottable-downloadssk] contains an environment variable and can't be resolved for snapshots or mirrors (see -allow to override).(R5RR'R(RRt expandusertallow(R'R((Rt satisfiableys  cCs΅tiitii|iƒƒ\}}g}dojti i dƒoWti d}t |ƒo|i ||fƒq±|i tii||ƒ|fƒn|i ||fƒ|S(NitPAC_CACHE_LOCATION(RRRR<R'R(theadttailthtstenvironRtprefixtisURLtappendtjoin(R'R@RDRARB((Rt headtailss'  &cCsͺ|iƒ}t|iƒ|_|iƒo{xx|iƒD]f\}}yt i ƒ}t |ƒ}t|ƒoitidd|d|dƒ}tidd|d|dƒtdƒotd|d ƒq:nftidd|d|dƒ}tidd|d|dƒtdƒotd|d ƒn|iƒo|i|ƒ}nWntj otd ƒ}nX|iƒot|ƒ|_Pq8q8Wn|S( NR%sOK to download [s] from [s]?s Downloading [s]...sdownload-briefs Downloading s...s2Current directory does not exist. Can't download.(R'R>treasonR#R(tokRHR@RARtgetcwdtcwdtUniversalAccesstaccessorREtasktretverbotlogtflickertgetFiletOSErrorR5tfullpatht_remove(R'R@RIRNRARL((RtacquireŒs2      "  "     cCs>t|dƒotd|iƒ}ntd|iƒ}|S(NRWsrm -f (R3R'texecuteRWRIR)(R'RI((Rtretract§s(t__name__t __module__ttypettitletactionR,R.R1R2R4R7R:R>RHRXRZ(((RR$[s         t DownloadTimecBsYtZdZdZdZd„Zd„Zd„Zd„Zd„Z d „Z d „Z RS( Nstimed downloadsTimed Downloads time downloadcCs.t|ƒ|_||_d|_||_dS(Nf0.0(R$RR'R)tmaxtimet_maxtimet_timeR((R'RRa((RR,±s  cCs#|i|ijo|i|ijS(N(R'R)txRb(R'Rd((RR.·scCsi|idjo%d|iidd|idSn1d|iidd|idd|idSdS(Nf0.0s of s in at most s%gs secondss in s seconds, must be <= (R'RcR)R(Rb(R'((RR1Έs%cCstƒS(N(R5(R'((RR>ΌscCst| d|i ƒS(Ns has not yet been attempted.(R5R'R9(R'((RR:½scCs«tiƒ}|iiƒ}tiƒ}t|iiƒƒ|||_ |i ƒoS|||i joq§t |iiƒdd|i dd|i dƒ}n|S(Ns downloads in s%gs but its not <= s seconds.( ttimett1R'R)tsatisfyRItt2t removeFileR2RcRJRbR5(R'RhRfRI((RRXΏs    ;cCsd|_tƒS(Nf0.0(R'RcR5(R'((RRZΚs ( R[R\R]R^R_R,R.R1R>R:RXRZ(((RR`¬s      tDownloadUntarzipcBsqtZdZdZdZdd„Zd„Zd„Zdd „Zd „Z d „Z d „Z d „Z d„Z RS(NtdownloadUntarzipsDownload and Untar/zipssdownload and untar/ziptcCsO||_||_t|iƒ|_titi i |iƒ|iƒ|_ dS(N( RR'R(tenvirot_enviroR$R)tUntarzipRRR/t_untar(R'RRm((RR,Σs  cCs#|i|ijo|i|ijS(N(R'R(RdRn(R'Rd((RR.ΩscCs|iidjo|iiƒdSnrt|idƒo?t|iidƒo)|iiƒd|iiiƒdSn |iiƒd|iidSdS( NRls and untar/zipRnR]s untar/zip with top directory [t]s untar/zip and set [s] to top directory.(R'Rpt_envR)R1R3Rn(R'((RR1Ϊs ))icCsY|d|iƒd| GHtdƒo,x)|iiD]}|dd|GHq6WndS(NRttari(tindentR't statusStrt displayModeRpt _contentsRd(R'RtRd((Rtdisplayβs   cCstƒS(N(R5(R'((RR>θscCs |iiƒS(N(R'RpR:(R'((RR:ιscCs±d}d}x’|iiƒ}|iit|ii ƒƒƒ|i ƒo,|iiƒ}t t i i|iƒƒn|i ƒ oέt| dƒ oΛ||joΎtidd| dƒ}|i ƒo‚|d}tid| dƒtid| ƒtidd| d | d ƒtidd tƒ d ƒtitƒƒqŒti|ƒ}Pn,|djotidd | dƒnP|d|i_qWd|i_|S(Niisnon-standard charactertretrys OK to retry [s]?s% has failed with the following error:s Retrying t/s...s Pausing [s3] seconds first (see -retry help to adjust this)...s Retry of [s] has succeeded...i(tnRetrytmRetryR'R)RgRIRpt setTarballR#t getTarballRJRiRRR/R(tcontainsRORPRRQRRt httpGetPauseRetsleeptcopytdeepcopyt _tarpause(R'R|RIRR{((RRXλs4 -  "  cCs_|iiƒiƒt|iƒ|_|iiƒ}tit i i |iƒ|i ƒ|_|S(N( R'R)RZtrequireR$R(RpRRoRRR/Rn(R'R((RRZs 'cCs |iiƒS(N(R'Rptverify(R'((RR†s(R[R\R]R^R_R,R.R1RxR>R:RXRZR†(((RRjΞs        (tBaset Environmentt FileGettert ExecutionRMturlparseReRRoRRRRRR#R$R`Rj( R`R‹RRRoReR$RjRR#((Rt?s      +Q"