ó »ÉD[c@sddlmZddlZddlZddlZddlmZmZddlZddl Z ddl m Z de fd„ƒYZ de fd„ƒYZd e fd „ƒYZd e fd „ƒYZd „Zde fd„ƒYZedkr eddƒZejejƒxõejD]çZejdejƒejdejƒejdejƒejdejƒejikr¦ejdeejjƒƒƒnx4ej D])Z!ejde!je!je!j"fƒq°Wx%ej#D]Z$ejde$jƒqçWqWndS(iÿÿÿÿ(tprint_functionN(tPopentPIPE(tgettexttTemplatecBs#eZd„Zd„Zd„ZRS(cCs‚d|_t|_g|_d|_d|_d|_d|_g|_ g|_ d|_ i|_ d|_ t|_t|_dS(N(tNonetnametFalsetchildtparentst match_namet descriptiontbase_urittypet componentstchildrent match_urit mirror_sett distributiontTruet availabletofficial(tself((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyt__init__'s             cCs|d„|jDƒkS(s8 Check if the distribution provides the given component css|]}|jVqdS(N(R(t.0tc((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pys 9s(R(Rtcomp((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyt has_component7scCsCt|ƒ\}}}||jkr;|j|j||ƒStSdS(s8 Check if a given url of a repository is a valid mirror N(t split_urlRthas_repositoryR(Rturltprotothostnametdir((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyt is_mirror;s(t__name__t __module__RRR"(((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyR%s  t ComponentcBsPeZdddd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS(cCs(||_||_||_||_dS(N(RR tdescription_longtparent_component(RRtdesct long_descR'((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyRFs   cCs|jS(N(R'(R((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pytget_parent_componentLscCs ||_dS(N(R'(Rtparent((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pytset_parent_componentOscCs4|jdk r|jS|jdk r,|jSdSdS(N(R&RR (R((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pytget_descriptionRs cCs ||_dS(N(R (RR(((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pytset_descriptionZscCs ||_dS(N(R&(RR(((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pytset_description_long]scCs|jS(N(R&(R((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pytget_description_long`sN( R#R$RRR*R,R-R.R/R0(((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyR%Ds     tMirrorcBsPeZdZdd„Zd„Zd„Zd„Zd„Zd„Z d„Z RS( s( Storage for mirror related information cCs/||_g|_|j||ƒ||_dS(N(R t repositoriestadd_repositorytlocation(RRR R!R4((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyRgs  cCs|jjt||ƒƒdS(N(R2tappendt Repository(RRR!((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyR3mscCs)g|jD]}|j|kr |^q S(N(R2R(RRtr((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pytget_repositories_for_protopscCsJ|dkrtSx3|jD](}|j|kr||jkrtSqWtS(N(RRR2RR!R(RRR!R7((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyRss  cCs&g|jD]}|j|jƒ^q S(N(R2tget_urlR (RR7((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyt get_repo_urls{scCs|jS(N(R4(R((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyt get_location~scCs ||_dS(N(R4(RR4((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyt set_locationsN( R#R$t__doc__RRR3R8RR:R;R<(((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyR1ds      R6cBs#eZd„Zd„Zd„ZRS(cCs||_||_dS(N(RR!(RRR!((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyR‡s cCs|j|jfS(N(RR!(R((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pytget_info‹scCsd|j||jfS(Ns %s://%s/%s(RR!(RR ((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyR9Žs(R#R$RR>R9(((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyR6…s  cCsBtjd|ddƒ}x#t|ƒdkr=|jdƒqW|S(sE split a given URL into the protocoll, the hostname and the dir part s:*\/+tmaxsplitiiN(tretsplittlenR5R(RRA((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyR’stDistInfocBs eZddd„Zd„ZRS(s/usr/share/python-apt/templatescCs˜d|_g|_tjjdƒ|_d}tjdƒ}tjdƒ}|sÅy/t dddgdt ƒj ƒd j ƒ}WqÅt k rÁ}|jtjkr¸tjd |ƒnd }qÅXn||_i}d ||f}t|ƒ¢} d} d} xp| D]h} | jd dƒ} t| ƒdkr6qn| d j ƒ}| dj ƒ}|dkrtt|ƒ|_q|dkrŒ||_q|dkrÙ|j| | ƒd} tƒ} || _|| _d|| _q|dkrñ|| _q|dkrOt| _xe|jD]8}|j|kr| jj |ƒ|j!j | ƒqqWq|dkrptj"|ƒ| _#q|dkr‘tj"|ƒ| _$q|dkr©|| _%q|dkrË| j& rË|| _&q|d|jkrê|| _&q|dkr | j' r || _'q|d|jkr+|| _'q|dksJ|d|jkr©t(j)j*|ƒrb|p€t(j)j+t(j)j,||ƒƒ}||kr™i}yJt|ƒ8}t-t.|j/g|D]}|j ƒ^qºƒƒ}WdQXWn!t0k rt1dƒg}nXx†|D]~} | j2d ƒr7|j3d!| ƒ}q nt4| ƒ\}}}||kro||j5||ƒq t6||||ƒ|||ƒqqW|j| | ƒd} d} WdQXdS('NtsAPT::Architectures ^#LOC:(.+)$sS^(#LOC:.+)|(((http)|(ftp)|(rsync)|(file)|(mirror)|(https))://[A-Za-z0-9/\.:\-_@]+)$t lsb_releases-is-ststdoutis#lsb_release failed, using defaults:tDebians %s/%s.infot:iit ChangelogURItMetaReleaseURItSuites^%s$t MatchNamet ParentSuitet AvailabletOfficialtRepositoryTypetBaseURIs BaseURI-%stMatchURIs MatchURI-%st MirrorsFilesMirrorsFile-%ss#WARNING: Failed to read mirror files#LOC:s\1t DescriptionR%tCompDescriptiontCompDescriptionLongtParentComponent(?tmetarelease_urit templatestapt_pkgtconfigtfindtarchRR@tcompileRRt communicatetstriptOSErrorterrnotENOENTtloggingtwarningtdisttopenRARBt_tchangelogs_uritfinish_templateRRRR RRR R5Rtstring_to_boolRRR R Rtostpathtisabstabspathtjointlisttfiltertmatcht Exceptiontprintt startswithtsubRR3R1RR RRR%R.R/R,(RRftbase_dirR4t match_loctmatch_mirror_linetexctmap_mirror_setst dist_fnamet dist_filettemplatet componenttlinettokenstfieldtvaluetnannyRtvalue_ftxt mirror_dataRR R!((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyRœsÌ                          ! /           cCs|s dS|jdkrR|jrRx-|jD]}|jr,|j|_Pq,q,Wn|jikrš|jršx-|jD]}|jrt|j|_PqtqtWn|rÌ|j|jƒ rÌ|jj|ƒd}nx|jD]}|j |_ qÖW|j j|ƒdS(s finish the current tempalte N( RRRR RRRRR5RRY(RRR€tt((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyRjs$       N(R#R$RRRj(((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyRCšsrt__main__tUbuntus/usr/share/python-apt/templatess Suite: %ssDesc: %ss BaseURI: %ss MatchURI: %ss Mirrors: %ss %s -%s -%ss %s(%t __future__RRbRdRlt subprocessRRR@RZRRhtobjectRR%R1R6RRCR#tdtinfoRiRYRRR R RRRqtkeysRRR&RR(((s7/usr/lib/python2.7/dist-packages/aptsources/distinfo.pyts:      ! Œ #