+
    S^i:              
       
   ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	t	^ RI	H
t R R lt ! R R4      t ! R	 R
4      t ! R R4      t ! R R4      tR R lt ! R R4      t]R8X  Ed   ]! RR4      t]P*                  ! ]P,                  4       ]P.                   EFZ  t]P*                  ! R]P2                  ,          4       ]P*                  ! R]P4                  ,          4       ]P*                  ! R]P6                  ,          4       ]P*                  ! R]P8                  ,          4       ]P:                  / 8w  d8   ]P*                  ! R]! ]P:                  P?                  4       4      ,          4       ]P@                   F<  t!]P*                  ! R]!P2                   R]!P4                   R]!PD                   24       K>  	  ]PF                   F&  t$]P*                  ! R]$P4                  ,          4       K(  	  EK]  	  R# R# )    N)Iterator)cast)gettextc                R    V ^8  d   QhR\         R\         R\        \         ,          /# )   templatecsv_pathreturn)strr   )formats   "5/usr/lib/python3/dist-packages/aptsources/distinfo.py__annotate__r   $   s*     S1 S1s S1c S1hsm S1    c           
   #    a	"   \        4       p\        P                  ! V 4      ;_uu_ 4       pV F  pRV9   d(   VP                  VR,          P	                  R4      4       RV9   d)   RVR,          9   d    MHVP                  VR,          4       \        V4      P                  4        Rj  xL
  K  	   RRR4       R# V F$  pRV9   g   K  VP                  VR,          4       K&  	  RRR4       \        V4      ;_uu_ 4       p\        \        \        P                  ! V4      4      4      pRRR4       X EFF  pVR,          V9   d   K  Rx  VR,          P                  R	R4      VR&   \        P                  ! V 4      ;_uu_ 4       pV F  pRV9  g   RVR,          9  d   K  R
V9   dx   VR,          o	\        ;QJ d5    V	3R lVR
,          P	                  R4       4       F  '       g   K   RM*	  RM&! V	3R lVR
,          P	                  R4       4       4      '       d   K  \        V4      P                  ! R/ VB P                  4        F   pVP!                  R
4      '       d   K  Vx  K"  	  K  	  RRR4       EKI  	  \        P                  ! V 4      ;_uu_ 4       pV F  pRV9   g   K  RVR,          9   g   K   M	  V F;  pRV9   d   RVR,          9   d   K  \        V4      P                  4        Rj  xL
  K=  	  RRR4       R#  ELc  + '       g   i     EL1; i  + '       g   i     EL; i  + '       g   i     EK  ; i LR  + '       g   i     R# ; i5i)ab  Expand the given template.

A template file consists of a header, followed by paragraphs
of templated suites, followed by a footer. A templated suite
is any paragraph where the Suite field contains {.

This function expands all templated suites using the information
found in the CSV file supplied by distro-info-data.

It yields lines of template info.
zX-Exclude-Suitesz, Suite{Nseries versionz LTSz	X-Versionc              3     <"   T F  pVP                  R 4      ;'       d*    \        P                  ! VR,          S4      ^ 8  ;'       g;    VP                  R4      ;'       d"    \        P                  ! VR,          S4      ^ 8  x  K  	  R# 5i)le:   NNgeN)
startswithapt_pkgversion_compare).0fieldvers   & r   	<genexpr>#_expand_template.<locals>.<genexpr>X   s      
 &FE ",,T2 L L ' 7 7b	3 G! K 
 ",,T2 L L ' 7 7b	3 G! K &Fs   B(B	B"*BTF )setr   TagFileupdatesplitaddr   
splitlinesopenreversedlistcsv
DictReaderreplaceanyr   r   )
r   r	   known_suitestmplsection
csv_objectreleasesrelliner   s
   &&       @r   _expand_templater7   $   s     5L 
	"	"dG!W,##G,>$?$E$Ed$KL'!''**  !127|..000   
