+
     ii2                        ^ RI t ^ RIt^ RItRsRsRs] P                  P                  RR4      P                  R4       U u. uF2  p V P                  4       '       g   K  RV P                  4       ,          NK4  	  up s
RsRR ltR tR tRR	 ltRR
 ltRR ltRR ltRR ltRR ltRR lt ! R R]4      t ! R R]4      tR t R t]R8X  d
   ]! 4        R# R# u up i )    NDEBPYTHON3_SUPPORTED ,python%sc                 ^   ^ RI HpHp \        '       g[   \        P
                  P                  R4      '       d6   V! 4       p\        R4      pVP                  V4       VP                  4        Vs\        '       d"   V '       d    \        P                  RV 4      pV# R#   T d    \        hi ; i)r   )ConfigParserNoOptionErrorz"/usr/share/python3/debian_defaultsDEFAULTN)configparserr   r	   	_defaultsospathexistsopen	read_filecloseget
ValueError)namer   r	   configdefaultsfilevalues   &     !/usr/share/python3/py3versions.pyread_defaultr      s    8977>>>??!^F DEL\* IyT	MM)T2E   		s   B B,c                     \         ;QJ d#    . R  V P                  R4       4       F  NK  	  5# ! R  V P                  R4       4       4      # )c              3   8   "   T F  p\        V4      x  K  	  R # 5iN)int).0parts   & r   	<genexpr>#version_to_tuple.<locals>.<genexpr>(   s     :'9tT'9   .)tuplesplit)versions   &r   version_to_tupler(   '   s6    5:w}}S'9:5:5:w}}S'9:::    c           
         \        V P                  R 4      4      ^8  d   \        R4      h^ RIpRVP                  RVP                  RVP
                  RVP                  RVP                  /p/ p\        4       p\        \        RR7      4      pR	pV P                  R 4       EF  pVP                  4       pVR
