
    =e                         d dl mZ d dlZd dlZd dlZd dlZd dlZd dlmZ d dl	m
Z
 d dlmZ ddlmZ dd	d
Z ej        d          Zd Zd Zd Zd Zd Zedk    r e             dS dS )    )print_functionN)pprint)rmtree)extract   )data_uri_fromdarwinwin32)osxwinz^([=><]+)(.*)$c                    g }| D ]t}|                                 }|                    dd          }t          |          dk    r|\  }|                    |g d           ]t          |          dk    rv|\  }}|                    d          r
|dd         }t
                              |          }|r|                                \  }}nd}|                    |||ggd           t          |          d	k    r{|\  }}}|                    d          r
|dd         }t
                              |          }|r|                                \  }}nd}|                    |d|d
|ggd           vd|iS )z:
    Format dependencies into a common binstar format
        )namespecsr   *Nz==   +depends)stripsplitlenappendendswithspecs_rematchgroups)	depsr   dep	name_specr   specr   operator	build_strs	            Dlib/python3.11/site-packages/binstar_client/inspect_package/conda.pytransform_conda_depsr&      s    G [ [iikkIIc1%%	y>>QEDNND2667777^^q  "JD$}}S!! !CRCyNN4((E  !&$$NNDXt4D3EFFGGGG^^q  $-!D$	}}S!! !CRCyNN4((E  !&$$NNDTdddII;V4W3XYYZZZw    c                     	 | d         S # t           $ rP |                     d          }|Y dS ddd}|                     d          d	|                    ||          cY S w xY w)
a  
    Return the sub-directory given the index dictionary.  The return
    value is obtained in the following order:

    1. when the 'subdir' key exists, it's value is returned
    2. if the 'arch' is None, or does not exist, 'noarch' is returned
    3. otherwise, the return value is constructed from the 'platform' key
       and the 'arch' key (where 'x86' is replaced by '32',
       and 'x86_64' by '64')
    subdirarchNnoarch3264)x86x86_64platform-)KeyErrorget)indexr*   	intel_maps      r%   
get_subdirr6   <   s    LX L L Lyy  <88 D11	))J////tT1J1J1JKKKKLs   
 !A$3A$#A$c                 
    d" fd	} |dd           }|t          d           |d          }|r|                    di           n |di           }t          j                            t          j                             d                    }|                    dd           }|r t          j                             |          nd }|r.t          j                            |          rt          |          }t          |          }	|                    d	d           }
|                    d
d           }t                              ||          }|	                    d          |                    dd          |                    dd          |                    d          |                    d          |                    d          |                    d          |                    d          |                    d          |                    d          d
}|	                    d          |                    d          |                    dd          |                    dd          |                    d          |                    d          |                    d          |                    d          |                    d          ||                    d          |                    d          |                    d          d}|	d|||
|
d|||	dd}|d         
                    |           |                    d|                    d g                     }t          |          |d!<   |||fS )#Nc                     t           j                            |           }t           j                            |          r=t	          |d          5 }t          j        |          cd d d            S # 1 swxY w Y   |S )Nzutf-8)encoding)ospathjoinexistsopenjsonload)filenamedefault	file_pathfile	info_paths       r%   _loadz%inspect_conda_info_dir.<locals>._loadR   s    GLLH55	7>>)$$ 	'i'222 'dy' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 's   A33A7:A7z
index.jsonz)info/index.json required in conda packagezrecipe.jsonaboutz
about.json
has_prefixiconr*   r0   r   summary descriptionlicenselicense_urllicense_familydev_urldoc_urlhomesource_git_url)
r   rJ   rL   rM   rN   rO   rP   rQ   rR   rS   versionsource_git_tag)rT   	home_pagerL   rJ   rP   rQ   rR   rS   rU   rI   rM   rN   rO   /z-any-)operatingsystemmachineztarget-tripletrH   r)   )basenameattrsr[   r   requiresdependencies)N)	TypeErrorr3   r:   r;   r=   r<   r   r6   os_mappopupdater&   )rE   rZ   rF   r4   reciperG   rH   icon_b64	icon_pathr)   rY   r0   rX   package_datarelease_data	file_dataconda_dependss   `                r%   inspect_conda_info_dirri   Q   sX         E,%%E}CDDDU=!!F'-JFJJw###55r3J3JEY E EFFJ yy&&H5=GY1114I ,RW^^I.. , ++Fii%%GyyT**Hjj844O 		&!!99Y++yy3399Y''yy//))$45599Y''99Y''		&!!))$455 L 99Y''YYv&&yy3399Y++99Y''99Y''		&!!))$455))$45599Y''yy//))$455 L   &vvxx0.-4WWooF$
 
	 	I ge$$$IIi:r)B)BCCM 4] C CIny00r'   c                    t          j                    }t          | |d           t          j                            |d          }t          |t          j                            |                     \  }}}t          |           |||fS )Ninfo)
components)	tempfilemkdtempr   r:   r;   r<   ri   rZ   r   )rA   argskwargstmpdirinfo_dirre   rf   rg   s           r%   inspect_conda_packagers      sy    FHf0000w||FF++H,B8RWM]M]^fMgMg,h,h)L,	
6NNNy00r'   c                  6   t           j        d         } t          |           5 }t          | |          \  }}}d d d            n# 1 swxY w Y   t	          |           t          d           t	          |           t          d           t	          |           d S )Nr   z--)sysargvr>   rs   r   print)rA   fileobjre   rf   rg   s        r%   mainry      s    x{H	h Y70EhPW0X0X-lIY Y Y Y Y Y Y Y Y Y Y Y Y Y Y
<	$KKK
<	$KKK
9s   AA
A__main__)
__future__r   os.pathr:   r?   reru   rm   r   shutilr   conda_package_handling.apir   utils.notebook.data_urir   r_   compiler   r&   r6   ri   rs   ry   __name__ r'   r%   <module>r      s&   & % % % % %   				 



              . . . . . . 3 3 3 3 3 3 '	*	*2:&''$  $  $ NL L L*G1 G1 G1T	1 	1 	1   zDFFFFF r'   