#	" G'!  !12  
#& 
h:D
!;<= 
 x=L(Y//;I__X&&$')S8H-H')i.Cs 
 &-[%9%?%?%E
sss 
 &-[%9%?%?%E
 
 
 !L//6#6AACD{33 J D)   '& @ 
	"	"dG'!cWW-=&=  G '!cWW-=&=7|..000  
#	"[ 1 
#	"	"& 
 '&&N 1 
#	"	"s   )M$A?L+L
,	L5
M$?	LL)M$)L%-AM$	7L9*L9.3L9"AL95+M$ 
M/M?<M;M
<M
M$LL"		M$%L6	0	M$9M
M$MM!		M$c                   V   a  ] tR t^zt o V 3R lR ltV 3R lR ltV 3R lR ltRtV tR# )	Templatec                   < V ^8  d   QhRR/# r   r
   Nr"   )r   __classdict__s   "r   r   Template.__annotate__{   s      $ r   c                    R V n         RV n        . V n        R V n        R V n        R V n        R V n        . V n        . V n        R V n	        / V n
        R V n        RV n        RV n        R # NFT)namechildparents
match_namedescriptionbase_uritype
componentschildren	match_uri
mirror_setdistribution	availableofficialselfs   &r   __init__Template.__init__{   sf     $	
')&*'+$( $	+-(*%)-/(,r   c                &   < V ^8  d   QhRS[ RS[/# )r   compr
   r   bool)r   r<   s   "r   r   r=      s     9 9# 9$ 9r   c                .    VR V P                    4       9   # )z6Check if the distribution provides the given componentc              3   8   "   T F  qP                   x  K  	  R # 5iN)r@   )r   cs   & r   r    )Template.has_component.<locals>.<genexpr>   s     81s   )rG   )rO   rS   s   &&r   has_componentTemplate.has_component   s    8888r   c                &   < V ^8  d   QhRS[ RS[/# r   urlr
   rT   )r   r<   s   "r   r   r=      s      S T r   c                    \        V4      w  r#pW0P                  9   d#   V P                  V,          P                  W$4      # R# )z6Check if a given url of a repository is a valid mirrorF)	split_urlrJ   has_repository)rO   r_   protohostnamedirs   &&   r   	is_mirrorTemplate.is_mirror   s7    (~&??8,;;EGGr   )rL   rE   rA   rH   rG   rD   rK   rC   rI   rJ   r@   rM   rB   rF   N)	__name__
__module____qualname____firstlineno__rP   r[   rf   __static_attributes____classdictcell__r<   s   @r   r9   r9   z   s#       9 9 r   r9   c                      a  ] tR t^t o RV 3R lR lltV 3R lR ltV 3R lR ltV 3R lR	 ltV 3R
 lR ltV 3R lR lt	V 3R lR lt
RtV tR# )	ComponentNc          	      \   < V ^8  d   QhRS[ RS[ R,          RS[ R,          RS[ R,          /# )r   r@   descN	long_descparent_componentr   )r   r<   s   "r   r   Component.__annotate__   s?     
1 
1
1 Dj
1 :	
1
 *
1r   c                6    Wn         W n        W0n        W@n        R # rX   )r@   rD   description_longrt   )rO   r@   rr   rs   rt   s   &&&&&r   rP   Component.__init__   s     	 ) 0r   c                .   < V ^8  d   QhRS[ R,          /# r;   ru   )r   r<   s   "r   r   rv           % %cDj %r   c                    V P                   # rX   rt   rN   s   &r   get_parent_componentComponent.get_parent_component       $$$r   c                $   < V ^8  d   QhRS[ RR/# )r   parentr
   Nru   )r   r<   s   "r   r   rv      s     ' '3 '4 'r   c                    Wn         R # rX   r}   )rO   r   s   &&r   set_parent_componentComponent.set_parent_component   s     &r   c                .   < V ^8  d   QhRS[ R,          /# r;   ru   )r   r<   s   "r   r   rv      s      t r   c                n    V P                   e   V P                   # V P                  e   V P                  # R # rX   )rx   rD   rN   s   &r   get_descriptionComponent.get_description   s5      ,((()###r   c                $   < V ^8  d   QhRS[ RR/# r   rr   r
   Nru   )r   r<   s   "r   r   rv      s        C  D  r   c                    Wn         R # rX   )rD   rO   rr   s   &&r   set_descriptionComponent.set_description   s    r   c                $   < V ^8  d   QhRS[ RR/# r   ru   )r   r<   s   "r   r   rv      s     % % % %r   c                    Wn         R # rX   rx   r   s   &&r   set_description_longComponent.set_description_long   s     $r   c                .   < V ^8  d   QhRS[ R,          /# r;   ru   )r   r<   s   "r   r   rv      r{   r   c                    V P                   # rX   r   rN   s   &r   get_description_longComponent.get_description_long   r   r   )rD   rx   r@   rt   )NNN)rh   ri   rj   rk   rP   r~   r   r   r   r   r   rl   rm   rn   s   @r   rp   rp      sK     
1 
1% %' '    % %% %r   rp   c                      a  ] tR t^t o RtRV 3R lR lltV 3R lR ltV 3R lR ltV 3R	 lR
 ltV 3R lR lt	V 3R lR lt
V 3R lR ltRtV tR# )Mirrorz&Storage for mirror related informationNc          	      @   < V ^8  d   QhRS[ RS[ RS[ RS[ R,          /# )r   rc   rd   re   locationNru   )r   r<   s   "r   r   Mirror.__annotate__   s1     ! !!$'!.1!=@4Z!r   c                N    W n         . V n        V P                  W4       W@n        R # rX   )rd   repositoriesadd_repositoryr   )rO   rc   rd   re   r   s   &&&&&r   rP   Mirror.__init__   s$     !.0E' r   c                *   < V ^8  d   QhRS[ RS[ RR/# r   rc   re   r
   Nru   )r   r<   s   "r   r   r      s"     9 9C 9c 9d 9r   c                N    V P                   P                  \        W4      4       R # rX   )r   append
RepositoryrO   rc   re   s   &&&r   r   Mirror.add_repository   s      E!78r   c                4   < V ^8  d   QhRS[ RS[R,          /# )r   rc   r
   r   r   r+   )r   r<   s   "r   r   r      s$     B B B\8J Br   c                h    V P                    Uu. uF  q"P                  V8X  g   K  VNK  	  up# u upi rX   )r   rc   )rO   rc   rs   && r   get_repositories_for_proto!Mirror.get_repositories_for_proto   s-    ,,A,a50@,AAAs   //c                ,   < V ^8  d   QhRS[ RS[ RS[/# )r   rc   re   r
   rT   )r   r<   s   "r   r   r      s"      C c d r   c                    Vf   R# V P                    F)  pVP                  V8X  g   K  W#P                  9   g   K(   R# 	  R# r?   )r   rc   re   )rO   rc   re   r   s   &&& r   rb   Mirror.has_repository   s6    ;""Aww%C55L # r   c                0   < V ^8  d   QhRS[ S[,          /# r   r
   )r+   r   )r   r<   s   "r   r   r      s     E EtCy Er   c                t    V P                    Uu. uF  qP                  V P                  4      NK  	  up# u upi rX   )r   get_urlrd   )rO   r   s   & r   get_repo_urlsMirror.get_repo_urls   s-    262C2CD2CQ		$--(2CDDDs   #5c                .   < V ^8  d   QhRS[ R,          /# r;   ru   )r   r<   s   "r   r   r      s      cDj r   c                    V P                   # rX   r   rN   s   &r   get_locationMirror.get_location   s    }}r   c                $   < V ^8  d   QhRS[ RR/# )r   r   r
   Nru   )r   r<   s   "r   r   r      s     ! !S !T !r   c                    Wn         R # rX   r   )rO   r   s   &&r   set_locationMirror.set_location   s     r   )rd   r   r   rX   )rh   ri   rj   rk   __doc__rP   r   r   rb   r   r   r   rl   rm   rn   s   @r   r   r      sR     0! !9 9B B E E ! !r   r   c                   V   a  ] tR t^t o V 3R lR ltV 3R lR ltV 3R lR ltRtV tR# )	r   c                *   < V ^8  d   QhRS[ RS[ RR/# r   ru   )r   r<   s   "r   r   Repository.__annotate__   s"      c   r   c                    Wn         W n        R # rX   rc   re   r   s   &&&r   rP   Repository.__init__   s    
