
 Pc           @   s  d  Z  d d k Z d d k Z d d k Z d d k Z d d k Z y d d k Z Wn e j
 o d d k Z n Xd d k	 l
 Z
 l Z l Z l Z l Z l Z l Z l Z l Z d d k Z	 d Z d Z d Z d Z d i   Z d	 Z d
 Z d Z d Z d e i f d     YZ d e i f d     YZ d e f d     YZ  d e  f d     YZ! d e f d     YZ" d e f d     YZ# d e f d     YZ$ e i% e i&  e _& e i% e i'  e _' d S(   sp   
Classes related to the build phase (build, clean, install, step, etc)

The inheritance tree is the following:

iN(	   t   Runnert   TaskGent   Utilst	   ConfigSett   Taskt   Logst   Optionst   Contextt   Errorst   c4ches	   _cache.pyi9  is!   root node_deps raw_deps task_sigst	   cfg_filesi    i   i   t   BuildContextc           B   s  e  Z d  Z d Z d Z d   Z d   Z e e d*  Z	 d   Z
 d   Z d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d* d* d  Z d   Z d   Z e e e  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z  d   Z! d   Z" d   Z# d   Z$ d* d  Z% d    Z& d!   Z' d* e( d"  Z) d#   Z* d$   Z+ d%   Z, d&   Z- d'   Z. d(   Z/ d)   Z0 RS(+   s   executes the buildt   buildt    c         K   st  t  t |   i |   d |  _ | i d t i  |  _ | i d t i  |  _ t |  _	 | i d t i
  |  _
 | i d d   |  _ |  i p |  i
 t i t |  _ n h  |  _ h  |  _ h  |  _ h  |  _ h  |  _ h  |  _ t i |  _ t i i |  _ t i i |  _ t i i |  _ t i |  _ t i i |  _ t i i |  _ t i  t!  |  _" d |  _# g  |  _$ h  |  _% d  S(   Ni    t   top_dirt   run_dirt   out_dirt	   cache_dir(&   t   superR   t   __init__t
   is_installt   getR   R   R   t   POST_AT_ONCEt	   post_modeR   t   NoneR   t   ost   sept	   CACHE_DIRt   all_envst	   task_sigst	   node_depst   raw_depst   cache_dir_contentst   task_gen_cache_namest
   launch_dirR   t   optionst   jobst   targetst   keept   cache_globalt   nocachet   progress_barR   t   defaultdictt   listt   deps_mant   current_groupt   groupst   group_names(   t   selft   kw(    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR   5   s6    		
									c         C   s+   |  i  p |  i St i i |  i |  i   S(   s$   Getter for the variant_dir attribute(   t   variantR   R   t   patht   join(   R0   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   get_variant_dir|   s    
c         O   sH   |  | d <t  i | |   } h  |  _ |  i | d | i d d  | S(   sw  
		Create a task generator and add it to the current build group. The following forms are equivalent::

			def build(bld):
				tg = bld(a=1, b=2)

			def build(bld):
				tg = bld()
				tg.a = 1
				tg.b = 2

			def build(bld):
				tg = TaskGen.task_gen(a=1, b=2)
				bld.add_to_group(tg, None)

		:param group: group name to add the task generator to
		:type group: string
		t   bldt   groupN(   R   t   task_genR!   t   add_to_groupR   R   (   R0   t   kR1   t   ret(    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   __call__   s
    
	c         C   s   t  i d   d S(   sF   Implemented to prevents copies of build contexts (raises an exception)s,   build contexts are not supposed to be copiedN(   R   t   WafError(   R0   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   __copy__   s    c         O   s   d S(   sV   Actual implementation provided by :py:meth:`waflib.Build.InstallContext.install_files`N(    (   R0   R:   R1   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   install_files   s    c         O   s   d S(   sS   Actual implementation provided by :py:meth:`waflib.Build.InstallContext.install_as`N(    (   R0   R:   R1   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt
   install_as   s    c         O   s   d S(   sS   Actual implementation provided by :py:meth:`waflib.Build.InstallContext.symlink_as`N(    (   R0   R:   R1   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt
   symlink_as   s    c   	      C   s?  |  i  i |  i  } | p t i d   n | i d t d t } | p t i d   n x | D] } | i |  i	 t d  i	 d d  } t
 i
 | i    } | |  i | <x| | t D]p } |  i  i |  } y t i | i    } Wn3 t t f j
 o! t i d |  t i } n X| | _ q Wqi Wd	 S(
   s%  
		The configuration command creates files of the form ``build/c4che/NAMEcache.py``. This method
		creates a :py:class:`waflib.ConfigSet.ConfigSet` instance for each ``NAME`` by reading those
		files. The config sets are then stored in the dict :py:attr:`waflib.Build.BuildContext.allenvs`.
		s:   The project was not configured: run "waf configure" first!s   **/*%st   quiets5   The cache directory is empty: reconfigure the projectR   s   \t   /s   cannot find %rN(   t   roott	   find_nodeR   R   R=   t   ant_globt   CACHE_SUFFIXt   Truet	   path_fromt   replaceR   t   abspathR   t	   CFG_FILESt   find_resourceR   t   h_filet   IOErrort   AttributeErrorR   t   errort   SIG_NILt   sig(	   R0   t   nodet   lstt   xt   namet   envt   ft   newnodet   h(    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt	   load_envs   s(     ' c         C   s   t  i i |  i  o t  i i |  i  p t i d   n |  i i |  i  |  _ |  _	 |  i i
 |  i  |  _ |  i i   d S(   s7  
		Initialize the project directory and the build directory by creating the nodes
		:py:attr:`waflib.Build.BuildContext.srcnode` and :py:attr:`waflib.Build.BuildContext.bldnode`
		corresponding to ``top_dir`` and ``variant_dir`` respectively. The ``bldnode`` directory will be
		created if it does not exist.
		s:   The project was not configured: run "waf configure" first!N(   R   R3   t   isabsR   R   R   R=   RD   t   find_dirt   srcnodet	   make_nodet   variant_dirt   bldnodet   mkdir(   R0   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt	   init_dirs   s
    ,c         C   s0   |  i    |  i p |  i   n |  i   d S(   s   
		Restore the data from previous builds and call :py:meth:`waflib.Build.BuildContext.execute_build`. Overrides from :py:func:`waflib.Context.Context.execute`
		N(   t   restoreR   R\   t   execute_build(   R0   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   execute   s    

c      
   C   s  t  i d |  i  |  i |  i g  |  i   t i   |  _ |  i	 o t
 i i t  i i  n z |  i   Wd |  i	 d j om t |  i  p d } |  i |  i | | t  i i t  i i   d GHt
 i i   t
 i i t  i i  n t  i d |  i  X|  i   d S(   sc  
		Execute the build by:

		* reading the scripts (see :py:meth:`waflib.Context.Context.recurse`)
		* calling :py:meth:`waflib.Build.BuildContext.pre_build` to call user build functions
		* calling :py:meth:`waflib.Build.BuildContext.compile` to process the tasks
		* calling :py:meth:`waflib.Build.BuildContext.post_build` to call user build functions
		s   Waf: Entering directory `%s'Ni   R   s   Waf: Leaving directory `%s'(   R   t   infoRa   t   recurseR   t	   pre_buildR   t   Timert   timerR)   t   syst   stderrt   writet   colorst
   cursor_offt   compilet   lent   returned_taskst   to_logt   progress_linet   BLUEt   NORMALt   stdoutt   flusht	   cursor_ont
   post_build(   R0   t   c(    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyRf      s     


+c         C   s  y% t  i  t i i |  i d   } Wn t t f j
 o nK X| d t i j  o t	 i
 d   n x | d D] } |  i |   qs Wd } z t i i |  i t i  } y t | d  } Wn* t t f j
 o t i d |  n Xz t i i i   |  i t i _ y t i |  } Wn, t j
 o  } t i d | | f  n' Xx" t D] } t |  | | |  qYWWd t i i i   XWd | o | i   n X|  i    d S(	   sk   
		Load the data from a previous run, sets the attributes listed in :py:const:`waflib.Build.SAVED_ATTRS`
		s   build.config.pyt   versions)   Version mismatch! reconfigure the projectt   toolst   rbs2   build: could not load the build cache %s (missing)s.   build: could not pickle the build cache %s: %rN(!   R   R   R3   R4   R   RO   t   OSErrorR   t
   HEXVERSIONR   R=   t   setupR   Ra   t   DBFILEt   opent   EOFErrorR   t   debugt   waflibt   Nodet   pickle_lockt   acquiret
   node_classt   Nod3t   cPicklet   loadt	   Exceptiont   SAVED_ATTRSt   setattrt   releaset   closeRd   (   R0   RX   t   tRY   t   dbfnt   datat   eRV   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyRe      s<    %  c         C   sD  h  } x! t  D] } t |  |  | | <q Wt i i |  i t i  } zl t i	 i
 i   |  i t i	 _ d } z* t | d d  } t i | | d  Wd | o | i   n XWd t i	 i
 i   XyK t i |  } t i |  t i p! t i | d | i | i  n Wn t t f j
 o n Xt i | d |  d S(   s   
		Store the data for next runs, sets the attributes listed in :py:const:`waflib.Build.SAVED_ATTRS`. Uses a temporary
		file to avoid problems on ctrl+c.
		s   .tmpt   wbiN(   R   t   getattrR   R3   R4   Ra   R   R   R   R   R   R   R   R   R   R   R   t   dumpR   R   t   statt   unlinkR   t   is_win32t   chownt   st_uidt   st_gidRP   R   t   rename(   R0   R   RV   t   dbRY   t   st(    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   store(  s.     
%c         C   s   t  i d  t i |  |  i  |  _ |  i   |  i _ g  |  _ y |  i i	   Wn  t
 j
 o |  i     n X|  i i o |  i   n |  i i o t i |  i i   n d S(   s   
		Run the build by creating an instance of :py:class:`waflib.Runner.Parallel`
		The cache file is not written if the build is up to date (no task executed).
		s   build: compile()N(   R   R   R    t   ParallelR$   t   producert   get_build_iteratort   biterRt   t   startt   KeyboardInterruptR   t   dirtyRQ   R   t
   BuildError(   R0   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyRr   L  s    	
c         C   sm   t  | t  o& x | D] } |  i | |  q Wd St i | |  } t | d  o | i |   n d S(   s]  
		Import waf tools, used to import those accessed during the configuration::

			def configure(conf):
				conf.load('glib2')

			def build(bld):
				pass # glib2 is imported implicitly

		:param tool: tool list
		:type tool: list
		:param tooldir: optional tool directory (sys.path)
		:type tooldir: list of string
		:param funs: unused variable
		NR   (   t
   isinstanceR+   R   R   t	   load_toolt   hasattr(   R0   t   toolt   tooldirt   funst   it   module(    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR   c  s       c         C   s4   y |  i  |  i SWn t j
 o |  i  d SXd S(   s   Getter for the env propertyR   N(   R   R2   t   KeyError(   R0   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   get_envz  s    c         C   s   | |  i  |  i <d S(   s   Setter for the env propertyN(   R   R2   (   R0   t   val(    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   set_env  s    c         C   s   | d j o t d   n t | t i i  o
 | } n< t i i |  o |  i i	 |  } n |  i i	 |  } t | t
  o |  i t |  i |  n |  i t |  i |  d S(   s  
		Adds a dependency from a node object to a value::

			def build(bld):
				bld.add_manual_dependency(
					bld.path.find_resource('wscript'),
					bld.root.find_resource('/etc/fstab'))

		:param path: file path
		:type path: string or :py:class:`waflib.Node.Node`
		:param value: value to depend on
		:type value: :py:class:`waflib.Node.Node`, string, or function returning a string
		s   Invalid inputN(   R   t
   ValueErrorR   R   R   R   R3   R]   RD   RM   R+   R,   t   idt   extendt   append(   R0   R3   t   valueRT   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   add_manual_dependency  s    
c         C   sA   y |  i  SWn/ t j
 o# |  i i |  i  |  _  |  i  SXd S(   sE   Returns the launch directory as a :py:class:`waflib.Node.Node` objectN(   t   p_lnRP   RD   R^   R"   (   R0   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   launch_node  s
    c   	      C   s   | i  p | i } | p t i Sn t t |   t |  } y |  i } Wn  t j
 o h  } |  _ n' Xy |  i | SWn t j
 o n Xg  } | D] } | | | q ~ } t i	 |  } t
 i d t i |  |  | | | <| S(   s  
		Hash configuration set variables::

			def build(bld):
				bld.hash_env_vars(bld.env, ['CXX', 'CC'])

		:param env: Configuration Set
		:type env: :py:class:`waflib.ConfigSet.ConfigSet`
		:param vars_lst: list of variables
		:type vars_list: list of string
		s   envhash: %s %r(   t   tablet   parentR   RR   t   strR   t	   cache_envRP   R   t   h_listR   R   t   to_hex(	   R0   RX   t   vars_lstt   idxt   cachet   _[1]t   aRU   R;   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   hash_env_vars  s$    
	%
c         C   s   |  i  } | pP xM |  i D]> } x5 | D]- } y | | | i <Wq' t j
 o q' Xq' Wq Wn y | | SWn& t j
 o t i d |   n Xd S(   s   
		Retrieves a task generator from its name or its target name
		the name must be unique::

			def build(bld):
				tg = bld(name='foo')
				tg == bld.get_tgen_by_name('foo')
		s/   Could not find a task generator for the name %rN(   R!   R.   RW   RP   R   R   R=   (   R0   RW   R   t   gt   tg(    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   get_tgen_by_name  s    		
  c         C   s'  t  t |   } t i d 7_ t i t i d } d | | } t |  i  } d | | | f }	 |	 | | | | | f }
 d | | | f } t i   t  |
  t  |  d t  |  d t  |  } | d j  o
 d } n | | | d } d | d	 i |  } t i	 |
 | | f } | S(
   s1   
		Compute the progress bar used by ``waf -p``
		i   i   g      Y@s"   [%%%dd/%%%dd][%%s%%2d%%%%%%s][%s][s	   ][%s%s%s]i   i   t   =t   >(
   Rs   R   R   t   rot_idxt   rot_chrRl   R   t   get_term_colst   ljustt	   indicator(   R0   t   statet   totalt   col1t   col2t   nt   indt   pct   etat   fst   leftt   rightt   colst   ratiot   bart   msg(    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyRv     s    < 
c         O   s   t  i | |   S(   sR   
		Wrapper for :py:func:`waflib.TaskGen.declare_chain` provided for convenience
		(   R   t   declare_chain(   R0   R:   R1   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR     s    c         C   s+   x$ t  |  d g   D] } | |   q Wd S(   sj   Execute user-defined methods before the build starts, see :py:meth:`waflib.Build.BuildContext.add_pre_fun`t   pre_funsN(   R   (   R0   t   m(    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyRj     s     c         C   s+   x$ t  |  d g   D] } | |   q Wd S(   sv   Executes the user-defined methods after the build is successful, see :py:meth:`waflib.Build.BuildContext.add_post_fun`t	   post_funsN(   R   (   R0   R   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR|     s     c         C   s:   y |  i  i |  Wn t j
 o | g |  _  n Xd S(   s   
		Bind a method to execute after the scripts are read and before the build starts::

			def mycallback(bld):
				print("Hello, world!")

			def build(bld):
				bld.add_pre_fun(mycallback)
		N(   R   R   RP   (   R0   t   meth(    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   add_pre_fun  s    
c         C   s:   y |  i  i |  Wn t j
 o | g |  _  n Xd S(   s   
		Bind a method to execute immediately after the build is successful::

			def call_ldconfig(bld):
				bld.exec_command('/sbin/ldconfig')

			def build(bld):
				if bld.cmd == 'install':
					bld.add_pre_fun(call_ldconfig)
		N(   R   R   RP   (   R0   R   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   add_post_fun!  s    c         C   s[   |  i  p |  i   n | d j o |  i  |  i S| |  i j o |  i | S|  i  | S(   s   
		Get the group x, or return the current group if x is None

		:param x: name or number or None
		:type x: string, int or None
		N(   R.   t	   add_groupR   R-   R/   (   R0   RV   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt	   get_group1  s    
c         C   sP   t  | t i  p t  | t i  p t  |  | _ |  i |  i |  d S(   s,   add a task or a task generator for the buildN(	   R   R   R8   R   t   TaskBaset   AssertionErrorR6   R   R   (   R0   t   tgenR7   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR9   @  s    -	c         C   s^   t  | t  p |  i | } n x6 |  i D]+ } t |  i |  t |  j o | Sq+ Wd S(   s   name for the group g (utility)R   (   R   R+   R.   R/   R   (   R0   R   RV   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   get_group_nameG  s    
  	c         C   s`   t  |  } xM t t |  i   D]6 } x- |  i | D] } t  |  | j o | Sq6 Wq" Wd S(   s   
		Index of the group containing the task generator given as argument::

			def build(bld):
				tg = bld(name='nada')
				0 == bld.get_group_idx(tg)

		:param tg: Task generator object
		:type tg: :py:class:`waflib.TaskGen.task_gen`
		N(   R   t   rangeRs   R.   R   (   R0   R   t   seR   R   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   get_group_idxP  s      c         C   st   | o% | |  i  j o t i d |  n g  } | |  i  | <|  i i |  | o t |  i  d |  _ n d S(   s  
		Add a new group of tasks/task generators. By default the new group becomes the default group for new task generators.

		:param name: name for this group
		:type name: string
		:param move: set the group created as default group (True by default)
		:type move: bool
		s"   add_group: name %s already presenti   N(   R/   R   RQ   R.   R   Rs   R-   (   R0   RW   t   moveR   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR   b  s    c         C   s{   t  | t  o^ |  i | } xW t t |  i   D]3 } t |  t |  i |  j o | |  _ q3 q3 Wn
 | |  _ d S(   s  
		Set the current group to be idx: now new task generators will be added to this group by default::

			def build(bld):
				bld(rule='touch ${TGT}', target='foo.txt')
				bld.add_group() # now the current group is 1
				bld(rule='touch ${TGT}', target='bar.txt')
				bld.set_group(0) # now the current group is 0
				bld(rule='touch ${TGT}', target='truc.txt') # build truc.txt before bar.txt

		:param idx: group name or group index
		:type idx: string or int
		N(   R   R   R/   R   Rs   R.   R   R-   (   R0   R   R   R   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt	   set_groupu  s      c         C   sf   d } xY |  i  D]N } xE | D]= } y | t | i  7} Wq t j
 o | d 7} q Xq Wq W| S(   s   
		Approximate task count: this value may be inaccurate if task generators are posted lazily (see :py:attr:`waflib.Build.BuildContext.post_mode`).
		The value :py:attr:`waflib.Runner.Parallel.total` is updated during the task execution.
		i    i   (   R.   Rs   t   tasksRP   (   R0   R   R7   R   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR     s    
  c         C   s   g  } d } x |  i  i d  D] } |  i |  } | p t i d |   n |  i |  } | | j o | } | g } q | | j o | i |  q q W| | f S(   s   
		Return the task generator corresponding to the 'targets' list, used by :py:meth:`waflib.Build.BuildContext.get_build_iterator`::

			$ waf --targets=myprogram,myshlib
		i    t   ,s   target %r does not exist(   R%   t   splitR   R   R=   R   R   (   R0   t   to_postt   min_grpRW   R   R   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   get_targets  s     c         C   s+   g  } x |  i  D] } | i |  q W| S(   sx   
		Utility method, returns a list of all task generators - if you need something more complicated, implement your own
		(   R.   R   (   R0   RU   R   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   get_all_task_gen  s
    
 c         C   s  |  i  d j oI x|  i |  i D]0 } y | i } Wn t j
 o q! X|   q! Wnd|  i  o~ |  i |  i j  oI xd |  i |  i D]0 } y | i } Wn t j
 o q X|   q Wqx |  i D] } | i   q Wn |  i   } | i |  i	  o t
 i d  |  i } nG | i |  i  p3 t
 i d | i   |  i i   f  |  i } n xY |  i |  i D]G } y | i } Wn t j
 o qqX| i i |  o |   qqqqWd S(   s   
		Post the task generators from the group indexed by self.cur, used by :py:meth:`waflib.Build.BuildContext.get_build_iterator`
		t   *s6   Building from the build directory, forcing --targets=*s<   CWD %s is not under %s, forcing --targets=* (run distclean?)N(   R%   R.   t   curt   postRP   t   _min_grpt	   _exact_tgR   t   is_child_ofRb   R   t   warnR_   RK   R3   (   R0   R   RY   t   ln(    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt
   post_group  sF     
 
 & c         C   sY   g  } xL |  i  | D]= } y | i | i  Wq t j
 o | i |  q Xq W| S(   st   
		Return all the tasks for the group of num idx, used by :py:meth:`waflib.Build.BuildContext.get_build_iterator`
		(   R.   R   R   RP   R   (   R0   R   R   R   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   get_tasks_group  s     c         c   s;  d |  _  |  i o, |  i d j o |  i   \ |  _ |  _ n |  i t j oG x7 |  i  t |  i  j  o |  i	   |  i  d 7_  qR Wd |  _  n x |  i  t |  i  j  oy |  i t
 j o |  i	   n |  i |  i   } t i |  t i |  | |  _ |  i  d 7_  | p q n | Vq Wx g  Vq/d S(   s   
		Creates a generator object that returns lists of tasks executable in parallel (yield)

		:return: tasks which can be executed immediatly
		:rtype: list of :py:class:`waflib.Task.TaskBase`
		i    R   i   N(   R  R%   R   R  R  R   t	   POST_LAZYRs   R.   R  R   R	  R   t   set_file_constraintst   set_precedence_constraintst	   cur_tasks(   R0   R   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR     s.    	 
 	
N(1   t   __name__t
   __module__t   __doc__t   cmdR2   R   R5   t   propertyR   Ra   R<   R>   R?   R@   RA   R\   Rd   Rg   Rf   Re   R   Rr   R   R   R   RX   R   R   R   R   Rv   R   Rj   R|   R   R   R   R9   R   R   RH   R   R   R   R   R   R  R	  R   (    (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR   /   sX   	G									
		)	$							%																	)	t   instc           B   sh   e  Z d  Z d Z d   Z d   Z d   Z d   Z d   Z e	 d  Z
 d   Z d	   Z d
   Z RS(   sr   
    Special task used for installing files and symlinks, it behaves both like a task
	and like a task generator
	t   CYANc         C   s,   |  i  |  i g |  i } t i t |   S(   N(   t   destR3   t   sourceR   R   t   repr(   R0   RU   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   uid%  s    c         C   s5  g  } x|  i  D]} t | t i i  o
 | } n |  i i |  } | p t i o t i d |  n |  i	 i
 i |   } x |  i	 i
 i | D]\ } t | t  o' t |  t |   j o | i   n |  i i |  } | o Pq q Wt i d | |  i f   n | i |  q W| |  _ d S(   sB   
		Same interface as in :py:meth:`waflib.TaskGen.task_gen.post`
		s7   Could not find %s immediately (may cause broken builds)s   could not find %r in %rN(   R  R   R   R   R3   RM   R   t   verboseR  t	   generatorR6   R   R.   R  R   R  R   R=   R   t   inputs(   R0   t   bufRV   t   yR   R   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR  )  s(    
 

 *	 c         C   s1   t  t |   i   } | t i j o t i S| S(   s   
		Installation tasks are always executed, so this method returns either :py:const:`waflib.Task.ASK_LATER` or :py:const:`waflib.Task.RUN_ME`.
		(   R   R  t   runnable_statusR   t   SKIP_MEt   RUN_ME(   R0   R;   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR  B  s    c         C   s   d S(   s-   Return an empty string to disable the displayR   (    (   R0   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   __str__K  s    c         C   s   |  i  i   S(   s5   The attribute 'exec_task' holds the method to execute(   R  t	   exec_task(   R0   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   runO  s    c         C   s   t  i |  i |  i  } | i d t i  } | oH t i i	 o; t i
 i t i i	 t i
 i |  d i t i   } n | S(   s   
		Installation path obtained from ``self.dest`` and prefixed by the destdir.
		The variables such as '${PREFIX}/bin' are substituted.
		RC   i   (   R   t
   subst_varsR  RX   RJ   R   R   R   R#   t   destdirR3   R4   t
   splitdrivet   lstrip(   R0   R%  R  (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   get_install_pathS  s
    ;c         C   s   |  i    } | p t i d |  i   n x t |  i |  i  D] \ } } |  i o> t i	 i
 | | i |  i	   } t i t i	 i |   n t i	 i
 | | i  } |  i i i | i   | |  i  qC Wd S(   s,   
		Predefined method for installing files
		s   unknown installation path %rN(   R(  R   R=   R  t   zipR  R  t   relative_trickR   R3   R4   RI   R   t	   check_dirt   dirnameRW   R6   t
   do_installRK   t   chmod(   R0   t   destpathRV   R  t   destfile(    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   exec_install_files^  s     
!c         C   s9   |  i    } |  i i i |  i d i   | |  i  d S(   sA   
		Predefined method for installing one file with a given name
		i    N(   R(  R  R6   R-  R  RK   R.  (   R0   R0  (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   exec_install_asm  s    c         C   s)   |  i    } |  i i i |  i |  d S(   s0   
		Predefined method for installing a symlink
		N(   R(  R  R6   t   do_linkt   link(   R0   R0  (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   exec_symlink_ast  s    (   R  R  R  t   colorR  R  R  R!  R#  RH   R(  R1  R2  R5  (    (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR    s   								t   InstallContextc           B   s   e  Z d  Z d Z d   Z e i d  Z d   Z d   Z	 d	 e i e d	 e e d  Z d	 e i d	 e e d  Z d	 d	 e e d  Z RS(
   s"   installs the targets on the systemt   installc         K   s,   t  t |   i |   g  |  _ t |  _ d  S(   N(   R   R7  R   t	   uninstallt   INSTALLR   (   R0   R1   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR     s    	c   	      C   s  t  i i |  \ } } | p t i d | | f   n t i |  | i |  i i	   t  i
 d  } t i i p y" t  i |  } t  i |  } Wn t j
 o qX| i d | i j o= | i | i j o* |  i p t i d | | f  n t Sn |  i p t i d | | f  n y t  i |  Wn t j
 o n Xy$ t i | |  t  i | |  Wnd t j
 oX y t  i |  Wn* t t f j
 o t i d |  n Xt i d |   n Xd S(	   s%  
		Copy a file from src to tgt with given file permissions. The actual copy is not performed
		if the source and target file have the same size and the same timestamps. When the copy occurs,
		the file is first removed and then copied (prevent stale inodes).

		This method is overridden in :py:meth:`waflib.Build.UninstallContext.do_install` to remove the file.

		:param src: file name as absolute path
		:type src: string
		:param tgt: file destination, as absolute path
		:type tgt: string
		:param chmod: installation mode
		:type chmod: int
		s!   Invalid installation given %r->%rR   i   s   - install %s (from %s)s   + install %s (from %s)s   File %r does not exists   Could not install the file %rN(   R   R3   R   R   R=   R   R+  RJ   R_   RK   R   R   R#   t   forceR   R   t   st_mtimet   st_sizeR)   R   Rh   t   Falset   removet   shutilt   copy2R.  RO   RQ   (	   R0   t   srct   tgtR.  t   dt   _t   srclblt   st1t   st2(    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR-    s<    "*
	
c         C   s   t  i i |  \ } } t i |  t } t  i i |  p
 t } n! t  i |  | j o
 t } n | o` y t  i	 |  Wn t
 j
 o n X|  i p t i d | | f  n t  i | |  n& |  i p t i d | | f  n d S(   s  
		Create a symlink from tgt to src.

		This method is overridden in :py:meth:`waflib.Build.UninstallContext.do_link` to remove the symlink.

		:param src: file name as absolute path
		:type src: string
		:param tgt: file destination, as absolute path
		:type tgt: string
		s   + symlink %s (to %s)s   - symlink %s (to %s)N(   R   R3   R   R   R+  R>  t   islinkRH   t   readlinkR?  R   R)   R   Rh   t   symlink(   R0   RB  RC  RD  RE  R4  (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR3    s"    

  

c         C   sP   | i    | p; | i   t i j o |  i d |   n | i   n d S(   s\  
		This method is called by :py:meth:`waflib.Build.InstallContext.install_files`,
		:py:meth:`waflib.Build.InstallContext.install_as` and :py:meth:`waflib.Build.InstallContext.symlink_as` immediately
		after the installation task is created. Its role is to force the immediate execution if necessary, that is when
		``postpone=False`` was given.
		s   cannot post the task %rN(   R  R  R   t	   ASK_LATERR=   R#  (   R0   t   tskt   postpone(    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   run_task_now  s
    
c	   
      C   s   t  d | p |  i  }	 |  |	 _ | p |  i |	 _ | |	 _ t | t i i  o | g |	 _ n t	 i
 |  |	 _ | |	 _ |	 i |	 _ | |	 _ | o |  i |	  n |  i |	 |  |	 S(   s  
		Create a task to install files on the system::

			def build(bld):
				bld.install_files('${DATADIR}', self.path.find_resource('wscript'))

		:param dest: absolute path of the destination directory
		:type dest: string
		:param files: input files
		:type files: list of strings or list of nodes
		:param env: configuration set for performing substitutions in dest
		:type env: Configuration set
		:param relative_trick: preserve the folder hierarchy when installing whole folders
		:type relative_trick: bool
		:param cwd: parent node for searching srcfile, when srcfile is not a :py:class:`waflib.Node.Node`
		:type cwd: :py:class:`waflib.Node.Node`
		:param add: add the task created to a build group - set ``False`` only if the installation task is created after the build has started
		:type add: bool
		:param postpone: execute the task immediately to perform the installation
		:type postpone: bool
		RX   (   R  RX   R6   R3   R.  R   R   R   R  R   t   to_listR  R1  R"  R*  R9   RO  (
   R0   R  t   filesRX   R.  R*  t   cwdt   addRN  RM  (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR?     s    				 c   	      C   s   t  d | p |  i  } |  | _ | p |  i | _ | | _ | g | _ | | _ | i | _ | o |  i	 |  n |  i
 | |  | S(   s  
		Create a task to install a file on the system with a different name::

			def build(bld):
				bld.install_as('${PREFIX}/bin', 'myapp', chmod=Utils.O755)

		:param dest: absolute path of the destination file
		:type dest: string
		:param srcfile: input file
		:type srcfile: string or node
		:param cwd: parent node for searching srcfile, when srcfile is not a :py:class:`waflib.Node.Node`
		:type cwd: :py:class:`waflib.Node.Node`
		:param env: configuration set for performing substitutions in dest
		:type env: Configuration set
		:param add: add the task created to a build group - set ``False`` only if the installation task is created after the build has started
		:type add: bool
		:param postpone: execute the task immediately to perform the installation
		:type postpone: bool
		RX   (   R  RX   R6   R3   R.  R  R  R2  R"  R9   RO  (	   R0   R  t   srcfileRX   R.  RR  RS  RN  RM  (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR@     s    			 c         C   s   t  i o d St d | p |  i  } |  | _ | | _ | p |  i | _ g  | _ | | _ | i	 | _
 | o |  i |  n |  i | |  | S(   sk  
		Create a task to install a symlink::

			def build(bld):
				bld.symlink_as('${PREFIX}/lib/libfoo.so', 'libfoo.so.1.2.3')

		:param dest: absolute path of the symlink
		:type dest: string
		:param src: absolute or relative path of the link
		:type src: string
		:param env: configuration set for performing substitutions in dest
		:type env: Configuration set
		:param add: add the task created to a build group - set ``False`` only if the installation task is created after the build has started
		:type add: bool
		:param postpone: execute the task immediately to perform the installation
		:type postpone: bool
		NRX   (   R   R   R  RX   R6   R  R3   R  R4  R5  R"  R9   RO  (   R0   R  RB  RX   RR  RS  RN  RM  (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyRA   +  s    
				 N(   R  R  R  R  R   R   t   O644R-  R3  RO  R   R>  RH   R?   R@   RA   (    (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR7  {  s   	6		%t   UninstallContextc           B   s>   e  Z d  Z d Z d   Z e i d  Z d   Z d   Z	 RS(   s   removes the targets installedR9  c         K   s#   t  t |   i |   t |  _ d  S(   N(   R   RV  R   t	   UNINSTALLR   (   R0   R1   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR   Q  s    c         C   s  |  i  p t i d |  n |  i i |  y t i |  Wn t j
 o~ } | i t i	 j ob t
 |  d d  p t |  _ t i d  n t i d j o! t i d | i | i f  q q n XxF | o> t i i |  } y t i |  Wq t j
 o Pq Xq Wd S(   s5   See :py:meth:`waflib.Build.InstallContext.do_install`s   - remove %st   uninstall_errorsH   build: some files could not be uninstalled (retry with -vv to list them)i   s#   could not remove %s (error code %r)N(   R)   R   Rh   R9  R   R   R?  R   t   errnot   ENOENTR   R   RH   RX  R  R  t   filenameR3   R,  t   rmdir(   R0   RB  RC  R.  R   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR-  U  s&    
	* c         C   s   y0 |  i  p t i d |  n t i |  Wn t j
 o n XxF | o> t i i |  } y t i |  WqI t j
 o PqI XqI Wd S(   s2   See :py:meth:`waflib.Build.InstallContext.do_link`s   - unlink %sN(	   R)   R   Rh   R   R?  R   R3   R,  R\  (   R0   RB  RC  (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR3  m  s    
 c         C   sm   zL d   } t  t i d t i i  t  t i d |  t t |   i   Wd t  t i d t i i  Xd S(   s3   
		See :py:func:`waflib.Context.Context.execute`
		c         S   s   t  i S(   N(   R   R  (   R0   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR    s    t   runnable_status_backR  N(   R   R   R  R   RV  Rg   R]  (   R0   R  (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyRg   ~  s    	(
   R  R  R  R  R   R   RU  R-  R3  Rg   (    (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyRV  M  s   		t   CleanContextc           B   s&   e  Z d  Z d Z d   Z d   Z RS(   s   cleans the projectt   cleanc         C   sU   |  i    |  i p |  i   n |  i |  i g  z |  i   Wd |  i   Xd S(   s3   
		See :py:func:`waflib.Context.Context.execute`
		N(   Re   R   R\   Ri   R   R_  R   (   R0   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyRg     s    

c      	   C   s   t  i d  |  i |  i j o g  } |  i t D] } | |  i i |  q2 ~ } xH |  i i d d d d t	 D]$ } | | j o qs n | i
   qs Wn h  |  i _ x$ d i   D] } t |  | h   q Wd S(   sG   Remove files from the build directory if possible, and reset the cachess   build: clean calleds   **/*t   excls*   .lock* *conf_check_*/** config.log c4che/*RB   s   node_deps task_sigs raw_depsN(   R   R   Rb   R_   RX   RL   RD   t   find_or_declareRF   RH   t   deletet   childrenR   R   (   R0   R   RY   RU   R   t   v(    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR_    s    4  (   R  R  R  R  Rg   R_  (    (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR^    s   	t   ListContextc           B   s   e  Z d  Z d Z d   Z RS(   s   lists the targets to executeR+   c      	   C   s  |  i    |  i p |  i   n |  i |  i g  |  i   t i   |  _ xL |  i	 D]A } x8 | D]0 } y | i
 } Wn t j
 o qe X|   qe WqX Wy |  i d  Wn t j
 o n Xt |  i i    } | i   x | D] } t i d |  q Wd S(   s4   
		See :py:func:`waflib.Context.Context.execute`.
		R   t   GREENN(   Re   R   R\   Ri   R   Rj   R   Rk   Rl   R.   R  RP   R   R   R+   R!   t   keyst   sortR   t   pprint(   R0   R   R   RY   RU   R:   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyRg     s0    



  
 (   R  R  R  R  Rg   (    (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyRe    s   t   StepContextc           B   s/   e  Z d  Z d Z d   Z d   Z d   Z RS(   s7   executes tasks in a step-by-step fashion, for debuggingt   stepc         K   s)   t  t |   i |   t i i |  _ d  S(   N(   R   Rj  R   R   R#   RQ  (   R0   R1   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyR     s    c         C   s  |  i  p t i d  t i |   d Sd } |  i o& |  i d j o |  i i d  } n x|  i D]} xV | D]N } | o | i	 | j o qv n y | i
 } Wn t j
 o qv X|   qv Wx$|  i  i d  D]} |  i |  } x | D] } t | t i  o | g } n
 | i } x | D] } t }	 x8 t | d g   D]$ }
 | |
 d t o t }	 PqLqLWx8 t | d g   D]$ }
 | |
 d t o t }	 PqqW|	 o- | i   } t i d t |  | f  q-q-Wq Wq Wqi Wd S(	   s  
		Compile the tasks matching the input/output files given (regular expression matching). Derived from :py:meth:`waflib.Build.BuildContext.compile`::

			$ waf step --files=foo.c,bar.c,in:truc.c,out:bar.o
			$ waf step --files=in:foo.cpp.1.o # link task only

		sL   Add a pattern for the debug build, for example "waf step --files=main.c,app"NR   R   R  t   outputt   outputss   %s -> exit %r(   RQ  R   R  R   Rr   R   R%   R   R.   RW   R  RP   t   get_matcherR   R   R   R   R>  R   RH   R#  Rh   R   (   R0   R%   R   R   RY   t   patt   matcherRU   RM  t   do_execRT   R;   (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyRr     sT    

    	  	 	c            s   t   t   | i d  o t  | i d d  } n- | i d  o t  | i d d  } n |  i i |   d     pO | i d  p d | } n | i d  p d | } n t i	 |    n      f d   } | S(	   Ns   in:R   s   out:t   ^s   ^.+?%st   $s   %s$c            s]   | t  j o  o t S| t j o  o t S o  |  j S  i |  i    Sd  S(   N(   RH   R>  t   matchRK   (   RT   Rl  (   t   patternt   innt   anodet   out(    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyRt  !  s    (
   RH   t
   startswithR>  RJ   RD   RE   R   t   endswitht   reRr   (   R0   Ro  Rt  (    (   Ru  Rv  Rw  Rx  s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyRn    s$    
(   R  R  R  R  R   Rr   Rn  (    (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyRj    s
   		2((   R  R   Rm   RY  R{  R@  R   t   ImportErrort   pickleR   R    R   R   R   R   R   R   R   R   t   waflib.NodeR   RG   R:  RW  R   R   RL   R   R
  t	   POST_BOTHR   R  R7  RV  R^  Re  Rj  t   nogcR   Re   (    (    (    s9   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/Build.pyt   <module>
   s6   <@  ]@!%Z