B
    '\]
                 @   s   d dl mZmZmZmZ d dlmZ d dlmZ d dl	m	Z	 d dl
mZ d dlZddlmZ d	d
lmZ eeZedd ZdS )    )absolute_importdivisionprint_functionunicode_literals)OrderedDict)exists)glob)	getLoggerN   )memoize   )	iteritemsc           	   C   sN  t jdsdS ddlm} m}m} tddg}d}xnt|D ]b\}}||kst|| |kstt	d||| || f yt
| |}W n tk
r   Y q>X |r>P q>W |sd	\}}td
|| ||fS |d\}}|dkrFtd}	xD|	D ]<}
||
}
t|
r|
dr|drd}nd}||fS qW d}td|| ||fS ||fS )zN
    If on linux, returns (libc_family, version), otherwise (None, None).
    Zlinux)NNr   )confstrconfstr_namesreadlink)CS_GNU_LIBC_VERSIONr   )CS_GNU_LIBPTHREAD_VERSIONr
   NzAconfstr_names_fallback for %s is %s yet in confstr_names it is %s)Zglibcz2.5z8Failed to detect libc family and version, assuming %s/%s ZNPTLz/lib/libc.so*Z	libuClibcz0.ZuClibcz	uClibc-ngz3Failed to detect non-glibc family, assuming %s (%s))sysplatform
startswithosr   r   r   r   r   AssertionErrorstr	ExceptionlogZwarningsplitr   r   )r   r   r   Zconfstr_names_fallbackvalkvZfamilyversionZclibsZclib r!   4lib/python3.7/site-packages/conda/common/os/linux.pylinux_get_libc_version   sF    


r#   )Z
__future__r   r   r   r   collectionsr   genericpathr   r   Zloggingr	   r   Z_vendor.auxlib.decoratorsr   compatr   __name__r   r#   r!   r!   r!   r"   <module>   s   