r   c                6   < V ^8  d   QhRS[ S[S[3,          /# r   )tupler   )r   r<   s   "r   r   r      s     $ $%S/ $r   c                2    V P                   V P                  3# rX   r   rN   s   &r   get_infoRepository.get_info   s    zz488##r   c                &   < V ^8  d   QhRS[ RS[ /# )r   rd   r
   ru   )r   r<   s   "r   r   r      s     7 7 7 7r   c                >    V P                    R V RV P                   2# )z:///r   )rO   rd   s   &&r   r   Repository.get_url   s!    **S
!DHH:66r   )re   rc   N)	rh   ri   rj   rk   rP   r   r   rl   rm   rn   s   @r   r   r      s#      $ $7 7r   r   c                F    V ^8  d   QhR\         R\        \         ,          /# r^   r   )r   s   "r   r   r      s      3 49 r   c                ~    \         P                  ! RV ^R7      p\        V4      ^8  d   VP                  R4       K#  V# )zCsplit a given URL into the protocoll, the hostname and the dir partz:*\/+)maxsplitN)rer&   lenr   )r_   r&   s   & r   ra   ra      s0    HHXsQ/E
e*q.TLr   c                   H   a  ] tR t^t o RV 3R lR lltV 3R lR ltRtV tR# )DistInfoNc                4   < V ^8  d   QhRS[ R,          RS[ /# )r   distNbase_dirru   )r   r<   s   "r   r   DistInfo.__annotate__   s'     v* v*Djv* v*r   c                   R V n         . V n        \        P                  P	                  R4      V n        Rp\        P                  ! R4      p\        P                  ! R4      pV'       g   \        P                  ! 4       pVR,          pWn
        / pV RV R2pRVP                  4        R	2p	\        \        R4      p
