%PDF- %PDF-
| Direktori : /lib/python3.9/site-packages/cockpit/__pycache__/ |
| Current File : //lib/python3.9/site-packages/cockpit/__pycache__/beiboot.cpython-39.pyc |
a
��j�T � @ sT d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl Z d dl
Z
d dlmZ d dl
mZmZmZmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZmZ d d lmZ d d
lm Z d dl!m"Z"m#Z# d dl$m%Z% d d
l&m'Z'm(Z(m)Z) d dl*m+Z+ d dl,m-Z-m.Z. d dl/m0Z0m1Z1 d dl2m3Z3 e�4d�Z5ed�dd�Z6G dd� de(�Z7dddd�ej8�Z8G dd� de1�Z9G dd� dej:�Z;e<e=ee< ee< f d �d!d"�Z>ee< e<ee<e=ee< ee< f d#�d$d%�Z?ee< ee< e=ee< ee< f d&�d'd(�Z@G d)d*� d*e+�ZAG d+d,� d,e0�ZBdd�d-d.�ZCdd�d/d0�ZDeEd1k�rPeD� dS )2� N)�Path)�Dict�Literal�Optional�Sequence)� polyfills)�ferny)�
bootloader)�BridgeBeibootHelper)�parse_os_release�
setup_logging)�ChannelRoutingRule)�PackagesChannel)�
JsonObject�get_str)�supported_oses)�Packages�PackagesLoader�patch_libexecdir)�Peer)�CockpitProblem�CockpitProtocolError)�Router�RoutingRule)�StdioTransportzcockpit.beiboot��returnc C s� t j�tj�d } | �� }tj�d�}|du 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 )z�Create askpass executable
We need this for the flatpak: ssh and thus the askpass program run on the host (via flatpak-spawn),
not the flatpak. Thus we cannot use the shipped cockpit-askpass program.
zinteraction_client.pyZXDG_CACHE_HOMENz~/.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� r1 �3/usr/lib/python3.9/site-packages/cockpit/beiboot.py�ensure_ferny_askpass% s(
r3 c @ sD e Zd ZU eeef ed<