��
r�$Lc�����������@���s����d��Z��d�Z�d�d�k�Z�d�d�k�Z�d�d�k�Z�d�d�k�Z�e�Z	�e
�Z�e
�Z�e
�Z
�d����Z�d����Z�e�i�i�e�e���Z�e�i�i�e�d���Z�d����Z�e�i�i�e�d���Z�d�e�f�d�������YZ�d�S(	���s;���src/engine/SCons/CacheDir.py 5023 2010/06/14 22:05:46 sconss���
CacheDir support
i����Nc���	������C���s���|��d�}�|�i��}�|�i����}�|�i�|���\�}�}�|�i�|���p�|�i�d�|�|���d�S|�i�d�|�|���t�i�i�o��|�i�|���o �|�i	�|�i
�|���|�i���n�|�i�|�|�i���|�i
�|���}�|�i�|�i�t
�i�|�t
�i���t
�i�B��n�d�S(���Ni����s$���CacheRetrieve(%s):  %s not in cache
i���s'���CacheRetrieve(%s):  retrieving from %s
(���t���fst���get_CacheDirt	���cachepatht���existst
���CacheDebugt���SConst���Actiont���execute_actionst���islinkt���symlinkt���readlinkt���patht���copy_from_cachet���statt���chmodt���S_IMODEt���ST_MODEt���S_IWRITE(	���t���targett���sourcet���envt���tR����t���cdt���cachedirt	���cachefilet���st(����(����s1���install/lib/scons-2.0.0.final.0/SCons/CacheDir.pyt���CacheRetrieveFunc)���s����
	
 .c���������C���sW���|��d�}�|�i��}�|�i����}�|�i�|���\�}�}�|�i��i�|���o�d�|�i�Sd��S(���Ni����s���Retrieved `%s' from cache(���R����R���R���R���R���t���None(���R���R���R���R���R����R���R���R���(����(����s1���install/lib/scons-2.0.0.final.0/SCons/CacheDir.pyt���CacheRetrieveString;���s����
	c���������C���s���|��d�}�|�i��o�d��S|�i�}�|�i����}�|�i�|���\�}�}�|�i�|���o�|�i�d�|�|���d��S|�i�d�|�|���|�d�t�t�i������}�d�}	�|�i	�|���pg�y�|�i
�|���Wqt�j
�oC�|�i	�|���p,�|	�t�|����|�f�}
�t�i
�i�|
�����qqXn�y��|�i�|�i���o �|�i�|�i�|�i���|���n�|�i�|�i�|���|�i�|�|���|�i�|�i���}�|�i�|�t�i�|�t�i���t�i�B��WnB�t�j
�o6�|	�t�|����|�f�}
�t�i�i�t�i�i�|
���n�Xd��S(���Ni����s+���CachePush(%s):  %s already exists in cache
s���CachePush(%s):  pushing to %s
s���.tmps,���Unable to copy %s to cache. Cache file is %s(���t���nocacheR����R���R���R���R���t���strt���ost���getpidt���isdirt���makedirst���EnvironmentErrorR���t���ErrorsR���R���R	���R
���t���copy2t���renameR
���R���R���R���R���t���Warningst���warnt���CacheWriteErrorWarning(���R���R���R���R���R����R���R���R���t���tempfilet���errfmtt���msgR���(����(����s1���install/lib/scons-2.0.0.final.0/SCons/CacheDir.pyt
���CachePushFuncH���s:����

	 +t���CacheDirc�����������B���sG���e��Z�d�����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d����Z�RS(���c���������C���sm���y�d�d��k��}�Wn;�t�j
�o/�d�}�t�i�i�t�i�i�|���d��|��_�n�X|�|��_�d��|��_�d��|��_	�d��S(���Ni����s<���No hashlib or MD5 module available, CacheDir() not supported(
���t���hashlibt���ImportErrorR���R'���R(���t���NoMD5ModuleWarningR���R���t���current_cache_debugt���debugFP(���t���selfR���R/���R,���(����(����s1���install/lib/scons-2.0.0.final.0/SCons/CacheDir.pyt���__init__~���s����		c���������C���s����t��|��i�j�oP�t��d�j�o�t�i�|��_�n'�t��o�t�t��d���|��_�n
�d��|��_�t��|��_�n�|��i�o.�|��i�i�|�|�t�i	�i
�|���d�f���n�d��S(���Nt���-t���wi���(���t���cache_debugR2���t���syst���stdoutR3���t���openR���t���writeR���R���t���split(���R4���t���fmtR���R���(����(����s1���install/lib/scons-2.0.0.final.0/SCons/CacheDir.pyR�������s����
	

c���������C���s���t��o
�|��i�d��j	�S(���N(���t
���cache_enabledR���R���(���R4���(����(����s1���install/lib/scons-2.0.0.final.0/SCons/CacheDir.pyt
���is_enabled����s����c���������C���s_���|��i�����p�d�S|�i����}�|�d�i����}�t�i�i�|��i�|���}�|�t�i�i�|�|���f�S(���s	���
        i����N(���NN(���R@���R���t���get_cachedir_bsigt���upperR���R���t���join(���R4���t���nodet���sigt���subdirt���dir(����(����s1���install/lib/scons-2.0.0.final.0/SCons/CacheDir.pyR�������s����
c���������C���s����|��i�����p�t�S|�i����}�t�o>�t�|�g��|�d�d��d�j�o�|�i�d�d�d�d���t�Sn%�t�|�g��|�d�d��d�j�o�t�St�S(���sS��
        This method is called from multiple threads in a parallel build,
        so only do thread safe stuff here. Do thread unsafe stuff in
        built().

        Note that there's a special trick here with the execute flag
        (one that's not normally done for other actions).  Basically
        if the user requested a no_exec (-n) build, then
        SCons.Action.execute_actions is set to 0 and when any action
        is called, it does its showing but then just returns zero
        instead of actually calling the action execution operation.
        The problem for caching is that if the file does NOT exist in
        cache then the CacheRetrieveString won't return anything to
        show for the task, but the Action.__call__ won't call
        CacheRetrieveFunc; instead it just returns zero, which makes
        the code below think that the file *was* successfully
        retrieved from the cache, therefore it doesn't do any
        subsequent building.  However, the CacheRetrieveString didn't
        print anything because it didn't actually exist in the cache,
        and no more build actions will be performed, so the user just
        sees nothing.  The fix is to tell Action.__call__ to always
        execute the CacheRetrieveFunc and then have the latter
        explicitly check SCons.Action.execute_actions itself.
        t���executei���i����t���presub(���R@���t���Falset
���get_build_envt
���cache_showt���CacheRetrieveSilentt���buildt���Truet
���CacheRetrieve(���R4���RD���R���(����(����s1���install/lib/scons-2.0.0.final.0/SCons/CacheDir.pyt���retrieve����s����
	c���������C���s(���|��i�����p�d��St�|�g��|�i������S(���N(���R@���t	���CachePushRK���(���R4���RD���(����(����s1���install/lib/scons-2.0.0.final.0/SCons/CacheDir.pyt���push����s����
c���������C���s���t��o�|��i�|���Sd��S(���N(���t���cache_forceRS���(���R4���RD���(����(����s1���install/lib/scons-2.0.0.final.0/SCons/CacheDir.pyt���push_if_forced����s����(	���t���__name__t
���__module__R5���R���R@���R���RQ���RS���RU���(����(����(����s1���install/lib/scons-2.0.0.final.0/SCons/CacheDir.pyR.���|���s���					'	(���t���__revision__t���__doc__t���os.pathR���R
���R9���t���SCons.ActionR���RO���R?���RJ���R8���RT���RL���R���R���R���RP���R���RM���R-���RR���t���objectR.���(����(����(����s1���install/lib/scons-2.0.0.final.0/SCons/CacheDir.pyt���<module>���s ���				2