\        \        R4      p\        W4       EFw  pVP!                  R
^4      p\#        V4      ^8  d   K(  V^ ,          P%                  4       pV^,          P%                  4       pVR8X  d   \'        V4      V n        Ko  VR8X  d	   Wn         K~  VR8X  dH   V P+                  W4       \        \        R4      p\        4       p
Wn        Wn        RV,          V
n        K  VR8X  d	   Wn        K  VR8X  dg   RV
n        V P                   FL  pVP,                  V8X  g   K  V
P4                  P7                  V4       VP8                  P7                  V
4       KN  	  EKH  VR8X  d   \        P:                  ! V4      V
n        EKm  VR8X  d   \        P:                  ! V4      V
n        EK  VR8X  d
   Wn         EK  VR8X  d   V
PB                  '       g
   Wn!        EK  VRV P
                  ,          8X  d
   Wn!        EK  VR8X  d   V
PD                  '       g
   Wn"        EK  VRV P
                  ,          8X  d
   Wn"        EK(  VR8X  g   VRV P
                  ,          8X  EdZ   \F        PH                  PK                  V4      ;'       d    T;'       g=    \F        PH                  PM                  \F        PH                  PO                  W/4      4      pW9  d   / p \Q        V4      ;_uu_ 4       p\S        \U        VPV                  V Uu. uF  pVP%                  4       NK  	  up4      4      pRRR4       X Fp  pTP]                  R4      '       d   TP_                  RT4      pK.  \a        T4      w  pppTT9   d   TT,          Pc                  TT4       K_  \e        TTTT4      TT&   Kr  	  TY&   W,          V
