
    xhe	                     `    d dl Z d dlZd dlmZ d dlmZmZmZ ddlmZ ddl	m
Z
 d
dZ	 d
d	ZdS )    N)glob)
expanduserisfilejoin   )root_dir)on_winFc           	      ~    d }t           rt          t          d          t          t          d          t          t          d          t          t          d          ga|rHt          |d          t          |d          t          |d          t          |d          gt          dd<   nAt          t          d          ga|r)t                              dt          |d                     t                              t          j        d                             t          j	                             t           rd}nd	}g }t          D ]}|D ]|}t          t          | |z                       }t          |          rKt          j        |          }	t           s|	j        t          j        z  r|r|                    |           x|} n}|snt!           fd
dD                       rSt#          t          j                            |           d          }
|
r"|r|                    |
           n
|
d         } n|r n|p|S )NScriptszLibrary\mingw-w64\binzLibrary\usr\binzLibrary\binr   binPATH)z.exez.bat )r   c                     g | ]}|v S  r   ).0f
executables     =lib/python3.11/site-packages/conda_build/os_utils/external.py
<listcomp>z#find_executable.<locals>.<listcomp>8   s    HHH1qJHHH    )*?.T)	recursive)r	   r   r   	dir_pathsinsertextendosenvironsplitpathsepr   r   statst_modeS_IEXECappendanyr   path)r   prefixall_matchesresultextsall_matches_founddir_pathextr'   stmatchess   `          r   find_executabler1      s\    F 59%%455.//>**	
	  	VY''V677V011V^,,	IacN 5!!
	  	5QVU 3 3444RZ'--bj99::: #   		 		Cd8Z#-=>>??Dd|| WT]] RZ$,6 " )006666!% 	#HHHHHHHII 	27<<*==NNNG  %,,W5555$QZFE 	E	&&&r   c                     t          d| z   ||          }|s-t          t          j                            |           |          }|S )Nr   )r1   r   r'   basename)r   build_prefixr)   founds       r   #find_preferably_prefixed_executabler6   E   sI     C*,lKHHE L   0 0 < <lKKLr   )NF)r   r"   r   os.pathr   r   r   conda_interfacer   utilsr	   r1   r6   r   r   r   <module>r:      s    
			        , , , , , , , , , , & & & & & &      6' 6' 6' 6't 05     r   