File: //opt/saltstack/salt/lib/python3.10/site-packages/relenv/__pycache__/relocate.cpython-310.pyc
o
�N�g. � @ s� d Z ddlZddlZddlZddlZddlZe�e�Zg d�Z dZ
dZdZdd� Z
d d
� Zdd� Zd
d� Zdd� Zdd� Zdd� Zdd� Zd#dd�Zd$dd�Z d%dd�Zed krmddlZeed!�sfed"��eej� dS dS )&zO
A script to ensure the proper rpaths are in place for the relenv environment.
� N)zlinux-vdso.so.1z libc.so.6�
librt.so.1z libm.so.6z
libmd.so.0zlibpthread.so.0z
libdl.so.2zlibmemusage.sozlibnsl.so.1zlibnss_compat.so.2zlibnss_db.so.2zlibnss_dns.so.2zlibnss_files.so.2zlibnss_hesiod.so.2zlibpcprofile.so.2zlibresolv.so.2r zlibthread_db.so.1zlibutil.so.1zlibutil.so.2z
libgcc_s.so.2z
libgcc_s.so.1�LC_ID_DYLIB�
LC_LOAD_DYLIB�LC_RPATHc C sB t | d��}|�d�}W d � |dv S 1 sw Y |dv S )z�
Determines whether the given file is a macho file.
:param path: The path to the file to check
:type path: str
:return: Whether the file is a macho file
:rtype: bool
�rb� N)s ���open�read��path�fp�magic� r �C/opt/saltstack/salt/lib/python3.10/site-packages/relenv/relocate.py�is_macho2 s
��r c C sB t | d��}|�d�}W d � |dkS 1 sw Y |dkS )z�
Determines whether the given file is an ELF file.
:param path: The path to the file to check
:type path: str
:return: Whether the file is an ELF file
:rtype: bool
r r Ns ELFr r r r r �is_elfB s
��r c C s� d}d}d}i }dd� | � d�D �D ]U}|sq|� � d dkrId}|r6||vr+g ||<