+
    G%@i                     f    ^ 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# )    N)partial)PluginRedHatPlugin	PluginOptc                   z   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)defaultval_typedescall-known-locationsFzscan all known paths)r   r   c                    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
   :pathsha1maven_id)indent
separatorsz	jars.jsonT)plug_dirN),: )listr   jar_locations
get_optionextra_jar_locationssplitoswalk	path_joinis_jarappendget_maven_id
get_jar_idjsondumpsadd_string_as_file)selfresults	jar_paths	locationsuser_locationslocationdirpath_	filenamesfilenamer   jar_pathr   jar_idrecordresults_strs   &               9/usr/lib/python3/dist-packages/sos/report/plugins/jars.pysetup
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                   \         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   isfilezipfile
is_zipfileZipFilenamelistIOError
BadZipfile	_log_info)r)   r   fileerrs   &&  r7   r"   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           	        / 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$N   #   =utf8z)Could not extract Maven coordinates from r   )r=   r?   recompiler@   matchlenopen	readlinesstrip
startswithr   decode
ValueErrorrA   rC   )r)   r3   propsrD   rgxxresultprops_flinekeyvaluerE   s   &&          r7   r$   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                   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   rb)modei   r:   NzCould not compute JAR id for r   )
rO   hashlibr   iterr   readupdate	hexdigestrA   rC   )r)   r3   r4   rD   digestbufrE   s   &&     r7   r%   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)java)z/usr/share/javaz/usr/lib/java)z/optz
/usr/localz/var/lib)__name__
__module____qualname____firstlineno__
short_descplugin_nameprofilesr   stroption_listr   r   r8   r"   r$   r%   __static_attributes____classdictcell__)__classdict__s   @r7   r   r      sh     DJKH$b3E	G'-	/KM!IF"> r:   r   )ra   r&   r   rK   r=   	functoolsr   sos.report.pluginsr   r   r   r   ri   r:   r7   <module>ry      s/      	 	   > >~6< ~r:   