;ò @Dc@sdkZdkZdkZdkZdkZdkZdkZdkZdklZdk l Z l Z l Z l Z dk lZdk lZlZlZdklZlZlZdklZlZlZdkTdklZlZdkZd kl Z l!Z!d kl"Z"l#Z#d k$l%Z%l&Z&d k'l'Z'dk(Td k)l*Z*l+Z+l,Z,l-Z-l.Z.dk)l/Z/dk)l)Z)dk0Te1dd„Z2d„Z3d„Z4d„Z5d„Z6d„Z7dd„Z8d„Z9dd„Z:d„Z;d„Z<d„Z=d„Z>d „Z?d!„Z@d"„ZAd#„ZBd$„ZCd%„ZDd&„ZEd'„ZFd(„ZGd)„ZHe1d*„ZIe1d+„ZJe1d,„ZKe1d-„ZLe1d.„ZMd/„ZNd0„ZOd1„ZPd2„ZQd3„ZRd4„ZSd5„ZTd6„ZUd7d8„ZVd9„ZWd:d7d;„ZXd<„ZYd=d>„ZZd?„Z[d@„Z\dA„Z]dB„Z^dC„Z_dD„Z`dE„ZadF„ZbdG„ZcdH„ZddI„ZedJ„ZfdK„ZgdL„ZhdM„ZidN„ZjhZkdO„ZldP„ZmdQ„ZndR„ZodS„ZpdT„ZqdU„ZrdV„ZsdW„ZtdX„ZudY„ZvdZ„Zwd[„Zxd\„Zyd]„Zzd^„Z{d_„Z|d`„Z}da„Z~db„Zdc„Z€dd„Zde„Z‚df„Zƒdg„Z„dh„Z…di„Z†dj„Z‡dk„Zˆdl„Z‰dm„ZŠdn„Z‹do„ZŒdp„Zdq„ZŽdr„Zds„Zdt„Z‘du„Z’dv„Z“dw„Z”dx„Z•dy„Z–dz„Z—d{„Z˜d|„Z™d}d~„Zšd„Z›d€„Zœd„Zd‚dƒ„Zžd„„ZŸd7a d…„Z¡dS(†N(sDepend(s str2dictlists get_attrdictslist2strs dictlist2str(s listitem2str(sdictlist_expandusers dict_expandsdictlist_expand(s read_recipes recipe_dirsdid_read_recipe(sdoargssadd_cmdline_settingsscopy_global_options(s*(sft_knowns ft_declare(sassert_var_namesassert_scope_name(s recipe_errors option_error(s rpdeepcopysrpcopy(sRule(sgetworkssetworks getrpstacksRoutes set_defaults(sassert_attribute(sWorkic CsÁt||ƒ}t|||ddƒ\} }h}|oHxE| i ƒD]3}|i |ƒo| ||||<| |=qGqGWnt |t||||t|tiƒƒƒ} || | fSdS(snParse command arguments. Always use A-A-P style expansion. When "options" is given, it must be a dictionary indexed by accepted options with the value of the option name. "exp_attr" can be set to 0 to avoid including attributes. Return a dictionary with options, a dictionary with leading attributes and a dictlist with arguments.iiN(s getrpstacksrecdictsline_nrsrpstacks get_attrdictsargsattrdictsis optiondictsoptionsskeysskshas_keys str2dictlistsexpandsExpandsexp_attrs quote_aapsvarlist( sline_nrsrecdictsargsoptionssexp_attrs optiondictsrpstacksisksvarlistsattrdict((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysget_args.s cCs1|o&t||ƒ}t|tdƒƒndS(s Do nothing. s:pass does not take an argumentN(sargs getrpstacksrecdictsline_nrsrpstacks recipe_errors_(sline_nrsrecdictsargsrpstack((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysaap_passIscCsdS(sp Do nothing with an argument. Used to mention variables that should be included in the buildcheck. N((sline_nrsrecdictsarg((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysaap_buildcheckRsc Csðt|ƒ} t||ƒ}t|t|||t dt i ƒƒƒ}t |ƒ}t |t|ddƒ\}} t|t|||| t dt i ƒƒƒ}t |ƒ}t|||| tt|ƒ|ƒ|ƒ} || _| i|| ƒdS(sAdd a dependency.iiN(sgetworksrecdictsworks getrpstacksline_nrsrpstacks str2dictlistsexpandstargetssExpands quote_aaps targetlistsdictlist_expands get_attrdictsNonessourcess build_attrsis sourcelistsDepends rpdeepcopyscommandssds buildrecdictsadd_dependency( sline_nrsrecdictstargetsssourcesscommandss sourcelists build_attrs targetlistsrpstacksdsiswork((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_dependZs $ (  cCsGt||ƒ}t|ƒ}|ot|tdƒƒn|i ƒdS(s(Generate a recipe for downloading files.s%:clearrules does not take an argumentN( s getrpstacksrecdictsline_nrsrpstacksgetworksworksargs recipe_errors_s clearrules(sline_nrsrecdictsargsrpstackswork((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysaap_clearruleszs  cCs t||||tddƒdS(sDelete a rule.scmds:delruleN(saap_rulesline_nrsrecdictstargetsssourcessNone(sline_nrsrecdictstargetsssources((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_delrule„ss:rulec Cs t|ƒ}t||ƒ} d}d}d} d}t | t |ddƒ\}} x|iƒD]õ}|djo|djp |djo d}q^|djo|djp |d jo2|djot| td ƒ|ƒn|}q^|djo |d jo d} q^|djo |d jo d}q^t| td ƒ||fƒq^Wt| t|||| tdtiƒƒƒ} t| ƒt | t |ddƒ\}} t| t|||| tdtiƒƒƒ} t| ƒd}xƒ|iD]x}t | |iƒot | |iƒoL|djo|i ot!|tdƒd| ƒn|i"|ƒd}qõqõW|djo1| o| ot!|tdƒd| ƒqnYt#| || t$t|ƒ|ƒ|ƒ}||_| |_||_||_'|i(|ƒdS(s Add a rule.snormalis:delrulesquietsqis:ruleslocalsglobalsextra option for :rule: "%s"s sourceexistssdefaultsunknown option for %s: "%s"sReplacing existing rulesrpstacks$Did not find matching rule to deleteN()sgetworksrecdictsworks getrpstacksline_nrsrpstacksscopesdefaults sourceexistssquiets get_attrdictsNonestargetsscmd_attrsiskeysskscmds recipe_errors_s str2dictlistsexpandsExpands quote_aaps targetlistsdictlist_expanduserssourcess build_attrs sourcelistsdid_onesrulessrsdictlist_sameentriess msg_warningsdel_rulesRules rpdeepcopyscommandssrules buildrecdictsadd_rule(sline_nrsrecdictstargetsssourcesscommandsscmdsdid_ones build_attrsscopes targetlistsrpstacks sourceexistss sourcelistsisksworksquietsrulesdefaultsrscmd_attr((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysaap_ruleˆs`  ' '    !( (  &       c Csct|ƒ}t||ƒ} d}t| t|ddƒ\}}xB|i ƒD]4}|djo d}qLt| tdƒ|ƒqLWt| t||||tdtiƒƒƒ}td„|ƒ}t|ƒdjot| tdƒƒndkl}ti|d ƒ} d }g}g}|d}xÊ| D]Â}t#|dƒ}|t|ƒjoš||d jo%|||ƒ} | o | }qîqòt%|ƒ}|d jo |}n||jo|d ||d ßsis':route: requires at least two filetypes(sget_line_markers iÿÿÿÿs#s*:route: found %d action lines, expected %dcCsti|dƒS(Ns,(sstringssplitsx(sx((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysss:unknown filetype "%s" in :route command; recipe %s line %ds+redefining existing route from "%s" to "%s"N(3sgetworksrecdictsworks getrpstacksline_nrsrpstacksdefaults get_attrdictsNonesargscmd_attrsiskeyssks recipe_errors_s str2dictlistsexpandsExpands quote_aapsarglistsmapstypelistslensProcesssget_line_markersstringssplits linestringsrawliness first_indentslinesslnumsslnumslines skip_whitesnrs get_indentsindsappendsilsft_knowns msg_warningsnamesin_typesout_types find_routesroutesRoutes rpdeepcopys add_route(sline_nrsrecdictsargs linestringslnumsilsindsarglistsget_line_markersrawlinessnrsrpstacksroutesout_typeslnumsslinesin_typesdefaultsksworkslinessis first_indentstypelistscmd_attr((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_routeÎsp    (       1:  #sprogramc Csýt||ƒ}t|ƒ}t|||ddƒ\}}t |t ||||t dt i ƒƒƒ}|}|}|djoWt|ƒdjot|tdƒƒn|dd}|i|dƒ|d}nd}x:tt|ƒƒD]&}||ddjo |}PqðqðW|djot|td ƒ|ƒn|d|!}|d jot|ƒ}nt|ƒdjot|td ƒ|ƒn||}||d}t|ƒ}t|ƒdjot|td ƒ|ƒnx1|iƒD]#}|djoqùn||}|id ƒp |idƒo¯|d}xÒ|D]–} | i"d|ƒoqNn| i"d |ƒoW|id ƒo|d| || |sisAttempt :update "%s"slevels:update "%s" successfuls:update "%s" faileds:update failed for "%s"sEnd of :update "%s"N(%sgetworksrecdictsworks getrpstacksline_nrsrpstacksDoBuilds target_updates updated_OKsget_argssargs optiondictsattrdicts argdictlists option_errorslens recipe_errors_sdictlist_expandsossgetcwdsadirsts msg_dependspathsisabssspsgetsmaps str2dictlistsdonesnamesjoinsget_nodestargets scope_recdictsgoto_dir(sline_nrsrecdictsargssps target_updatesattrdicts updated_OKsadirs optiondictsrpstackspathstargetsnamesworksts argdictlistsdone((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_update~sV  -      c Cs;t||ƒ}t|t|||tdtiƒƒƒdS(sHandle: ":error foo bar".iN( s getrpstacksrecdictsline_nrsrpstacks recipe_errorsexpandsargsExpands quote_aap(sline_nrsrecdictsargsrpstack((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_errorÀscCs*t||ƒ}t|tdƒ|ƒdS(sx Handle: ":xxx arg". Postponed until executing the line, so that an "@if _no.AAPVERSION > nr" can be used. sUnknown command: "%s"N(s getrpstacksrecdictsline_nrsrpstacks recipe_errors_sarg(sline_nrsrecdictsargsrpstack((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_unknownÆscCs*t||ƒ}t|tdƒ|ƒdS(s— Handle using a toplevel command in build commands. Postponed until executing the line, so that an "@if _no.AAPVERSION > nr" can be used. s!Command cannot be used here: "%s"N(s getrpstacksrecdictsline_nrsrpstacks recipe_errors_sarg(sline_nrsrecdictsargsrpstack((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_nothereÎsc Cst||ƒ}t}t} t}t|ƒ}d}d}x˜||joŠt ||ƒ\}}||jot|dƒoPn|djpt|dƒo&|djo|}d}nt ||ƒ\}}|ddjo|ot|tdƒƒnt|ƒ}d}d}d}|djoF|ddjod}d}qq|dd jod}d}qqn||joq|| } ||jot ||ƒ\}}n||jot|td ƒ| ƒnt ||ƒ\}}n ||}t|t|||tdtiƒƒƒ} d kl} | | ƒ\} } }| oft i t!ii"| ƒƒ}t|ƒdjo|d} n|djo| ot$|| ƒq¿n t%| ƒ} |djo ||jot ||ƒ\}}qÁqÏ|dd jo¬|ot|td ƒƒnt|ƒdjo|d||}nt&||ƒ}||}| ot|tdƒƒn|ddjot|tdƒƒnPqÏ|||}q<||}q<W|o|ot||||ƒ}n|}|| ||fSdS(s¶Get the redirection and pipe from the argument "raw_arg". Returns these items: 1. the argument with $VAR expanded and redirection removed 2. the file name for redirection or None 3. the mode for redirection or None ("a" for append, "w" for write). 4. a command following '|' or None When using ">file" also checks if the file doesn't exist yet. Use "xp" for expanding $var in the argument.iss>sredirection appears twiceiswsais!sMissing file name after %s(s url_split3s|sboth redirection and '|'sNothing follows '|'s:sMissing ':' after '|'N()s getrpstacksrecdictsline_nrsrpstacksNonesmodesfnamesnextcmdslensraw_args raw_arg_lensisnew_args get_tokenstsis_whitesnts recipe_errors_snt_lensnis overwritesredirsunquotesexpandsExpands quote_aapsRemotes url_split3sschemesmachinespathsglobsoss expandusersls check_existssexpand_unescapes skip_whitesxpsarg(sline_nrsrecdictsraw_argsxpsnextcmdsnew_argsargs overwritesnis url_split3sredirsmachinesfnamesschemesntstsrpstacks raw_arg_lenspathsisnt_lenslsmode((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys _get_redirÚsŽ               cCsot||ƒ}ti|tdƒ}t |ƒdjo|i dƒn|ddjot |||d|ƒnø|ddjot |||d|ƒnÌ|ddjot|||d|ƒn |ddjot|||d|ƒnt|ddjot|||d|ƒnH|dd jot|||d|ƒnt|td ƒ|dƒd S( s&Handle the command that follows a '|'.isis:assigns:cats:sysevals:evals:prints:teesInvalid command after '|': "%s"N(s getrpstacksrecdictsline_nrsrpstacksstringssplitscmdsNonesitemsslensappends _pipe_assignspipeinsaap_cats aap_sysevalsaap_evals aap_prints _pipe_tees recipe_errors_(sline_nrsrecdictscmdspipeinsrpstacksitems((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys _aap_pipeWs&cCsHt||ƒ}t||ƒt|||dƒ\}}}|||foo $bar".is:cat Ns5:cat command requires at least one file name argumentsnames-s(s url_split3(s tempfnamesCannot open "%s" for writingsUsing - not after a pipes isrsCannot open "%s" for readingsCannot read from "%s"sCannot write to "%s"iÿÿÿÿsError closing "%s"(sremote_copy_moveserrmsgsConcatenated files into "%s"(8s getrpstacksrecdictsline_nrsrpstacks _get_redirsraw_argsExpands quote_aapsargsfnamesmodesnextcmds skip_commandssmsg_skips str2dictlistsfilelistslenspipeinsNones recipe_errors_sresultsschemesRemotes url_split3s RecPythons tempfnamesmachinespathsffnamesopenswfsIOErrorsesstrsdictlist_expandsitemsfnslinessisstringsfindsnsappendsrfs readlinessclosesls writelinesslines msg_printsCopyMovesremote_copy_moves try_deletes _aap_pipesmsg_info(sline_nrsrecdictsraw_argspipeinsnextcmdsresultsargsffnamesremote_copy_moves url_split3s tempfnamesmachinesrfsfnsfnamesschemeswfsrpstackspathslinesesislinesslsfilelistsnsitemsmode((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysaap_catys¶ !    $        $&  c Cs7t||ƒ}t|||tƒ\}}} }|ot i |dƒdjot|tdƒƒn|tj o||d&1s > %ssexitsNs^\s*s\s*$(-s getrpstacksrecdictsline_nrsrpstacks get_attrdictsraw_argsattrdictsidxskeyssks recipe_errors_s _get_redirsExpands quote_aapsargsfnamesmodesnextcmdsNonestmpinstmpouts RecPythons tempfnamescmdspipeinsopensfswritesclosesIOErrorsesstrshas_keysosssystemsrfsreadsouts try_deletesressubs _write2files _aap_pipes msg_print(sline_nrsrecdictsraw_argspipeinsnextcmdsargsouts tempfnamestmpinsrfsfnamesattrdictsrpstackstmpoutsesidxsfskscmdsmode((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_syseval@s\  !   &   c Cst||ƒ}t|||tdtiƒƒ\}}} }t ||ƒ} t| ƒdjot|tdƒƒnx;| D]3} | d}t||ƒt||||dƒq|W| ot||||| ƒn)|ot||||ƒn t|ƒdS(s6Handle: ":tee fname ...". Can only be used in a pipe.is5:tee command requires at least one file name argumentsnameswN(s getrpstacksrecdictsline_nrsrpstacks _get_redirsraw_argsExpands quote_aapsargsfnamesmodesnextcmds str2dictlistsfilelistslens recipe_errors_sfsfns check_existss _write2filespipeins _aap_pipes msg_print( sline_nrsrecdictsraw_argspipeinsnextcmdsargsfnamesrpstacksfnsfsfilelistsmode((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys _pipe_tee}s$ !  c Cs‚tƒot|tdƒ|ƒdSndkl}dkl}||ƒ\} }} | o |ƒ}n|}yt ||ƒ} Wn6tj o*} t|tdƒ|t| ƒƒnXz§y| i|ƒ| iƒWn6tj o*} t|tdƒ|t| ƒƒnX| oHdkl} | ||dhd |Write string "string" to file "fname" opened with mode "mode".sskip writing to "%s"N(s url_split3(s tempfnamesCannot open "%s" for writingsCannot write to "%s"(sremote_copy_moveisnameserrmsgi(s skip_commandssmsg_infosrecdicts_sfnamesRemotes url_split3s RecPythons tempfnamesschemesmachinespathsffnamesopensmodesfsIOErrorses recipe_errorsrpstacksstrswritesstringsclosesCopyMovesremote_copy_moves try_delete(srpstacksrecdictsfnamesstringsmodesffnames url_split3s tempfnamesmachinesschemespathsremote_copy_movesesf((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys _write2file™s:      &  cCst|||dƒdS(s(Handle ":child filename": read a recipe.iN(saap_child_and_exesline_nrsrecdictsarg(sline_nrsrecdictsarg((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_childÄscCst|||dƒdS(s:Handle ":execute filename [target] ...": execute a recipe.iN(saap_child_and_exesline_nrsrecdictsarg(sline_nrsrecdictsarg((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_executeÈscCsÀt||ƒ}t|ƒ}|o d}nd}|idƒ ot |t dƒ|ƒnt |||hdd<dd<dd<dd<ƒ\}}} |ot|||ƒnt| ƒd jot |t d ƒ|ƒn|ot| ƒd jot |t d ƒ|ƒnt| ƒ} | d d }tiidƒ}|ptii|ƒ o| d idƒoAdkl}|i|d | d ƒ}||||g| ƒntii|ƒ oJ| d idƒot |t dƒ|ƒqt |t dƒ|ƒnyti ƒ}Wn&t"j ot |t dƒƒnXt#tii$|ƒ|ƒ} | ot&|t dƒ|ƒnt'|tii(|ƒƒ}dk)l*}l+}|o|idƒ p| o |idƒo||t,d|ƒ} n‘|oƒ||ƒi.} |d| d<|d| d<|di.}x7|i0ƒD])}|d djo||| |tii?ƒ| d6ss TARGETARGs_recipes_parentsCHILDDIRs PARENTDIRsTOPDIRsBASEDIR(sdoadddef(sdobuildsCannot change to directory "%s"N(Is getrpstacksrecdictsline_nrsrpstacksgetworksworkschildscmdnamesgets recipe_errors_sget_argssargs optiondictsattrdictsvarlists option_errorslensdictlist_expandsnamesGlobalscmd_argss has_options force_fetchsosspathsexistsshas_keysVersContsfetch_nodelistsget_nodesnodesgetcwdscwdsOSErrors shorten_namesdirnameschilddirs msg_extras recipe_dirsabspathsScopesget_build_recdictscreate_topscopesNones new_recdictsdatasfromdictskeysskssetworksnewworksoldargssdoargssmapscopy_global_optionssoldworksWorks top_recipestop_dirsrds set_defaultsslist2strstargetssadd_cmdline_settingssabsdirs read_recipes at_toplevelsDoAddDefsdoadddefsDoBuildsdobuildsgoto_dir(sline_nrsrecdictsargschildsnodesoldworkscreate_topscopesfetch_nodelistsdoadddefschilddirsvarlists new_recdictsabsdirsrdsoldargssnewworksattrdictsdobuildscwds optiondictsrpstacks force_fetchsfromdictsnamesksworkscmdnamesget_build_recdict((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysaap_child_and_exeÌs¬   6 /  0           &     cCst|||ƒdS(sAdd attributes to nodes.N(s aap_attributesline_nrsrecdictsarg(sline_nrsrecdictsarg((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysaap_attrzsc Csåt||ƒ}t|||ƒ\}}}| ot |t dƒƒnt |ƒt |ƒ}t |ƒ}xs|D]k} | ddjo.dkl} t |t dƒ| | ƒƒn|i| dd| ƒ}|i|ƒqrWdS(sAdd attributes to nodes.s&:attr command requires a file argumentsnames(sdictlistattr2strsAttribute without a name: %siN(s getrpstacksrecdictsline_nrsrpstacksget_argssargs optiondictsattrdicts argdictlists recipe_errors_s dict_expandsdictlist_expandsgetworksworksadictsDictlistsdictlistattr2strsget_nodesnodesset_attributes( sline_nrsrecdictsargsworksnodes optiondictsrpstacks argdictlistsattrdictsdictlistattr2strsadict((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_attributes    !cCs”ti|dƒ}|djot|fSn|| }||d}|djpti|dƒdjot|t dƒ|ƒn||fSdS(sxSeparate the scope and the variable name out of "name". Returns (scope, name). Scope is None when there is none.s.iisInvalid dot in variable name %sN( sstringsfindsnamesisNonesscopesvarnames recipe_errorsrpstacks_(srpstacksnamesisvarnamesscope((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys sep_scope—s  &ic Csät||ƒ\} }| o d} ny|| }Wn›dkl}l }|o| dt i joOt || ƒ||| ƒ}|ot||ƒn||| ƒ|| }qÓt|tdƒ|ƒnX|| |fSdS(sD Get the recdict, scope and varname to use for "name", which may include a scope name. The returned scope is "_no" when no scope was specified. When a variable exists with the name of the scope the returned "rd" is the variable value. When "assign" is non-zero, create a new user scope when needed. s_no(scheck_user_scopescreate_user_scopeisInvalid scope name: %sN(s sep_scopesrpstacksnamesscopesvarnamesrecdictsrdsScopescheck_user_scopescreate_user_scopesassignsstringsletterssassert_scope_namesmsgs recipe_errors_( srpstacksrecdictsnamesassignsvarnamesrdscreate_user_scopescheck_user_scopesmsgsscope((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysget_scope_recdict¦s"   cCst||ƒ} t| ||dƒ\}} }|djp|i |ƒ oÈ|djo%t |||tdtiƒƒ}n|}dk} |i |ƒoË|i|ƒ}dkl} t|| iƒp t|| ƒoI|djot| tdƒ|ƒq$t|tdƒ|d | ƒn|djo2t||| |ƒ}|o|d |}qcqgn|djot|ƒ}ny||| %  # !  sc) Cs t||ƒ}d}|}d} t|ƒ}d}x„ ||jov ||djoÏ |}|d}||djo|d}|d}qµ ||djo|d}|d}qµ ||djo#|d|jo||ddjo |||d}|d }qµ || } ti|ƒ}&x`||d joN||d jo d|&_n#||d jo d|&_n||d jo d|&_nç||djo d|&_nÉ||djo d|&_n«||djoti|&_nŠ||djoti|&_ni||djoti|&_nH||djoti|&_n'||djoti|&_ndGH|d}q)W||djp||djot||dƒ}$n|}$|$}x-||jot||ƒo|d}qÑW||$jo||ddjo|d}n||$jo6|o||||!}q6nt!|t"dƒƒn||$|!}t$||ƒ\}} | o d}ny||}d} Wn d} nX| o(y|| }d}Wqød}qøXn| o| o|&i o]|o||||!}q6n| ot!|t"dƒ|ƒnt!|t"dƒ|ƒnd} |$|jot||ƒ}||jo||djoÅ|}d}(|d}xx||jo||djp |(djoL||djo|(d}(n ||djo|(d}(n|d}qÈW||jp||djo6|o||||!}q6nt!|t"dƒƒnt-||||d|!tdtiƒd|ƒ}'yt/|'ƒ} Wn=|o||||!}q6nt!|t"d ƒ|'ƒnX| djo:|o||||!}q6nt!|t"d!ƒ| ƒnt||dƒ}n||jpA||djo||djp||djo||d"jo>|o||||!}q6nt!|t"d#ƒ||ƒn|d}n|}| o| o|&i oq6n|} |}$x›||jo|o|||jo d}qÓnZ||djp||djo||}n*t1i2t1i3d||ƒdjoPn|d}qGW||$|!}|&io"t5||||dƒ\}}nh}|&io | o| o|d| !}q6n|&i p*| djo|djot|ƒdjo]| djo®y |t7|||| |&ƒ}WqÓ t8t9fj ou|o||||!}q6nd$k:l;}||| ƒot!|t"d%ƒ| ƒnt!|t"d&ƒ| ƒqÓ Xn“t<|t7|||| ƒƒ}t|ƒ| djoF|o||||!}qÓ t>|t"d'ƒ|| t|ƒfƒn|t?|| |&ƒ}| }|$}qµ t<|t7|||| ƒƒ}%t|%ƒdjp!| djot|%ƒ| djoL| djo| o!t>|t"d(ƒ| |fƒnhd)d "textval1" "textval2". "argexpand" is an Expand object that specifies the way $VAR is expanded. When "startquote" isn't empty, work like "arg" was preceded by it. When "skip_errors" is non-zero, leave items with errors unexpanded, never fail. sis$is#s(is)is ?-+*/='"\!s?s-s+s*s/s=s's"s\s!sOoops!s{s.sInvalid character after $s_nosInvalid scope name in %ssUnknown variable: "%s"iÿÿÿÿs[s]s Missing ']'s)index does not evaluate to a number: "%s"s*index evaluates to a negative number: "%d"s}sNo match for "%s"(s is_scope_names"Using scope name as variable: "%s"s&Type of variable "%s" must be a stringsusing %s[%d] but length is %ds,Index "%d" is out of range for variable "%s"snames startquotes squotes {%s = %s}s N(Ls getrpstacksrecdictsline_nrsrpstacksress startquotesinquotes itemstartslensargsarg_lensidxssidxsbeforescopys argexpandsexpsoptionalsattrsrcstylesslashsExpands quote_nonesquotes quote_aaps quote_doublesquote_bss quote_shells skip_whitesssesvarchars skip_errorss recipe_errors_snames sep_scopesscopesvarnamesrds scope_founds var_foundsindexsbsbraksexpandsvsints after_inquotesstringsfinds whitespacesafters get_attrdictsattrdicts get_var_vals TypeErrorsKeyErrorsScopes is_scope_names str2dictlistsvarlists msg_warnings expand_itemsvarlist1svarlist2sleadsqscsrcssd1sd2senquotesexpand_itemstrskeyssk()sline_nrsrecdictsargs argexpands startquotes skip_errorss is_scope_namesvarlist2sarg_lens scope_founds after_inquotes itemstartsbeforesindexsleadsvarlistsressrcssrdsscopes var_foundsinquotesrpstacksd1saftersattrdictssidxscsbsesnamesidxsvarnamesksd2sqsssvarlist1sexpsvsbrak((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysexpandùsÜ     7      ""          + Q "$  " 8   $ 7    ;            (    cCsNt|||ddƒ\}}|idƒp |idƒodSndSdS(s9Return non-zero when "s" starts with a "force" attribute.iisfsforceN(s get_attrdictsrpstacksrecdictsssattrdictsisget(srpstacksrecdictsssisattrdict((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysshell_cmd_has_forceEs  iÿÿÿÿc CsitƒoA|ddjo|d }n|}t||d|ƒdSnt||ƒ}t|||ƒ}t |||t dt i ƒƒ}|idƒot|tdƒ|dƒn|djo|idƒ}n|otid d gjot|||ƒd}nt||ƒ}||d <|djo| o$tt||ƒtd ƒ|ƒndS( sõExecute shell commands from the recipe. "cmds" must end in a newline character. When "async" is positive work asynchronously. When "async" is negative (the default) work asynchronously when the $async variable is set.iÿÿÿÿs sshell commands "%s"Nistargets!Shell commands for updating "%s":sasyncsposixsnts sysresultsShell command returned %d(s skip_commandsscmdssssmsg_skipsline_nrsrecdicts getrpstacksrpstacksshell_cmd_has_forcesforcedsexpandsExpands quote_shellscmdshas_keys msg_extras_sasyncsgetsossnames async_systemsns logged_systems recipe_error( sline_nrsrecdictscmdssasyncsrpstackscmdsforcedsssn((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_shellMs, !   cCst|||dƒdS(sBImplementation of ":system cmds". Almost the same as aap_shell().s N(s aap_shellsline_nrsrecdictscmds(sline_nrsrecdictscmds((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_systemwscCst|||dƒdS(s?Implementation of ":sys cmds". Almost the same as aap_shell().s N(s aap_shellsline_nrsrecdictscmds(sline_nrsrecdictscmds((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysaap_sys|scCsËt||ƒ} t| ||ddƒ\}}xI|iƒD];}|djo |djot | t dƒ|ƒq:q:W|i dƒ ot | t dƒƒnt ||||tdtiƒƒ}dkl}|idƒo|i dƒ} n©t||dd ƒ}| o d } ntid d |ƒd } t||ddƒ}|oLt| |ƒdd}tii|ƒ}|ot|ƒd | } qžng} x no||ƒ\} }| oPng}xt#i$|dƒD] } yti&|d| ƒ}Wn2t(j o&}t | t dƒt*|ƒƒnX|o¯y|i+dƒ}Wn2t(j o&}t | t dƒt*|ƒƒnXt-|dƒ}t.|ƒ}x1||jot/||dƒo|d}q§W|i0|||!ƒqåqåW| ot | t dƒƒnt1|ƒ}|| joJt.|ƒdjot3|t dƒ|ƒnt3|t dƒ|ƒPnxC|D];}| od| }nd}t6|||t|ƒƒq}W|} q®WdS(sK Implementation of ":sysdepend {filepat = pattern} shell-command". iisfilepatssrcpaths#Unknown option for :sysdepend: "%s"s$filepat option missing in :sysdepend(s redir_systems_nosINCLUDEs.s ^-I|[ "]-Is s .ssourcesnames serror in filepat: %ss(error using first group from filepat: %ssGenerating dependencies failedsCannot find included file: %ssCannot find included files: %ss{searchpath = %s} sN(7s getrpstacksrecdictsline_nrsrpstacks get_attrdictsargsattrdictsiskeyssks recipe_errors_sgetsexpandsExpands quote_shellscmds RecPythons redir_systemshas_keys searchpaths get_var_valsressubsss str2dictlistsosspathsdirnamesds listitem2strs prev_filessokstextsfilessstringssplitslinesmatchsms StandardErrorsesstrsgroupsfs skip_whiteslensis_whitesappendslist2strs files_strsmsg_infosafilesopts aap_update(sline_nrsrecdictsargsfiless files_strstextsoptsattrdictsafilesrpstacks prev_filesslines searchpathsoksdsfsiskscmdsms redir_systemssse((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_sysdepends~ %  " "  c Cs?tƒot||d|ƒdSnt||ƒ}tdtiƒ}t |t |||tdti ƒƒƒ}t|ƒdjot|tdƒƒn|dd}t|ƒ}d} xf| |joXd} d}x«| |jo|| djoŒ|| d jo| d |joN| d } || d jo!| t|d |ƒ} d }qv| || } n| || } | d } qÚW| o| d t|d |ƒ} n|id ƒotiddgjot||| ƒdSnt|| ƒti| ƒdjodSn| d } q¾Wt|tdƒ|ƒdS(s&Implementation of ":syspath path arg".s :syspath Niis(:syspath requires at least two argumentssnamess:s%isss sasyncsposixsnts*No working command found for :syspath "%s"(s skip_commandssmsg_skipsline_nrsrecdictsargs getrpstacksrpstacksExpands quote_shellsxps str2dictlistsexpands quote_aapsargsslens recipe_errors_spathspath_lensiscmdshad_pss dictlist2strsgetsossnames async_systems msg_systemssystem( sline_nrsrecdictsargspath_lensxpshad_pssrpstacksargsspathsiscmd((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_syspathÖsJ $  "  & cCst|||dddƒdS(sImplementation of ":start cmd".s sasynciN(s aap_shellsline_nrsrecdictscmds(sline_nrsrecdictscmds((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_start scCs$dkl}||||dƒdS(s%Implementation of ":copy -x from to".(s copy_moveiN(sCopyMoves copy_movesline_nrsrecdictsarg(sline_nrsrecdictsargs copy_move((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysaap_copys cCs$dkl}||||dƒdS(s%Implementation of ":move -x from to".(s copy_moveiN(sCopyMoves copy_movesline_nrsrecdictsarg(sline_nrsrecdictsargs copy_move((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysaap_moves c Cs"tƒot||d|ƒdSnt||ƒ}t|||hdd<dd<dd<dd<ƒ\}}} |ot ||dƒnt | ƒdjot |td ƒƒn| d d }| d d } tii| ƒptii| ƒog|idƒoti| ƒqetd ƒ| }|idƒot||ƒnt ||ƒdSntii|ƒ o|idƒ ot|tdƒ|ƒnyti|| ƒWnbtj oV}tdƒ|| t|ƒf}|idƒot||ƒqt ||ƒnXdS(s,Implementation of ":symlink {f}{q} from to".s :symlink Nsfsforcesqsquiets:symlinkis':symlink command requires two argumentsisnameis:symlink: target exists: "%s"s#file linked to does not exist: "%s"s:symlink "%s" "%s" failed: %s(s skip_commandssmsg_skipsline_nrsrecdictsargs getrpstacksrpstacksget_argss optiondictsattrdicts argdictlists option_errorslens recipe_errors_sfromargstoargsosspathsislinksexistssgetsunlinksmsgs msg_extras msg_warningssymlinks StandardErrorsesstr( sline_nrsrecdictsargsfromargsmsgsattrdicts optiondictsrpstacksestoargs argdictlist((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_symlinks<  6& %cCst|||ƒdS(sAlias for aap_del().N(saap_delsline_nrsrecdictsarg(sline_nrsrecdictsarg((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_deleteKscCs¬tƒot||d|ƒdSnt||ƒ} t|ƒ}t |||hdd<dd<dd<dd<dd<dd<d d <d d  ssImporting "%s" from %ss.aapsCannot import "%s"s homedirfirstsmodules2(2sgetworksrecdictsworks getrpstacksline_nrsrpstacksget_argssargs optiondictsattrdictsargss option_errorslens recipe_errors_snamesmodule_already_readshas_keys msg_extrasScopescheck_user_scopes scope_namesassert_scope_namesgetsrdsUserDicts isinstancesmsgsget_build_recdictsNones new_recdictsadd_user_scopes RecipeDicts scope_recdictsdatassetworksmapsget_import_dirssdirssstrsdonesadirsosspathsjoinsrecnamesexistss read_recipes default_dirssd(sline_nrsrecdictsargsdirssrecnamesadirs scope_recdicts new_recdictsrdsmsgsattrdicts optiondictsrpstacksUserDictsargss scope_namescheck_user_scopes RecipeDictsdsnamesadd_user_scopesworksget_build_recdictsdone((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_importØ sf          # (cBs!e||ƒ}e|||hƒ\}} }| oe || dƒn|oe ||dƒngi } e |ƒD]} | eii| dƒƒqw~ } d}xu|D]m}|d}ei|| ƒ} d|dUed|ƒo.d|dU| od }d |dUqq¬q¬WdS( s% :toolsearch tool1 tool2 ... s :toolsearchstoolsisnames#tools_%s = imp.load_module(c, *fpd)Nstools_%s.exists()stools_%s.define_actions()is%tools_%s.use_actions(recdict['_top'])(s getrpstacksrecdictsline_nrsrpstacksget_argssargs optiondictsattrdictsargss option_errorsappends_[1]sget_import_dirssdsosspathsjoins tools_pathsdidonesascsimps find_modulesfpdseval(sline_nrsrecdictsargscs optiondictsrpstacksasargssdidones tools_paths_[1]sfpdsattrdictsd((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysaap_toolsearch* s&<   cCsOtiidƒ odSnt|diƒ}ti|ƒodSndSdS(sQReturn non-zero if a ":recipe" command in the current recipe may be executed.s fetch-recipeiiÿÿÿÿiN( sGlobalscmd_argss has_options full_fnamesrpstacksnamesrecnamesrecipe_fetchedshas_key(srpstacksrecname((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysmaydo_recipe_cmdG sc Cs™t|ƒ} t||ƒ}t|ƒ odSnt|diƒ}dt |· sN(sVersContsverscont_nodelistsfetch_nodelistspublish_nodelistsgetworksrecdictsworksnodelistsvarlistsitemsget_nodesnodesset_attributessattrdictsactions may_fetchsappendsrpstacksfaileds recipe_errors_sstrsmap( srpstacksrecdictsactionsattrdictsvarlistsnodesnodelistsfailedsworkspublish_nodelistsverscont_nodelistsitemsfetch_nodelist((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysdo_verscont_cmdž s$    cCsDt||ƒ}t||||ƒ\}}t |||||ƒdS(s)Perform "action" for each item "varlist".N( s getrpstacksrecdictsline_nrsrpstacksget_verscont_argssargsactionsattrdictsvarlistsdo_verscont_cmd(sline_nrsrecdictsargsactionsrpstacksvarlistsattrdict((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys verscont_cmd¹ scCst|||dƒdS(s'"Handle ":fetch {attr = val} file ...".sfetchN(s verscont_cmdsline_nrsrecdictsarg(sline_nrsrecdictsarg((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_fetchÀ scCst|||dƒdS(s*"Handle ":checkout {attr = val} file ...".scheckoutN(s verscont_cmdsline_nrsrecdictsarg(sline_nrsrecdictsarg((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_checkoutÄ scCst|||dƒdS(s("Handle ":commit {attr = val} file ...".scommitN(s verscont_cmdsline_nrsrecdictsarg(sline_nrsrecdictsarg((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_commitÈ scCst|||dƒdS(s)"Handle ":checkin {attr = val} file ...".scheckinN(s verscont_cmdsline_nrsrecdictsarg(sline_nrsrecdictsarg((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_checkinÌ scCst|||dƒdS(s("Handle ":unlock {attr = val} file ...".sunlockN(s verscont_cmdsline_nrsrecdictsarg(sline_nrsrecdictsarg((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_unlockÐ scCst|||dƒdS(s)"Handle ":publish {attr = val} file ...".spublishN(s verscont_cmdsline_nrsrecdictsarg(sline_nrsrecdictsarg((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_publishÔ scCst|||dƒdS(s%"Handle ":add {attr = val} file ...".saddN(s verscont_cmdsline_nrsrecdictsarg(sline_nrsrecdictsarg((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysaap_addØ scCst|||dƒdS(s("Handle ":remove {attr = val} file ...".sremoveN(s verscont_cmdsline_nrsrecdictsarg(sline_nrsrecdictsarg((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_removeÜ scCst|||dƒdS(s%"Handle ":tag {attr = val} file ...".stagN(s verscont_cmdsline_nrsrecdictsarg(sline_nrsrecdictsarg((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysaap_tagà sc Cs«t||ƒ}t|t|||tdtiƒƒƒ}| ot |t dƒƒnt |ƒdjot |dƒ}ng}t|||dd|d|ƒdS(s3"Handle ":verscont action {attr = val} [file ...]".is:verscont requires an argumentisnameN(s getrpstacksrecdictsline_nrsrpstacks str2dictlistsexpandsargsExpands quote_aapsvarlists recipe_errors_slensdictlist_expandsarglistsdo_verscont_cmd(sline_nrsrecdictsargsrpstacksvarlistsarglist((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_verscontå s$cCs¿t|ƒ}dkl}g}xh|iiƒD]W}|i i dƒp|i i dƒo |i ƒo|i |ƒ|i|ƒq/q/W|o||||dƒo d}nd}|SdS(sYFetch all nodes with a "fetch" or "commit" attribute. Return non-zero for success.(sfetch_nodelistsfetchscommitiiN(sgetworksrecdictsworksVersContsfetch_nodelistsnodelistsnodessvaluessnodes attributesshas_keys may_fetchsset_attributessattrdictsappendsrpstacksok(srpstacksrecdictsattrdictsnodesnodelistsworksoksfetch_nodelist((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys do_fetch_allö s  3  cCsAt||ƒ}t|||ddƒ\}}t|||ƒdS(s!"Handle ":fetchall {attr = val}".iiN( s getrpstacksrecdictsline_nrsrpstacks get_attrdictsargsattrdictsis do_fetch_all(sline_nrsrecdictsargsrpstacksisattrdict((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_fetchall sc Cs¿t|ƒ}dkl}g}xh|iiƒD]W}|i i dƒo|djp|i i dƒo|i |ƒ|i|ƒq/q/W|o|||||ƒo d}nd}|SdS(s³Do version control action "action" on all nodes with the "commit" attribute. Apply items from dictionary 'attrdict" to each node. Return non-zero for success.(sverscont_nodelistscommitsaddstagiiN(sgetworksrecdictsworksVersContsverscont_nodelistsnodelistsnodessvaluessnodes attributesshas_keysactionsset_attributessattrdictsappendsrpstacksok( srpstacksrecdictsactionsattrdictsnodesnodelistsworksverscont_nodelistsok((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysdo_verscont_all s  3  cCsDt||ƒ}t|||ddƒ\}}t||d|ƒdS(s""Handle ":commitall {attr = val}".iiscommitN( s getrpstacksrecdictsline_nrsrpstacks get_attrdictsargsattrdictsisdo_verscont_all(sline_nrsrecdictsargsrpstacksisattrdict((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_commitall0 scCsDt||ƒ}t|||ddƒ\}}t||d|ƒdS(s#"Handle ":checkinall {attr = val}".iischeckinN( s getrpstacksrecdictsline_nrsrpstacks get_attrdictsargsattrdictsisdo_verscont_all(sline_nrsrecdictsargsrpstacksisattrdict((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysaap_checkinall8 scCsDt||ƒ}t|||ddƒ\}}t||d|ƒdS(s$"Handle ":checkoutall {attr = val}".iischeckoutN( s getrpstacksrecdictsline_nrsrpstacks get_attrdictsargsattrdictsisdo_verscont_all(sline_nrsrecdictsargsrpstacksisattrdict((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysaap_checkoutall@ scCsDt||ƒ}t|||ddƒ\}}t||d|ƒdS(s""Handle ":unlockall {attr = val}".iisunlockN( s getrpstacksrecdictsline_nrsrpstacks get_attrdictsargsattrdictsisdo_verscont_all(sline_nrsrecdictsargsrpstacksisattrdict((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_unlockallH scCsDt||ƒ}t|||ddƒ\}}t||d|ƒdS(s"Handle ":tagall {attr = val}".iistagN( s getrpstacksrecdictsline_nrsrpstacks get_attrdictsargsattrdictsisdo_verscont_all(sline_nrsrecdictsargsrpstacksisattrdict((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_tagallP scCs<t||d|ƒ}t||||dƒ}|o|SdS(Nscheckinsremove(sdo_verscont_allsrpstacksrecdictsattrdictsres1s do_remove_addslocalsres2(srpstacksrecdictsattrdictslocalsres2sres1((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys do_revise_allX scCs}t||ƒ}t|||hdd<dd<ƒ\}}}|ot |t dƒƒnt ||||i dƒƒdS(s""Handle ":reviseall {attr = val}".slslocals!Too many arguments for :reviseallN( s getrpstacksrecdictsline_nrsrpstacksget_argssargs optiondictsattrdicts argdictlists recipe_errors_s do_revise_allsget(sline_nrsrecdictsargs optiondictsrpstacks argdictlistsattrdict((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_reviseall] s $cCs«t|ƒ}dkl}g}xH|iiƒD]7}|i i dƒo|i |ƒ|i |ƒq/q/W|o||||dƒ}nt|tdƒƒg}|SdS(sYPublish all noces with a "publish" attribute. Returns a list of nodes that failed.(spublish_nodelistspublishisnothing to be publishedN(sgetworksrecdictsworksVersContspublish_nodelistsnodelistsnodessvaluessnodes attributesshas_keysset_attributessattrdictsappendsrpstacksfaileds msg_extras_(srpstacksrecdictsattrdictsnodesnodelistsworkspublish_nodelistsfailed((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysdo_publish_allj s   cCswt||ƒ}t|||ddƒ\}}t|||ƒ}|o-t |t dƒt t d„|ƒƒƒndS(s#"Handle ":publishall {attr = val}".iispublish failed for "%s"cCs |iƒS(N(sxs short_name(sx((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysˆ sN(s getrpstacksrecdictsline_nrsrpstacks get_attrdictsargsattrdictsisdo_publish_allsfaileds recipe_errors_sstrsmap(sline_nrsrecdictsargsrpstacksisfailedsattrdict((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysaap_publishall€ s cCsktƒot|tdƒ|ƒdSnd|dAdd filetype detection from a file or in-line detection rules.(s ft_add_ruless ft_read_files DetectErroriis Too many arguments for :filetypes0Cannot have file name and commands for :filetypes-Must have file name or commands for :filetypeslinessnames file "%s"sError in detection %s: N(sFiletypes ft_add_ruless ft_read_files DetectErrors getrpstacksrecdictsline_nrsrpstacks str2dictlistsexpandsargsExpands quote_aapsargsslens recipe_errors_scommandsswhats cmd_line_nrsfnamesesstr( sline_nrsrecdictsargs cmd_line_nrscommandssesfnames ft_add_rulessrpstacksargsswhats ft_read_files DetectError((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_filetypeà s,$ c Cs`dkl}t||ƒ}|t||ƒ|t|t |||t dt i ƒƒƒ|ƒdS(s/Add an application for an action-filetype pair.(s action_addiN(sActions action_adds getrpstacksrecdictsline_nrsrpstacks rpdeepcopys cmd_line_nrs str2dictlistsexpandsargsExpands quote_aapscommands(sline_nrsrecdictsargs cmd_line_nrscommandss action_addsrpstack((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_actionà s !c Bs8e||ƒ}e|e|||edeiƒƒƒ}e |ƒdjoe |e dƒƒn|dd} y^gi}e|ƒD]}|eii|dƒƒqˆ~}ei| |ƒ}d| dUWne |e dƒ| ƒnXed | ƒod | dUd | dUne |e d ƒ| ƒdS( s> Set a specific tool to be used in the current scope. iis:usetool requires one argumentsnamestoolss*tools_%s = imp.load_module(toolname, *fpd)NsTool "%s" is not supportedstools_%s.exists()stools_%s.define_actions()stools_%s.use_actions(recdict)s'Tool "%s" cannot be found on the system(s getrpstacksrecdictsline_nrsrpstacks str2dictlistsexpandsargsExpands quote_aapsargsslens recipe_errors_stoolnamesappends_[1]sget_import_dirssdsosspathsjoins tools_pathsimps find_modulesfpdseval( sline_nrsrecdictsargsdsrpstacks tools_pathsargss_[1]sfpdstoolname((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_usetoolë s"$< c Cstt||ƒ}t|t|||tdtiƒƒƒ}t |ƒdjot |t dƒƒnt ||ddƒt|||ddƒ\}}} dkl}d}x.|dD]"}||dƒ}|oPq¹q¹W| o+t|t dƒtd „|dƒƒnd |jod |}ny|||  ss s"%s"s :progsearch assignment error: %sN(s getrpstacksrecdictsline_nrsrpstacks str2dictlistsexpandsargsExpands quote_aapsargsslens recipe_errors_sassert_var_namesget_scope_recdictsrdsscopesvarnames RecPythons program_pathsprogsmsg_notesmaps StandardErrorsesstr( sline_nrsrecdictsargs program_pathsrdsprogsscopesrpstacksargssesvarname((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysaap_progsearch s.$#   + c Cs?t||ƒ}t|t|||tdtiƒƒƒ}t |ƒdjot |t dƒƒn|dgt |dƒ}dkl}z|||ƒ}Wd|didƒomxj|dD]Z}yti|dƒWqÀtj o0}t|t d ƒ|dt|ƒfƒqÀXqÀWnX|ot ||ƒndS( sAExecute an action for a type of file: :do action {attr} fname ...iis#:do requires at least two argumentsi(s action_runNsremovesnamesCould not remove "%s": %s(s getrpstacksrecdictsline_nrsrpstacks str2dictlistsexpandsargsExpands quote_aapsargsslens recipe_errors_sdictlist_expandsActions action_runsmsgsgetsossremoves StandardErrorses msg_warningsstr(sline_nrsrecdictsargs action_runsesrpstacksargssmsg((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysaap_do+ s($  5cCst|||ƒdS(s Quit aap.N(saap_quitsline_nrsrecdictsarg(sline_nrsrecdictsarg((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysaap_exitG scCs0t|ƒdjott|ƒ‚nt‚dS(s Quit aap.iN(slensargs NormalExitsint(sline_nrsrecdictsarg((s-/mnt/gmirror/ports/devel/aap/work/Commands.pysaap_quitK scCs t‚dS(sQuit the current recipe.N(s FinishRecipe(sline_nrsrecdictsarg((s-/mnt/gmirror/ports/devel/aap/work/Commands.pys aap_finishQ scCs2t||ƒ}t|||ƒ\}}}|ot |t dƒƒn| ot |t dƒƒnt |ƒdjo d}nŒt |ƒdjoet i|ddƒ}|djo|djo |d jo#t |t d ƒ|ddƒqnt |t d ƒƒ|d }|ddti|