File: //proc/self/root/lib/python3.9/site-packages/cockpit/__pycache__/beiboot.cpython-39.opt-1.pyc
a
���e�, � @ s� d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl m
Z
d dlmZm
Z
mZmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d d lmZ d d
lmZ d dlmZ d dl m!Z!m"Z" d d
l#m$Z$ d dl%m&Z& d dl'm(Z(m)Z) d dl*m+Z+ e�,e-�Z.e
d�dd�Z/e
e0 d�dd�Z1G dd� de"�Z2ddiej3�Z3G dd� de)�Z4G dd� dej5�Z6G dd� de$�Z7G d d!� d!e(�Z8dd�d"d#�Z9dd�d$d%�Z:e-d&k�r�e:� dS )'� N)�Path)�Dict�Iterable�Optional�Sequence)� polyfills)�ferny)�
bootloader)�BridgeBeibootHelper)�
setup_logging)�ChannelRoutingRule)�PackagesChannel)�
JsonObject)�Packages�PackagesLoader)�Peer)�CockpitProblem)�Router�RoutingRule)�StdioTransport��returnc C s� t j�tj�d } | �� }tj�d�}|d u r:tj �
d�}tj|dd� t|d�}t
�d|� z:|�� |krzt
�d� t�|�� jd @ s�t
�d
� t�W n4 ttfy� t
�d� |�|� |�d� Y n0 |S )
Nzinteraction_client.pyZXDG_CACHE_HOMEz~/.cacheT)�exist_okzcockpit-client-askpasszChecking if %s exists...z. ... it exists but is not the same version...�@ z; ... it has the correct contents, but is not executable...z ... writing contents.i� )� importlibZ resources�filesr �__name__�
read_bytes�os�environ�get�path�
expanduser�makedirsr �logger�debug�
ValueError�stat�st_mode�FileNotFoundError�write_bytes�chmod)Zsrc_pathZsrc_dataZxdg_cache_homeZ dest_path� r, �3/usr/lib/python3.9/site-packages/cockpit/beiboot.py�ensure_ferny_askpass. s(
r. c c s<