Sh3ll
OdayForums


Server : Apache
System : Linux server1.cgrithy.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64
User : nobody ( 99)
PHP Version : 8.1.23
Disable Function : NONE
Directory :  /usr/share/java-utils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/java-utils/maven_depmap.pyc
�
#
yRc	@sqddlmZddlZddlZddlZddlZddlmZddlZddl	Z	ddl
mZmZddl
Z
ddlmZmZddlmZmZmZmZddlmZmZdd<d	��YZd
efd��YZdefd
��YZdefd��YZdefd��YZd�Zddd�Z!d�Z"dd�Z#dd�Z$ddd�Z%d�Z&d�Z'd�Z(d�Z)e*dkrmdZ+ed e+�Z,e,j-d!d"d#d$d%d&�e,j-d'd(d#d$d%d)�e,j-d*d+d#d$d%d,d-d�e,j-d.d/d#d$d%d0d-d1�e,j.d2d�e,j/�\Z0Z1e0j2Z3e0j4Z5e0j6Z6e0j7Z7e8e1�d3kr�e,j9d4�ne1d5j:�Z;e1d6j:�Z<dZ=e8e1�d7kr�e1d3j:�Z=dZ>dZ?d8e<kr�e<j@d1�dZAejBeA�ZCeCjDdkrQdeC_DneCjEsje,j9d9�ne#eCe7e=�Z>eeCe>�Z?ne$e<e7e=�Z?e?r�e)e=e?�q�ne$e<e7�Z?e;GHe?rLe%e?e3e6�ZFe'e;e?eFe5�e5r'd:e?jGjEe5fZ5e"e5e<e=�qjd8e<kr;e<GHne=rje=GHqjqme,j9d;e<�ejHd6�ndS(=i����(tOptionParserN(tStringIO(tbasenametdirname(tgmtimetstrftime(t
SubElementtElementtElementTreet	XMLParser(tPOMtArtifacttFragmentcBs eZdZd�Zd�ZRS(s-simple structure to hold fragment informationcCs||_||_dS(N(tupstream_artifacttlocal_artifact(tselfR
R((s%/usr/share/java-utils/maven_depmap.pyt__init__:s	cCs|j|S(N(t__dict__(Rtindex((s%/usr/share/java-utils/maven_depmap.pyt__getitem__>s(t__name__t
__module__t__doc__RR(((s%/usr/share/java-utils/maven_depmap.pyR8s	tPackagingTypeMissingFilecBseZd�ZRS(cCsd|f|_dS(NsMPackaging type is not 'pom' and no artifact path has been provided for POM %s(targs(Rtpom_path((s%/usr/share/java-utils/maven_depmap.pyRCs(RRR(((s%/usr/share/java-utils/maven_depmap.pyRBstIncompatibleFilenamescBseZd�ZRS(cCsd||ff|_dS(NsnFilenames of POM %s and JAR %s does not match properly. Check that JAR subdirectories matches '.' in pom name.(R(RRtjar_path((s%/usr/share/java-utils/maven_depmap.pyRGs(RRR(((s%/usr/share/java-utils/maven_depmap.pyRFstMissingJarFilecBseZd�ZRS(cCs
d|_dS(NsPJAR seems to be missing in standard directories. Make sure you have installed it(sPJAR seems to be missing in standard directories. Make sure you have installed it(R(R((s%/usr/share/java-utils/maven_depmap.pyRKs(RRR(((s%/usr/share/java-utils/maven_depmap.pyRJstUnknownFileExtensioncBseZd�ZRS(cCsd|f|_dS(NsUnknown file extension: %s(R(RR((s%/usr/share/java-utils/maven_depmap.pyROs(RRR(((s%/usr/share/java-utils/maven_depmap.pyRNscCs�gddddgD]}tjj||�^q}d}xE|D]=}||krAtjd|�}tj|d|�}qAqAW|s�t��n|S(Ns
share/javasshare/java-jnislib/javas
lib64/javas.*%s/t(tostpathtjointNonetretcompiletsubR(Rtprefixtparttjavadirstjarparttjdirt
javadir_re((s%/usr/share/java-utils/maven_depmap.pyt_get_javadir_partRs(
tjarc	Cs�t|�}|r.tjj|�s3td��nt||�}|ddkr�d|krpt||��ndt|�}t|t|�d �}|d|d|fks+t||��q+q�d|kr�t||��nd	}t|t|�d �}|d
|ks�t||��q�nl|ddkr�t	j
d|�}d|jd�}t	j
d|�}|jd�}nd	}|dd
!}||fS(s.Get resolved (groupId,artifactId) tuple from POM and JAR path.

    POM name and JAR name have to be compatible.
    JPP.xbean-xbean-main.pom means groupId is "JPP/xbean" and artifactId
    is "xbean-main". Therefore for JAR name to be compatible it has be
    in %{_javadir}/xbean/xbean-main.jar.
    sJAR path doesn't existit.t/sJPP/%sis
JPP.%s-%s.pomitJPPs
JPP-%s.pomsJPP\.([^-]*?)-.*sJPP\.[^-]*?-(.*)\.pomi����(RRR tisfiletIOErrorR,RRtlenR#tmatchtgroup(	RR&Rt	extensiontpomnameR)tjpp_gidtjpp_aidR4((s%/usr/share/java-utils/maven_depmap.pyt_get_jpp_from_filenamebs4
c
Cs�tt|jd���}|}|}d|kr�tjj|�\}}t}xst|�D]e}d|||f}	|s�tj	tjj
|�|	�t}|	}ntjt
|�|	�|	GHq^Wtj|�n|r�tjj|�\}}t}xst|�D]e}d|||f}	|sRtj	tjj
|�|	�t}|	}ntjt
|�|	�|	GHqWtj|�ndS(sMake pom and jar file versionedt,t:s%s-%s%sN(tlisttsettsplitRR tsplitexttFalsetsortedtshutiltcopytrealpathtTruetsymlinkRtremove(
tversionsRRt	vpom_patht	vjar_pathtroottextRGtvertdest((s%/usr/share/java-utils/maven_depmap.pyt_make_files_versioned�s6				cCsO|s(td|j|j|j|j�St||�}d}d|krddjdt|��}n|j}|s|d}n|jdjd|��s�t	t
|�|��nt|�jdjd|�d�}|}|jr0||j
d	� }||j
d	�d
|jkr0t	t
|�|��q0nt|||j|j|j�S(NR0R/s	JPP/{gid}tgidR-s.{ext}RMRt-i(Rt
artifactIdR6t
classifiertversionR,tformatRtendswithRtstrRtreplacetrfind(R
R&RR)t	local_gidRMtfnamet	local_aid((s%/usr/share/java-utils/maven_depmap.pytget_local_artifact�s.
				 cCs�t|�}d}|sI|js1|jdkr@tt��nd}n"tjjt�\}}|d}t||||�\}}|dkr�d}nt	|j
|jd|d|j�}	t	|||�}
t
|	|
�S(s5Returns Fragment class or None if POM file is invalidRtpomiR-R6RU(R
t	packagingRRRR R@RR:RtgroupIdRSRUR(tpom_fileR&tjar_fileR_R6R\RMR8R9R
R((s%/usr/share/java-utils/maven_depmap.pyt	parse_pom�s	
	$RcCs�||j_||j_|g}|r�|jd�}xN|D]C}tj|�}tj||j�}|jt||j��q=Wn|S(NR;(	R
t	namespaceRR?Rtfrom_mvn_strtmerge_artifactstappendR(tfragmentt	additionsRetmapstaddstaddtmparttfull((s%/usr/share/java-utils/maven_depmap.pytcreate_mappings�s	
 cCs]t�}t�}|j|�|j|dtdddd�tjjj|j	��j
�S(Ntxml_declarationtencodingsutf-8tmethodtxml(RRt_setroottwriteRFRttdomtminidomtparseStringtgetvaluettoprettyxml(telemtxmlbuftet((s%/usr/share/java-utils/maven_depmap.pytprettify_element�s		
cCs�d
}y1t�}tdt�}|j|d|�}Wntk
rVtd�}nX|sit�}nt|jd��}|s�|dkr�t	|d�n|j
|jj�t
|�}x�t|�D]�}x�|D]�}t	|d�}	|s|dkr||j_nd|j_|jjdd	�}
|jjdd
�}|	j|
�|	j|�q�Wq�Wt|�}tj|dd��}
|
j|�Wd
QXd
S(sPWrites fragment into fragment_path in specialised format
    compatible with jpptremove_blank_texttparsert
dependencyMapR;RtskipProvidest
dependencyRLtmaventjpptwsutf-8N(R"RR	RFtparseR2RR>R?RRmR
RUR=RBRtget_xml_elementRhRtcodecstopenRv(t
fragment_pathRitmappingstadd_versionsRLR~R�RIRNtdeptmvn_xmlt	local_xmltxmlstrtfout((s%/usr/share/java-utils/maven_depmap.pytoutput_fragments6	


cCs�tj|d�}z�||j�kr�tjj|�}xatr�|sLPn|tjj}||j�kr�|j|d�ntjj	|�\}}q<W|j||�nWd|j
�XdS(NtaR(tzipfiletZipFiletnamelistRR RRFtseptwritestrR?tclose(tarchive_namet	file_namet
file_contentstarchiveR tsubdirttail((s%/usr/share/java-utils/maven_depmap.pytappend_if_missing.s	cCs�djd|j�}tdt��}djd|d|�}|j}|jrm|djd|j�}n|jr�|djd	|j�}nt|||�dS(
Ns8META-INF/maven/{f.groupId}/{f.artifactId}/pom.propertiestfs%a %b %d %H:%M:%S UTC %Ys�#Generated by Java Packages Tools
#{timestamp}
version={f.upstream_artifact.version}
groupId={f.upstream_artifact.groupId}
artifactId={f.upstream_artifact.artifactId}
t	timestampsextension={ext}
RMsclassifier={clas}
tclas(RVR
RRR6RTR�(RRit
props_pathR�t
propertiestartifact((s%/usr/share/java-utils/maven_depmap.pytinject_pom_properties@s				t__main__sCusage: %prog [options] fragment_path pom_path|<MVN spec> [jar_path]tusages-as--appendttypeRXthelps8Additional depmaps to add (gid:aid)  [default: %default]s-rs
--versionss*Additional versions to add for each depmaps-ns--namespaces(Namespace to use for generated fragmentstdefaults-ps--prefixs3Prefix where artifacts are expected to be installedR/RhisIncorrect number of argumentsiiiR<s*Artifact definition has to include versions%s,%ss�Problem parsing POM file. Is it valid maven POM? Send bugreport         to https://fedorahosted.org/javapackages/ and attach %s to         this bugreport((ItoptparseRtsysRR#RCRtxml.dom.minidomRtR�tos.pathRRR�ttimeRRt
lxml.etreeRRRR	tjavapackagesR
RRt	ExceptionRRRRR,R"R:RPR^RdRpRR�R�R�RR�R�t
add_optiontset_defaultst
parse_argstoptionsRRhtappend_depsRIR�ReR&R3terrortstripR�RRtlocalRitrsplittpom_strRftupstreamR6RUR�R
texit(((s%/usr/share/java-utils/maven_depmap.pyt<module>&s�"
	)	) 	
	*		

					

ZeroDay Forums Mini