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    cCsztj|}t|tjs't|j}t|dksHt|d}t|tjsjtt|j gS(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. ii( tasttparset isinstancetModuletAssertionErrortbodytlentExprt 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]\}}t|tjs^t|j }||krt d|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(RhRiR,RRtretsub(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}nB|tkr6t}d}n'|tkrQt}d}n ts]tt|}t |rt |S||kr|St |j |}|s|S|}|j x2|D]*} | j} tjtjd| d| dk} | d} d| dk} | jd }| jd }t||\}}||}|||!}||d }|d }|||!}| rtjj|}t||t||||}nt||||}|j}d | dko||k}| s | r>tjj|}|d kr>| r>d}q>n| rt|t kr_|}n|jd }|d}tjj |rt!d|nt"stjj#||}nltjj |rt"d}tj$j%||}n|}t"d}tjj#|||}tj$j&|tj$j%||}tj$j'|}x#|d D]}|j(d|qYW|j)n| rt*} | drt+|}t} nt||f}!t,j-|!d}"|"dkrtjtjd||d }| dkrtj.}#|r)tj/|nzvt0j|}$yt1|$d}%Wn-t2k r~}&t!d|$d|&fnXt|%j3|$d j4}Wdtj/|#X|dkstn| rt!d| |fnt5|}y:t6j7|d| dt6j8dt6j8dt6j8d|}'Wn,t9k rX}&t!d|&||fnX|'j:d \}(})|'j;dks|)rt<j=j(|)t!d||'j>|fn|(j4}|t,|!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(IRtearly_variable_ret PHASE_LATEtlate_variable_retPHASE_LATELATEtlatelate_variable_reRR=RRtintRRtfinditertreverset groupdictRqRtDEBUG_VARIABLESRtendRRRtProcessListFiltersInDicttExpandVariableststripReRfRR2R,tsplittisabsRtgenerator_filelist_pathsRQRrRtEnsureDirExistst WriteOnDiffRRRRmtcached_command_resultsR4Rltchdirtshlext __import__t ImportErrortDoMaintrstripRt subprocesstPopentPIPERpt communicateRRhRt returncodeR;tbytestdecodet __class__Rt#ProcessVariablesAndConditionsInListtEncodePOSIXShellListR3trangeR?(.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_listRfR trel_build_file_dirR tftit use_shellt cache_keyt cached_valuetoldwdtparsed_contentst py_moduleR{tptp_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.pyR sT                                      #              )  "          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 listiR is must be at least length 2, not is.{} {} must be followed by a dictionary, not {}is&{} {} has {} unexpected trailing itemsN( R,RRRR?RR2RZtformattEvalSingleCondition( Rtconditions_keyR:R-R;RRRt 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|RmRcs9%s while evaluating condition '%s' in %s at character %d.is%while evaluating condition '%s' in %sN(R R,RRt ValueErrorR5Rtcached_conditions_aststcompileRmR2RnRttexttoffsetRotlinenot NameErrorRqRrRsR( RaRbRcR:R-R;tcond_expr_expandedtast_codeR{t 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}n1|tkr*d}n|tkr:dStsFt||krVdS||}||=x[|D]S}t|||||}|dkrnt||||t||||qnqnWdS(NRttarget_conditions( RRRRR=RdR2RR(tthe_dictR:R-R;R`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( RRRRRRRRRRR(Rt flat_listtin_degree_zerosRWtnode_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(RWRfR_(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(R2R?R4R(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 (RRR2RqRrRR4RRR3RRR?RMRRRQR(Rtdependency_nodesRtspect root_nodet target_nodeRRRtdependency_nodeRtcyclestcycleRWtpaths((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 (RqRrRRRR4RRsRR3RR2RNR?RRRRQR(RRRR;Rtbuild_file_nodettarget_dependenciesRRR{RRRt file_nodeRRRWR((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 (RqRrRRRRRR( R[RRRRRR;RRRR((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_reRAReRfR~RQRqRrRRR(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 startswithRRZRRRt MergeListsRVR5RR3RtremoveR( 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(R4R2RRQ(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 R s<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( R4R2ReRftsplitexttbasenameRR3RR?RQRR( RRR;tduplicate_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,RZRRRR(RRR;R)R&RR9R:((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( RRR;R)RRR<R 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|R?(RR-RvRRRxtcircular_checkR'tparallelRBR/RuR7R;R{RR)Rttmp_dictRRR[RRt settings_typeRtgii((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pytLoad s                                     (ht __future__RR9t gyp.commonRqtgyp.simple_copyRtoptparsetos.pathReRR)RR.RhRttimeRRRRRRPRRRRRRRRRRRR2R$R5RGRAR|RtRRRRRpRtobjectRRRRRRRgRRRR'RRRRR RfRdR_RsRtRyRR6RRRRRRRRRRRRRRRRRRRR RRR$R+R8R;R>R?R@RIRNRR[(((sg/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/input.pyts                      !   8 ' % s -0 4        G # $ .   o "  ' E    2 ;  N H c  P    :    #