8X  d   K  VR9   d   K&  VP                  R\        4       4       \        P                  ! R4      pVP                  V4      p	 V	'       g   \        R4      hV	P                  ^4      V	P                  ^4      rVP                  R4      w  r\!        V4      ^8  d   K  V
R9   d   VP#                  V4       K  RpW*,          pV Uu. uF'  q! \%        V4      \%        V4      4      '       g   K%  VNK)  	  ppEK  	  RV9   d!   WCR&   V'       d   VP)                  V4      VR&   V# u upi   \&         d    \        R4      hi ; i)r   zDtoo many arguments provided for X-Python3-Version: min and max only.N=z>=z<=z<<Tversion_onlyFallversionsz(>=|<=|<<|=)? *(\d\.\d+)$z'error parsing Python3-Version attributer$   )currentcurrent_ext)Nr+   )lenr&   r   operatoreqgeleltsetsupported_versionsstrip
setdefaultrecompilematchgroupr   addr(   	Exceptionunion)vstringr3   	operatorsvinfoexact_versionsversion_range
relop_seenfieldvemopvvmajvminfiltopavs   &               r   parse_versionsrR   +   s   
7=="_``x{{Cx{{D(++x{{$I EUN*=>MJs#E>..SU+ZZ45HHUO	H !JKKGGAJ
JD4y1}[ ""1%!
".; !@mv$R(*:1*=@?m !@+ $2 U*j . 4 4] CE*L!@ 	HFGG	Hs1   	AG,"G,<G,
"G'1G'7G,'G,,Hc                    \         '       g;    \        R 4      pVP                  R4       Uu. uF  q"P                  4       NK  	  ups V '       d   \          Uu. uF  q3R,          NK  	  up# \         # u upi   \         d    . s  L>i ; iu upi )zold-versionsr      NN)_old_versionsr   r&   r:   r   r-   r   srM   s   &   r   old_versionsrY   V   s{    =	 0E05C0@A0@1WWY0@AM ,-}!"}-- B 	M	 .(   A6 A1A6 B	1A6 6BBc                    \         '       g;    \        R 4      pVP                  R4       Uu. uF  q"P                  4       NK  	  ups V '       d   \          Uu. uF  q3R,          NK  	  up# \         # u upi   \         d    . s  L>i ; iu upi )zunsupported-versionsr   rT   )_unsupported_versionsr   r&   r:   r   rW   s   &   r   unsupported_versionsr]   d   s      	' !78E8=C8H$I8H1WWY8H$I! 454!"455$$ %J 	'$&!	' 6rZ   c           	         \        4        \        '       g;    \        R 4      pVP                  R4       Uu. uF  q"P	                  4       NK  	  ups\        P%                  \        P'                  \(        4      4      p	\        P+                  4        \        P-                  V	4       V '       d   \         U
u. uF  qR
,          NK  	  up
# \        # u upi   \
         Ed	    . ROp ^ RIpTP                  T^RTP                  R7      pTP                  pM6  \         d)    \        P                  ! RP                  T4      4      p Mi ; iRpT FR  pTP                  R4      '       g   K  TP                  R^4      ^,          P	                  4       P                  R4      pKT  	  TP                  4        T Uu. uF  p\         P"                  ! RR	T4      NK  	  Mu upi ppTs ELi ; iu up
i )zsupported-versionsr   NF)bufsizeshellstdout zDepends::z\s*(\S+)[ (]?.*z\1rT   )z/usr/bin/apt-cachez--no-all-versionsshowzpython3-all)default_version_supported_versionsr   r&   r:   r   
subprocessPopenPIPEra   ImportErrorr   popenjoin
startswithr   r<   subpopindex_default_versionsortappend)r-   r   rX   cmdrg   pfddependslinedefaultrM   s   &          r   r9   r9   r   s   	* !56E6;kk#6F"G6F7796F"G$ "%%&9&?&?@P&QRGw'232!"233""1 #H 	**C-!$$S!+0 % JXX -XXchhsm,-G??:.."jja0399;AA#FG  HHJELMWrvv0%;WMGM")!	** 4s_   C CC 6G,C G)&/DG)0E	G)E		G),AG):!G
G)(G)c                    \         '       g   \        P                  ! R 4      s \        R4      p\         V\        P                  P                  RV4      39   g   \        RV,          4      hVs V '       d   \         R,          # \         # )z/usr/bin/python3zdefault-versionz/usr/binzkthe symlink /usr/bin/python3 does not point to the python3 default version. It must be reset to point to %srT   )rq   r   readlinkr   r   rl   r   )r-   debian_defaults   & r   re   re      su    ;;'9:!"34NZ0XYY *,:; < 	< &##r)   c                    \        4        R p\        V 4      p\        RR7      p\        V4      ^8X  d   VR,          P	                  V4      p. pV F  qeP                  V4       K  	   VP                  VP                  \        R,          4      4      pTP                  4        T'       d   TP                  T4       M\        R4      hT'       g   \        R4      hT'       d   T# T Uu. uF  pRT,          NK  	  up#    Rp Lq; iu upi )	NTr,   r/   rT   r   z/No supported python3 versions in version stringzempty set of versionsr   )re   rR   r9   r2   intersectionrs   ro   rp   rq   rr   r   )	rC   r-   r/   rE   	supportedvlr'   ry   rM   s	   &&       r   requested_versionsr      s    H7#E"5I
5zQ$11)<G7!3x	ffRXX&6r&:;<G 		IIgJKK011	(*+1
Q++	G ,s   (+C> )D>Dc                    ^ RI p\        4       pVP                  R4      VP                  R4      ,            Uu. uFH  p\        P                  P	                  V4      V9   g   K)  \        P                  P	                  V4      NKJ  	  ppVP                  4        V '       d   V Uu. uF  qUR,          NK  	  up# V# u upi u upi )r   Nz/usr/bin/python3.[0-9]z/usr/bin/python3.[0-9][0-9]rT   )globr9   r   r   basenamerr   )r-   r   r   rX   r/   rM   s   &     r   installed_versionsr      s    "$I#;<tyyIf?gg5gA77##A&)3 $  #g  5 MMO'(x!"x((5
 )s   &B:##B:$B?c                 n    \        R 4      pV ! R V 4       4      pRV,          pV'       d   V# RV,           # )Tc              3   8   "   T F  p\        V4      x  K  	  R # 5ir   )r(   )r   vers   & r   r!   +minmax_supported_version.<locals>.<genexpr>   s     N6Ms%c**6Mr#   z%d.%dpython)r9   )minmaxr-   supported_versions_listr'   version_strs   &&   r   minmax_supported_versionr      s<    06N6MNNGG#K+%%r)   c                       ] tR t^tRtR# )ControlFileValueError N__name__
