+
    i  c                   sf    ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHtH	t	H
t
  ! R R]]	4      tR# )i    N)partial)PluginRedHatPlugin	PluginOptc                   sz   a  ] tR t^t o RtRtRt]! RR]RR7      ]! RRR	R
7      .t	Rt
RtR tR tR tR tRtV tR# )Jarsz1Collect information about available Java archivesjarsappend-locations z,colon-delimited list of additional JAR paths)defaultZval_typedescall-known-locationsFzscan all known paths)r   r	   c                s    R . /p. p\        \        P                  4      pV P                  R4      '       d!   V\        \        P                  4      ,          pV P                  R4      pV'       d   W4P                  R4      ,          pV Fg  p\        P                  ! V4       FJ  w  rgpV F>  p	V P                  Wi4      p
V P                  V
4      '       g   K-  VP                  V
4       K@  	  KL  	  Ki  	  V FW  pV P                  V4      pV P                  V4      pV'       g   V'       g   K7  RVRVRV/pVR ,          P                  V4       KY  	  \        P                  ! V^RR7      pV P                  VRR	R
7       R# )r   r
   r   Z:pathsha1maven_id)ZindentZ
separatorsz	jars.jsonT)Zplug_dirN)Z,: )Zlistr   jar_locationsZ
get_optionextra_jar_locationssplitosZwalkZ	path_joinis_jarZappendget_maven_id
get_jar_idjsonZdumpsZadd_string_as_file)selfZresultsZ	jar_pathsZ	locationsZuser_locationsZlocationZdirpathZ_Z	filenamesZfilenamer   jar_pathr   jar_idZrecordZresults_strs   &               </usr/lib/python3.14/site-packages/sos/report/plugins/jars.pysetupZ
Jars.setup1   sI   2,	++,	??011d6677I );<--c22I "H)+):%I )H>>'<D{{4((!((. !* *; " "H((2H__X.F66 ( &$h &&v. " jj{K[4H    c                s   \         P                  P                  V4      '       dh   \        P                  ! V4      '       dL    \        P
                  ! V4      ;_uu_ 4       pRVP                  4       9   d    RRR4       R#  RRR4       R# R#   + '       g   i     R# ; i  \        \        P                  3 d#   pT P                  RT RT 24        Rp?R# Rp?ii ; i)zCheck whether given file is a JAR file.

JARs are ZIP files which usually include a manifest
at the canonical location 'META-INF/MANIFEST.MF'.
zMETA-INF/MANIFEST.MFNTzCould not determine if z is a JAR: F)
r   r   ZisfilezipfileZ
is_zipfileZipFilenamelistIOErrorZ
BadZipfile	_log_info)r   r   fileerrs   &&  r   r   ZJars.is_jarT   s     77>>$G$6$6t$<$<__T**d-@# +*@ +  +* 	 W//0 -dV;seD  	s<   B# !B8B# B# B 	B#  B# #C >CC c           	     s   / p \         P                  ! V4      ;_uu_ 4       p\        P                  ! R4      pVP	                  4        Uu. uF  qTP                  V4      '       g   K  VNK  	  pp\        V4      ^8w  d    RRR4       R# VP                  V^ ,          4      ;_uu_ 4       pVP                  4        F  pVP                  4       pVP                  R4      '       d   K,   VP                  R4      w  rV	P                  R4      P                  4       p	V
P                  R4      P                  4       p
WV	&   K  	  RRR4       RRR4       V# u upi   \         d      RRR4       RRR4       R# i ; i  + '       g   i     LB; i  + '       g   i     T# ; i  \         d#   pT P                  RT RT 24        Rp?T# Rp?ii ; i)zExtract Maven coordinates from a given JAR file, if possible.

JARs build by Maven (most popular Java build system) contain
'pom.properties' file. We can extract Maven coordinates
 from there.
z*META-INF/maven/[^/]+/[^/]+/pom.properties$Ns   #s   =Zutf8z)Could not extract Maven coordinates from r   )r   r   reZcompiler   ZmatchZlenopenZ	readlinesZstripZ
startswithr   ZdecodeZ
ValueErrorr    r!   )r   r   Zpropsr"   ZrgxZxZresultZprops_fZlineZkeyZvaluer#   s   &&          r   r   ZJars.get_maven_ide   s    	**djj!MN%)]]_E_		!!!_Ev;!#	 +*
 YYvay))W ' 1 1 3#zz|#t44,/3zz$/?&)jj&8&>&>&@(-V(<(B(B(D-2c
 !4 * +( % F $. ,'+ * +*, *) +*( 	  	NN;H:RuM  		s   F# )FE(E.FF#  F+8E<	)AE
>E<	F
F# FE9$E<	&F.F# 8E99E<	<FFF 	F#  F# #G.GGc                s   Rp \        VRR7      ;_uu_ 4       p\        P                  ! 4       p\        \	        VP
                  R4      R4       F  pVP                  V4       K  	  RRR4       XP                  4       pV#   + '       g   i     L"; i  \         d#   pT P                  RT RT 24        Rp?T# Rp?ii ; i)	z8Compute JAR id.

Returns sha1 hash of a given JAR file.
r   Zrb)Zmodei   r   NzCould not compute JAR id for r   )
r%   hashlibr   Ziterr    ZreadZupdateZ	hexdigestr    r!   )r   r   r   r"   ZdigestZbufr#   s   &&     r   r   ZJars.get_jar_id   s    
 	NhT**d 		4 8#>CMM#& ? + %%'F  +*
  	NNN:8*BseLMM	Ns/   B AB'B B	B CB<<C N)Zjava)z/usr/share/javaz/usr/lib/java)z/optz
/usr/localz/var/lib)Z__name__Z
__module__Z__qualname__Z__firstlineno__Z
short_descZplugin_nameZprofilesr   ZstrZoption_listr   r   r   r   r   r   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r      sh     DJKH$b3E	G'-	/KM!IF"> r   r   )r&   r   r   r$   r   Z	functoolsr    Zsos.report.pluginsr   r   r   r   r'   r   r   <module>r(      s/      	 	   > >~6< ~r   