n3        EK  VR8X  d   \'        V4      V
n4        EK  VR8X  dS   V'       d=   V
Pk                  VP,                  4      '       g   V
Pl                  P7                  V4       \        V4      pEK  VR 8X  d   VPo                  \'        V4      4       EK8  VR!8X  d   VPq                  \'        V4      4       EK\  VR"8X  g   EKf  VPs                  V4       EKz  	  V P+                  W4       \        \        R4      p
\        \        R4      pR# u upi   + '       g   i     EL; i  \X         d    \[        RT 24       . p ELi ; i)#r   zAPT::ArchitectureNz^#LOC:(.+)$zS^(#LOC:.+)|(((http)|(ftp)|(rsync)|(file)|(mirror)|(https))://[A-Za-z0-9/\.:\-_@]+)$IDr   z.infoz/usr/share/distro-info/z.csv:ChangelogURIMetaReleaseURIr   z^%s$	MatchNameParentSuiteT	AvailableOfficialRepositoryTypeBaseURIz
BaseURI-%sMatchURIzMatchURI-%sMirrorsFilezMirrorsFile-%sz$WARNING: Failed to read mirror file z#LOC:z\1Descriptionrp   CompDescriptionCompDescriptionLongParentComponent):metarelease_uri	templatesr   configfindarchr   compileplatformfreedesktop_os_releaser   lowerr   r9   rp   r7   r&   r   strip_changelogs_urifinish_templater@   rK   rC   rA   rB   r   rH   string_to_boolrL   rM   rF   rE   rI   ospathisabsabspathjoinr)   r+   filtermatch	Exceptionprintr   subra   r   r   rJ   rD   r[   rG   r   r   r   )rO   r   r   r   	match_locmatch_mirror_lineinfomap_mirror_sets
dist_fname	csv_fnamer   	componentr6   tokensr   valuenannyrJ   value_fxmirror_datarc   rd   re   s   &&&                     r   rP   DistInfo.__init__   s   
  ")+NN''(;<	JJ~.	JJ&
 224D:D	 z4&.
-djjl^4@	 $'D)	$Z;DZZQ'F6{Q1IOO%E1IOO%E&&'h#**',$'!$$X9 D1	#: %(,%&,un#+%&+#-'!%!^^EzzU* ((//6--h7	 ,
 +%%,%;%;E%B"*$$+$:$:5$A!** %)#H,=,=,=$)!,22$)!*$X-?-?-?%*"-$))33%*"-'54Dtyy4P+P GGMM%(  F Fwwrww||H'DE 
 /46J
)!%[[G*. &$5$;$;8?$@1QWWY$@!"+K ) !,??733'0}}UD'AH$1:4.##z1&x0??sK39 %xh4Jx0 !, .8O*&5&<#-''(x$+%X%;%;INN%K%K''..y9%e,	++))!E(3//..qx8++..u5i <j 	X1$'D)	C %A	 )[[ % ) DUGLM&()sB   V'V
VV
%VV

VVVV=<V=c                8   < V ^8  d   QhRS[ RS[R,          RR/# )r   r   r  Nr
   )r9   rp   )r   r<   s   "r   r   r   m  s(     ( ( (Y=M (RV (r   c                   V'       g   R# VP                   fK   VP                  '       d9   VP                   F(  pVP                   '       g   K  VP                   Vn          M	  VP                  / 8X  dK   VP                  '       d9   VP                   F(  pVP                   '       g   K  VP                  Vn         M	  V'       d?   VP	                  VP
                  4      '       g   VP                  P                  V4       RpVP                   F  pVP                  Vn        K  	  V P                  P                  V4       R# )zfinish the current tempalteN)
rI   rA   rB   rJ   r[   r@   rG   r   rM   r   )rO   r   r  ts   &&& r   r   DistInfo.finish_templatem  s    %(...%%;;;)*H& & "$%%;;;*+,,H' & X33INNCC&&y1I!!A !

H "h'r   )r   r   r   r   r   )N/usr/share/python-apt/templates)rh   ri   rj   rk   rP   r   rl   rm   rn   s   @r   r   r      s     v* v*p( (r   r   __main__Ubuntur  z

Suite: %szDesc: %szBaseURI: %szMatchURI: %szMirrors: %s z -z  %s)%r,   loggingr   r   r   collections.abcr   typingr   r   r   r   r7   r9   rp   r   r   ra   r   rh   dr  r   r   r   r@   rD   rE   rI   rJ   r+   keysrG   rS   rx   rH   rA   r"   r   r   <module>r      s  0   	  	 $    S1l <"% "%J !  !F	7 	7N( N(b z<=ALL!!"KK]X]]23Z("6"667]X%6%667^h&8&889"$LLh.A.A.F.F.H)IIJ''DLL1TYYKr$*:*:);2d>S>S=TUV (&&ELL%"3"334 '   r   