__module____qualname____firstlineno____static_attributes__r   r)   r   r   r          r)   r   c                       ] tR t^tRtR# )MissingVersionValueErrorr   Nr   r   r)   r   r   r      r   r)   r   c                   RpRpRp\        V RR7      ;_uu_ 4       pV Uu. uF  qfP                  4       NK  	  ppRRR4       X F  pVR8X  d   VR8w  d   VR8X  d    MRpK  VP                  R4      '       d   RpK9  VP                  RV,           4      '       d   TpK[  VP                  4       P                  R4      '       g   K  VR8w  d   \	        R	4      hVP                  R
^4      ^,          P                  4       pK  	  Vf   \        R4      hVR8X  d   Vf   \        R4      hV# V# u upi   + '       g   i     L; i)zBread the debian/control file, extract the X-Python3-Version
field.Nzutf-8)encodingr   SourcezSource:z	Package: zx-python3-version:z1attribute X-Python3-Version not in Source sectionrc   znot a control filez$no X-Python3-Version in control file)r   r:   rm   lowerr   r&   r   r   )fnpkgr'   sversionsectioncontrolfilerx   liness   &&      r   extract_pyversion_attributer      s     GHG	b7	#	#{*56+$+6 
$2:'T/hG__Y''G__[3.//GZZ\$$%9::(" !TUUzz#q)!,224H  #$899
h*+QRRN) 7 
$	#s   D2D-D2-D22E	c            	      	   ^ RI Hp  Rp V ! VR7      pVP                  RRRRRR	7       VP                  R
RRRRR	7       VP                  RRRRRR	7       VP                  RRRRRR	7       VP                  RRRRR	7       VP                  RRRRR	7       VP                  RRRRRR R!7       VP                  4       w  r4\        P
                  P                  \        P                  ^ ,          4      pVP                  '       d2   \        V4      ^ 8X  d"    \        \        VP                  4      4       R## VP                   '       d@   \        V4      ^ 8X  d0   \        R$P#                  \%        VP                  4      4      4       R## VP&                  '       d@   \        V4      ^ 8X  d0   \        R$P#                  \)        VP                  4      4      4       R## VP*                  '       d6   \        V4      ^ 8X  d&   \        \-        \.        VP                  4      4       R## VP0                  '       d6   \        V4      ^ 8X  d&   \        \-        \2        VP                  4      4       R## VP4                  '       d   \        V4      ^8:  d   \        V4      ^ 8X  d   R%pM	V^ ,          p \        P
                  P7                  V4      '       d&   Tp \9        VR&4      p	\;        WP                  4      p
M\;        WsP                  4      p
\        R$P#                  X
4      4       R## \        P>                  PA                  R,V: R$V: R+24       \        P                  ! ^4       R##   \         d5   p\        R"T,          T4       \        P                  ! ^4        R#p?R## R#p?ii ; i  \<         dA    \        P>                  PA                  T: R'T: R(24       \        P                  ! ^4        L\B         d@    \        P>                  PA                  R)T,          4       \%        TP                  4      p
 EL0i ; i  \         dI   p\        P>                  PA                  T: R*T: R+24       \        P                  ! ^4        R#p?R## R#p?ii ; i)-r   )OptionParserz;[-v] [-h] [-d|--default] [-s|--supported] [-i|--installed] )usagez-dz	--defaultz!print the default python3 version
store_truery   )helpactiondestz-sz--supportedz$print the supported python3 versionsr   z-rz--requestedzprint the python3 versions requested by a build; the argument is either the name of a control file or the value of the X-Python3-Version attribute	requestedz-iz--installedz.print the installed supported python3 versions	installedz--min-supportedz+print the minimum supported python3 versionminsupportedz--max-supportedz+print the maximum supported python3 versionmaxsupportedz-vz	--versionz print just the version number(s)Fr-   )r   ry   r   r   z%s:Nrb   zdebian/controlr   z: not a control file: z, zC%s: no X-Python3-Version in control file, using supported versions
z: 
zusage: )"optparser   
add_option
parse_argsr   r   r   sysargvry   r2   printre   r-   r   exitr   rl   r9   r   r   r   r   minr   maxr   isfiler   r   r   stderrwriter   )r   r   parseroptsargsprogrammsgr/   r   rC   vss              r   mainr     s   %IE6&F
dK>)	  ; dMA)  = dMM *	  =
 dMK)  = 'H)  @ 'H)  @ dK=#L~  O ""$JDggsxx{+G|||D	Q	/$"3"345 
CINchh)$*;*;<=>	CINchh)$*;*;<=>				s4yA~&sD,=,=>?				s4yA~&sD,=,=>?	CINt9>'HAwH	ww~~h''?9"hGG+G5F5FGB (2C2CD#((2,
 	

We<=O  	%'/3'HHQKK	, -  JJ$$(/&5 6HHQK/ ?JJ$$ &H%,&- . ,D,=,=>B	?  	JJ7C89HHQKK	sm   M $$P7 	P7 !N! -0P7 N*)NN!AP4)P7 +P44<P40P7 3P44P7 7R
=RR
__main__r   )F)r   r<   r   r   rV   r\   environr   r&   r:   rf   rq   r   r(   rR   rY   r]   r9   re   r   r   r   r   r   r   r   r   r   )r   s   0r   <module>r      s    
 	 
	 zz~~&<bAGGL'L 58))+ 0zCIIK//L'   (;(V%#B ",6
&	J 		z 	><IV zF y
's    CC