Rac@sNddlmZddlZddlZddlZddlZddlZddlZ ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlmZddlmZddddgZd d gZd d d ddddgZeaiZiZdZddddd dddddddddddd d!d"d#d$d%gZgadd&dd d'dd(ddd!d$g Zea e!a"e!d)Z#d*Z$d+Z%d,Z&d-Z'd.Z(d/Z)d0Z*d1Z+d2e,fd3YZ-d4e.fd5YZ/d6Z0ed7Z1id8d96d:d;6d<d=6Z2d>Z3d?Z4e j5d@Z6e j5dAZ7e j5dBZ8iZ9dCZ:dDZ;dEZ<dFZ=dGZ>iZ?dHZ@dIZAdJZBdKZCdLZDe!dMZEdNZFdOZGdPZHdQZIdRZJdSZKdTZLdUZMdVZNdWe.fdXYZOdYZPdZZQd[ZRd\ZSe j5d]ZTd^ZUeeVd_ZWd`ZXdaZYdbZZdcZ[ddZ\deZ]dfZ^dgZ_dhZ`diZadjZbdkZcdlZddmZednZfdoZgdS(pi(tprint_functionN(tGypError(t OrderedSett executabletshared_librarytloadable_moduletmac_kernel_extensiont dependenciestexport_dependent_settingst destinationtfilest include_dirstinputst librariestoutputstsourcescCsx$|r&|ddkr&|d }qW|tkr7tSd|kr|d}|ddkrj|d }n|dd kr~tS|d d kStS( Nis=+?!t_itsit_filet_pathit_dir(RR(t path_sectionstTruetFalse(tsectionttail((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pyt IsPathSection9s    tactionstconfigurationstcopiestdefault_configurationtdependencies_originalt postbuildst product_dirtproduct_extensiont product_nametproduct_prefixtrulestrun_aststandalone_static_librarytsuppress_wildcardt target_namettoolsetttoolsetsttypet variablestall_dependent_settingstdirect_dependent_settingst link_settingscCsg|dkrg}n||kr%|S|j|x.||jdgD]}t|||qIW|S(sReturn a list of all build files included into build_file_path. The returned list will contain build_file_path as well as all other files that it included, either directly or indirectly. Note that the list may contain files that were included into a conditional section that evaluated to false and was not merged into build_file_path's dict. aux_data is a dict containing a key for each build file or included build file. Those keys provide access to dicts whose "included" keys contain lists of all other files included by the build file. included should be left at its default None value by external callers. It is used for recursion. The returned list will not contain any duplicate entries. Each build file in the list will be relative to the current directory. tincludedN(tNonetappendtgettGetIncludedBuildFiles(tbuild_file_pathtaux_dataR1tincluded_build_file((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pyR5s    cCs2tj|}|j}|d}t|jgS(sReturn the eval of a gyp file. The gyp file is restricted to dictionaries and lists only, and repeated keys are not allowed. Note that this is slower than eval() is. i(tasttparsetbodyt CheckNodetvalue(t file_contentst syntax_treetc1tc2((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pyt CheckedEvals   c Cst|tjr|j}i}xt|j|jD]\}}|j}||krtd|dt t |dddj |dnt |}|j |t||||(?P<(?:(?:!?@?)|\|)?)(?P[-a-zA-Z0-9_.]+)?\((?P\s*\[?)(?P.*?)(\]?)\))sy(?P(?P>(?:(?:!?@?)|\|)?)(?P[-a-zA-Z0-9_.]+)?\((?P\s*\[?)(?P.*?)(\]?)\))s|(?P(?P[\^](?:(?:!?@?)|\|)?)(?P[-a-zA-Z0-9_.]+)?\((?P\s*\[?)(?P.*?)(\]?)\))cCsdtjdkr`t|tkrHtjdd|dg|d}q`tjdd|}n|S(Ntwin32s^cat stype ii(ReRfR,RNtretsub(tcmd((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pytFixupPlatformCommands 'iiic. Cs |tkrt}d}n6|tkr6t}d}n|tkrQt}d}nt|}t|rst|S||kr|St |j |}|s|S|}|j x |D]} | j } t jt jd| d| dk} | d} d| dk} | jd }| jd }t||\}}||}|||!}||d }|d }|||!}| rt jj|}t||t||||}nt||||}|j}d | dko||k}| s| r2tjj|}|d kr2| r2d}q2n| rut|t krS|}n|jd }|d}tjj|rtd|nt stjj!||}nltjj|rt d}t j"j#||}n|}t d}tjj!|||}t j"j$|t j"j#||}t j"j%|}x#|d D]}|j&d|qMW|j'n| rt(} | drt)|}t*} nt||f}!t+j,|!d}"|"dkrt jt jd||d }| dkrtj-}#|rtj.|nzvt/j|}$yt0|$d}%Wn-t1k rr}&td|$d|&fnXt|%j2|$d j3}Wdtj.|#Xn| rtd| |fnt4|}y:t5j6|d| dt5j7dt5j7dt5j7d|}'Wn,t8k r:}&td|&||fnX|'j9d \}(})|'j:dksh|)rt;j<j&|)td||'j=|fn|(j3}|t+|!|t?rMt>|t rM|j@d$}nt|t krx|D]}*t>|*t?rt>|*t r|*j@d$}*n|d d!k rft|*ttfkrftd%|d&d'|*jAjBqfqfWtC||||n=t|ttfkrBtd%|d&d(|jAjBn|r|t|t krd|}qt/jt|}nOd }+t|t krt j"jD|}+n|}+|| t|+||}|}qW||krt jt jd)|nt jt jd*|t|t kr}|rAt|dt krAqg},x*|D]"}*|,jEt|*|||qNW|,}nt||||}t|t krxbtFdtG|D]-}-t||-rt||-||-t^s Matches: %rt!R,tcommand_stringt|Rit@Rt is(| cannot handle absolute paths, got "%s"ttopleveltqualified_out_dirs%s tis_arrays(Executing command '%s' in directory '%s't pymod_do_mains,Error importing pymod_do_mainmodule (%s): %ss$Unknown command string '%s' in '%s'.tshelltstdoutRtstdintcwds%%s while executing command '%s' in %ss1Call to '%s' returned exit status %d while in %s.s2Had cache value for command '%s' in directory '%s'iRsUndefined variable s in sutf-8s Variable s- must expand to a string or list of strings; slist contains a sfound a s?Found only identity matches on %r, avoiding infinite recursion.sFound output %r, recursing.(RR(HRtearly_variable_ret PHASE_LATEtlate_variable_retPHASE_LATELATEtlatelate_variable_reRRtintRNtfinditertreverset groupdictRnR}tDEBUG_VARIABLESRtendRRRtProcessListFiltersInDicttExpandVariableststripRbRcR|R2R,tsplittisabsRtgenerator_filelist_pathsRMRoRtEnsureDirExistst WriteOnDiffRRRRjRtcached_command_resultsR4Ritchdirtshlext __import__t ImportErrortDoMaintrstripRt subprocesstPopentPIPERmt communicateRReRt returncodeREtbytestdecodet __class__Rt#ProcessVariablesAndConditionsInListtEncodePOSIXShellListR3trangeRL(.tinputtphaseR-t build_filet variable_retexpansion_symbolRtmatchestoutputt match_grouptmatcht run_commandRt file_listt replace_startt replace_endtc_starttc_endt replacementtcontents_startt contents_endtcontentstprocessed_variablestexpand_to_listtbuild_file_dirt contents_listRcR trel_build_file_dirR tftit use_shellt cache_keyt cached_valuetoldwdtparsed_contentst py_moduleRxtptp_stdouttp_stderrRtencoded_replacementt new_outputR[((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pyRsR                                     #              )  "          c Cst|tk r%t|dnt|dkrft|d|ddtt|nd}d }x#|t|kr||}||d}t|tk rtdj||t|nt||dkrZt||dtkrZ||d} |d}|t|krjtd j||t||qjnd } |d}|d krut||| |||}ququW|S( s]Returns the dict that should be used or None if the result was that nothing should be used.s must be a listiRis must be at least length 2, not is.{} {} must be followed by a dictionary, not {}is&{} {} has {} unexpected trailing itemsN( R,RNRRLRR2RWtformattEvalSingleCondition( Rtconditions_keyR7R-R8RORt cond_exprt true_dictt false_dict((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pyt EvalCondition s2,  0  "  c CsFt||||}t|ttfkrJtdd|jjnyZ|tkrft|}nt|dd}|t|RjR`s9%s while evaluating condition '%s' in %s at character %d.is%while evaluating condition '%s' in %sN(RR,RRt ValueErrorR2Rtcached_conditions_aststcompileRjR2RkRttexttoffsetRltlinenot NameErrorRnRoRpR( R^R_R`R7R-R8tcond_expr_expandedtast_codeRxt syntax_error((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pyR\0s,     # cCs|tkrd}n%|tkr*d}n|tkr:dS||krJdS||}||=x[|D]S}t|||||}|dkrbt||||t||||qbqbWdS(NRttarget_conditions(RRRRaR2RR(tthe_dictR7R-R8R]tconditions_listRt merge_dict((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pytProcessConditionsInDictTs"            cCsMxF|jD]8\}}t|tttfkr ||d|(R(R((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pyt__repr__scCst}t|j}x|r|j}|j|jxZ|jD]O}t}x*|jD]}|j|kr^t}Pq^q^W|rH|j|qHqHWqWt |S(N( RRRRRRRRRRN(Rt flat_listtin_degree_zerosRTtnode_dependenttis_in_degree_zerotnode_dependent_dependency((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pyt FlattenToLists   csEgtfdj|||gS(sR Returns a list of cycles in the graph, where each cycle is its own list. cs|xu|jD]j}||krDj|g||j|d q |kr j|||g|q q WdS(Ni(RR3R[R(RTRcR\(tVisittresultstvisited(sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pyR7s  (  (RR(R((RRRsg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pyt FindCycles0s   cCs^|dkrg}nxB|jD]7}|jdkr|j|kr|j|jqqW|S(s+Returns a list of just direct dependencies.N(R2RRR3(RRR((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pytDirectDependenciesDs   cCs|dkrg}nd}x|t|kr||}||}d}xG|jdgD]3}||kr]|j||||d}q]q]W|d}qW|S(s^Given a list of direct dependencies, adds indirect dependencies that other dependencies have declared to export their settings. This method does not operate on self. Rather, it operates on the list of dependencies in the |dependencies| argument. For each dependency in that list, if any declares that it exports the settings of one of its own dependencies, those dependencies whose settings are "passed through" are added to the list. As new items are added to the list, they too will be processed, so it is possible to import settings through multiple levels of dependencies. This method is not terribly useful on its own, it depends on being "primed" with a list of direct dependencies such as one provided by DirectDependencies. DirectAndImportedDependencies is intended to be the public entry point. iiRN(R2RLR4R(RRRR[Rtdependency_dictt add_indextimported_dependency((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pyt_AddImportedDependenciesPs     cCs|j|}|j||S(sReturns a list of a target's direct dependencies and all indirect dependencies that a dependency has advertised settings should be exported through the dependency for. (RR(RRR((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pytDirectAndImportedDependenciesyscCst|dkrt}nxU|jD]J}|jdkr=q"n|j|kr"|j||j|jq"q"W|S(sEReturns an OrderedSet of all of a target's dependencies, recursively.N(R2RRRtDeepDependenciesR(RRR((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pyRs   cCs{|d krt}n|jd kr+|Sd||jkrMtdnd||jkr~td||jdn||jd}|tk}|r| r|S|dkr||jjdt r|j|j|S| r|d kr|S| r|d kr| r|S|j|krw|j|j|sG| rwx*|jD]}|j |||t qQWqwn|S( suReturns an OrderedSet of dependency targets that are linked into this target. This function has a split personality, depending on the setting of |initial|. Outside callers should always leave |initial| at its default setting. When adding a target to the list of dependencies, this function will recurse into itself with |initial| set to False, to collect dependencies that are linked into the linkable target for which the list is being built. If |include_shared_libraries| is False, the resulting dependencies will not include shared_library targets that are linked into this target. R)s&Missing 'target_name' field in target.R,s!Missing 'type' field in target %sRtdependencies_traverseRRRRN(RRR( R2RRRtlinkable_typesR4RRRt_LinkDependenciesInternalR(RRtinclude_shared_librariesRtinitialt target_typet is_linkableR((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pyRs>         cCs)||jjdt}|j||S(si Returns a list of dependency targets whose link_settings should be merged into this target. t(allow_sharedlib_linksettings_propagation(RR4RR(RRR((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pytDependenciesForLinkSettingss cCs|j|tS(sP Returns a list of dependency targets that are linked into this target. (RR(RR((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pytDependenciesToLinkAgainstsN(RRRRRRRRRR2RRRRRRRR(((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pyRs   -  ) U cCsi}x9|jD]+\}}||krt||| s%Cycles in dependency graph detected: s (RRR2RnRoR~R4RRR3RRRLRIRRRMR(Rtdependency_nodesRtspect root_nodet target_nodeRRRtdependency_nodeRtcyclestcycleRTtpaths((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pytBuildDependencyListsB        cCsi}x?|D]7}tjj|}||kr t|||}t |jdkro|jj | | j j |qoqoW| j} t | t |kr| j s|j d} | jj | | j j | ng}xJ| jD]<}g|D]}|j^q1}|j ddj|q$Wtjddj|ndS( NRs,while computing dependencies of .gyp file %ssDependency '%s' not foundis Cycle: %ss -> s/Cycles in .gyp file dependency graph detected: s (RnRoR~RRR4RRpRR3RR2RJRLRRRRMR(RRRR8Rtbuild_file_nodettarget_dependenciesRRRxRRRt file_nodeRRRTR((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pyt#VerifyNoGYPFileCircularDependencies0sR         c Csx|D]}||}tjj|}|dkrH||j}nT|dkrj||j|}n2|dkr||j|}ntd|xS|D]K}||} || krqntjj|} t|| ||| qWqWdS(NR.R/R0sCDoDependentSettings doesn't know how to determine dependencies for (RnRoR~RRRRR( RXRRRRRR8RRRR((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pytDoDependentSettingsks$          c Csx|D]}||}|d}|dkrd|kr?qn|jdg|d<||j|}d}x|t|kr||} || } | ddkr| jdt s| ddkr| |dkr||=qr|d}qrWt|dkr||d^]cCs||kstj|r|Stjjtjjtjjtjj |tjj ||j dd}|ddkr|d7}n|SdS(Ns\Ri( t exception_reR>RbRcR{RMRnRoRR|R(tto_filetfro_fileRtret((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pytMakePathRelatives c sdfd}d}tfd|D}x|D]} t} t| ttfkr|rt||| } n| } t| tko| jds%t} q%nrt| tkri} t | | ||nDt| t krg} t | | ||nt d| j j|rt| sE|| || r|j| | rq|j| qqqqAx#| r| |kr|j| qwW|j|| | r|j| n|d}qAWdS(NcSs|jS(N(t__hash__(tval((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pytRcs |r||kS||kS(N((txRR(t is_hashable(sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pytis_in_set_or_lists  ic3s!|]}|r|VqdS(N((t.0R(R(sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pys sRs/Attempt to merge list item of unsupported type i(RRR,RRRt startswithRRWRRNt MergeListsRSR2RR3RtremoveR( ttotfroRRtis_pathsR3Rt prepend_indexthashable_to_setRt singletontto_item((Rsg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pyRs@  !    cCs=x6|jD](\}}||krt}t|ttfkrkt||ttfkrt}qn%t|t||k rt}n|rtd|jjd||jjd|qnt|ttfkrt |}|rt |||||Target %s has an invalid target type '%s'. Must be one of %s.RR'is_Target %s has type %s but standalone_static_library flag is only valid for static_library type.N(RRRRRR(R4R2RRM(RRtVALID_TARGET_TYPESR((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pytValidateTargetType s   c Cs.|s dS|jdddkr&dS|jdg}i}xi|D]a}tjj|\}}|dk} | s{qEntjj|} |j| gj|qEWd } xL|jD]>\} } t | d kr| d| dj | f7} qqW| r*t d|| dt dndS(NR,RRs.cs.ccs.cpps.cxxs.ms.mms.ss.SRis %s: %s Rs<static library %s has several files with the same basename: s`libtool on Mac cannot handle that. Use --no-duplicate-basename-check to disable this validation.s6Duplicate basenames in sources section, see list above(s.cs.ccs.cpps.cxxs.ms.mms.ss.S( R4R2RbRctsplitexttbasenameRR3RRLRMRR( RRR8tduplicate_basename_checkRt basenamestsourceRRtis_compiled_fileR#RR ((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pytValidateSourcesInTarget s,  $cCsi}i}|jdg}x|D]}|d}||krZtd||fn|||<|d}|jdr|d}n||krtdd||||d|fn|||The 'run_as' in target %s from file %s should be a dictionary.RsEThe 'run_as' in target %s from file %s must have an 'action' section.sCThe 'action' for 'run_as' in target %s from file %s must be a list.tworking_directorysPThe 'working_directory' for 'run_as' in target %s in file %s should be a string.t environmentsNThe 'environment' for 'run_as' in target %s in file %s should be a dictionary.(R4R,RWRRNR(RRR8R)R&RR6R7((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pytValidateRunAsInTarget s,c Cs|jd}|jdg}x|D]}|jd}|sVtd|n|jdd }|d krtd|n|jd}|r(|d r(td |q(q(Wd S( s0Validates the inputs to the actions in a target.R)Rt action_namesKAnonymous action in target %s. An action must have an 'action_name' field.R s"Action in target %s has no inputs.Ris%Empty action as command in target %s.N(R4RR2( RRR8R)RRR9R taction_command((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pytValidateActionsInTarget> s   cCsx|jD]\}}t|tkrDt|}|||t|tkrct|nt|tkrt|nt|tkr ||=||t|s                      !   8 ' % s -0 4        G # $ .   o "  ' E    2 ;  N H c  P    :    #