PK APOCALYPSE V1

APOCALYPSE V1

Current Path : /opt/alt/alt-nodejs8/root/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/
Upload File :
Current File : //opt/alt/alt-nodejs8/root/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/win_tool.pyc

�
��Rac@s�dZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ej
jej
je
��Zejdej�Zd�Zdefd��YZedkr�e	jee	jd	��ndS(
suUtility functions for Windows builds.

These functions are executed via gyp-win-tool when using the ninja generator.
i����(tprint_functionNs/OUT:(?P<out>.+)$cCs8t�}|j|�}|dk	r4tj|�ndS(N(tWinTooltDispatchtNonetsystexit(targstexecutort	exit_code((sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pytmains	RcBs�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�ZRS(s�This class performs all the Windows tooling steps. The methods can either
  be executed directly, or dispatched from an argument list.cCs�t|�dkr!td��n|ddkr5dSd}xU|D]M}tj|�}|rBtjddd|jd	�tj	�f�}PqBqBW|dkr�dS||d
<dS(sWAllows to use a unique instance of mspdbsrv.exe per linker instead of a
    shared one.isNot enough argumentsislink.exeNs\W+ts%s_%dtoutt_MSPDBSRV_ENDPOINT_(
tlent	ExceptionRt_LINK_EXE_OUT_ARGtmatchtretsubtgrouptostgetpid(tselftenvRt
endpoint_nametargtm((sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pyt_UseSeparateMspdbsrv's
"cCsOt|�dkr!td��nd|j|d�}t||�|d�S(s(Dispatches a string command to a method.isNot enough argumentssExec%si(R
Rt_CommandifyNametgetattr(RRtmethod((sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pyRBscCs|j�jdd�S(s@Transforms a tool name like recursive-mirror to RecursiveMirror.t-R
(ttitletreplace(Rtname_string((sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pyRJscCsNt|�j�d jd�}g|D]}|jdd�^q&}t|�S(s@Gets the saved environment from a file for a given architecture.i����st=i(topentreadtsplittdict(Rtarchtpairstitemtkvs((sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pyt_GetEnvNs%cCst|d�j�dS(sSimple stamp command.twN(R$tclose(Rtpath((sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pyt	ExecStampWscCs�tjj|�r~tjj|�rCd�}tj|d|�q~tj|tj�sntj|t	j
�ntj|�ntjj|�r�tj||�ntj
||�dS(s)Emulation of rm -rf out && cp -af in out.cSs9tj|tj�s+tj|tj�n||�dS(N(RtaccesstW_OKtchmodtstattS_IWRITE(tfnR/texcinfo((sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pyt	_on_error_stonerrorN(RR/texiststisdirtshutiltrmtreeR1R2R3R4R5tunlinktcopytreetcopy2(RtsourcetdestR8((sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pytExecRecursiveMirror[s	c	
Gs�|j|�}|dkr.|j||�ntj|djdd�gt|d�dtd|dtjd	tj�}|j	�\}}xQ|j
�D]C}|jd
�r�|jd�r�|jd�r�t|�q�q�W|j
S(
s�Filter diagnostic output from link that looks like:
    '   Creating library ui.dll.lib and object ui.dll.exp'
    This happens when there are exports from the dll or exe.
    tTrueit/s\itshellRtstdouttstderrs   Creating library sGenerating codesFinished generating code(R,Rt
subprocesstPopenR!tlistRDtPIPEtSTDOUTtcommunicatet
splitlinest
startswithtprintt
returncode(	RR(tuse_separate_mspdbsrvRRtlinkRt_tline((sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pytExecLinkWrapperqs-	c	Gs�i	tjd6|d6|d6|d6|d6|d6|d6|d6d	j|	�d
6}
d}|	r�tjd|
�|d
kr�tjd|
�tjd|
�d|
}q�ntj||�|	r�tjd|
�d|
}d|
}
t|
d��U}t|d��=}|j�jdt	j
�}|j�jdt	j
�}WdQXWdQX||kr�tj|�d�}||�||
�||�tj
jd||
|f�dSndS(sZA wrapper for handling creating a manifest resource and then executing
    a link command.tpythonR(Rtldcmdtresnametmttrctintermediate_manifestt t	manifestsR
sn%(python)s gyp-win-tool manifest-wrapper %(arch)s %(mt)s -nologo -manifest %(manifests)s -out:%(out)s.manifestRDs`%(python)s gyp-win-tool manifest-to-rc %(arch)s %(out)s.manifest %(out)s.manifest.rc %(resname)ssF%(python)s gyp-win-tool rc-wrapper %(arch)s %(rc)s %(out)s.manifest.rcs %(out)s.manifest.ress�%(python)s gyp-win-tool manifest-wrapper %(arch)s %(mt)s -nologo -manifest %(out)s.manifest %(intermediate_manifest)s -out:%(out)s.assert.manifests%(out)s.assert.manifests%(out)s.manifesttrbNcSsJtjjd|�t|d��!}tjj|j�d�WdQXdS(Ns	%s
-----
R`s
-----
(RRHtwriteR$R%(tfilenametf((sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pytdump�ss�Linker generated manifest "%s" added to final manifest "%s" (result in "%s"). Were /MANIFEST switches used in #pragma statements? i(Rt
executabletjoinRIt
check_callR$R%t	translateRtstringt
whitespaceRR>RHRa(RR(tembed_manifestRRYRZR[R\R]R_t	variablest	add_to_ldtassert_manifesttour_manifesttour_ftassert_ftour_datatassert_dataRd((sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pytExecLinkWithManifests�sX


'
	


	c
Gs�|j|�}tj|dtd|dtjdtj�}|j�\}}x3|j�D]%}|r[d|kr[t|�q[q[W|j	S(s�Run manifest tool with environment set. Strip out undesirable warning
    (some XML blocks are recognized by the OS loader, but not the manifest
    tool).RFRRGRHs#manifest authoring warning 81010002(
R,RIRJRDRLRMRNRORQRR(RR(RRtpopenRRURV((sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pytExecManifestWrapper�sc
GsZ|\}}}t|d��6}|jd|tjj|�jdd�f�WdQXdS(s�Creates a resource file pointing a SxS assembly manifest.
    |args| is tuple containing path to resource file, path to manifest file
    and resource name which can be "1" (for executables) or "2" (for DLLs).twbs(#include <windows.h>
%s RT_MANIFEST "%s"s\REN(R$RaRR/tabspathR!(RR(Rt
manifest_patht
resource_patht
resource_nametoutput((sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pytExecManifestToRc�s
	c	s�ddgt|	�d|d|d|d|d|d||g
}
|j|�}tj|
d	td
|dtjdtj�}|j�\}
}|
j�}d�t	�fd�|D��}x7|D]/}|j
��r�||kr�t|�q�q�W|jS(sjFilter noisy filenames output from MIDL compile step that isn't
    quietable via command line flags.
    tmidls/nologos/outs/tlbs/hs/dlldatas/iids/proxyRFRRGRHsProcessing s64 bit Processing c3s0|]&}|j��rtjj|�VqdS(N(RPRR/tbasename(t.0tx(tprefixes(sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pys	<genexpr>s(sProcessing s64 bit Processing (
RKR,RIRJRDRLRMRNROtsetRPRQRR(RR(toutdirttlbthtdlldatatiidtproxytidltflagsRRRuRRUtlinest
processingRV((R�sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pytExecMidlWrapper�s(


c
Gs�|j|�}tj|dtd|dtjdtj�}|j�\}}xW|j�D]I}|jd�r[|jd�r[|jd�r[|r[t	|�q[q[W|j
S(s/Filter logo banner from invocations of asm.exe.RFRRGRHs#Copyright (C) Microsoft CorporationsMicrosoft (R) Macro Assemblers
 Assembling: (R,RIRJRDRLRMRNRORPRQRR(RR(RRRuRRURV((sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pytExecAsmWrappersc
Gs�|j|�}tj|dtd|dtjdtj�}|j�\}}xG|j�D]9}|jd�r[|jd�r[|r[t	|�q[q[W|j
S(sgFilter logo banner from invocations of rc.exe. Older versions of RC
    don't support the /nologo flag.RFRRGRHs+Microsoft (R) Windows (R) Resource Compilers#Copyright (C) Microsoft Corporation(R,RIRJRDRLRMRNRORPRQRR(RR(RRRuRRURV((sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pyt
ExecRcWrapperscGs�|j|�}x6tjj�D]%\}}||kr|||<qqWt|�j�}|rj|dnd}tj|dt	d|d|�S(s�Runs an action command line from a response file using the environment
    for |arch|. If |dir| is supplied, use that as the working directory.iRFRtcwdN(
R,RtenvirontitemsR$R%RRItcallRD(RR(trspfiletdirRtktvR((sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pytExecActionWrapper#scCstjj|t�}|jd�}g|D]}tjj||�d^q+}dg}|j|�tj|dt	dt�S(sfExecuted by msvs-ninja projects when the 'ClCompile' target is used to
    build selected C/C++ files.t;s^^s	ninja.exeRFR�(
RR/trelpathtBASE_DIRR&RftextendRIR�RD(Rtproject_dirtselected_filesRbt
ninja_targetstcmd((sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pyt
ExecClCompile0s)	
(t__name__t
__module__t__doc__RRRR,R0RCRWRtRvR}R�R�R�R�R�(((sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pyR#s 									L	
	
				
t__main__i(R�t
__future__RRRR<RIR4RiRR/tdirnameRxt__file__R�tcompilet
IGNORECASERR	tobjectRR�Rtargv(((sj/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/win_tool.pyt<module>
s	�

if you don't want to be vaporized in a nuclear explosion, i simply have to become nuclear myself… i am atomic