관리-도구
편집 파일: beiboot.cpython-39.opt-1.pyc
a ��g�X � @ sj d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl Z d dl Z d dlmZ d dl mZmZmZmZmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZmZ d d lmZ d d l m!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 dl0m1Z1m2Z2 d dl3m4Z4 e�5d�Z6ed�dd�Z7ee8 d�dd�Z9G dd� de)�Z:dddd�ej;�Z;G dd� de2�Z<G d d!� d!ej=�Z>e8e?ee8 ee8 f d"�d#d$�Z@ee8 e8ee8e?ee8 ee8 f d%�d&d'�ZAee8 ee8 e?ee8 ee8 f d(�d)d*�ZBG d+d,� d,e,�ZCG d-d.� d.e1�ZDdd�d/d0�ZEdd�d1d2�ZFeGd3k�rfeF� dS )4� N)�Path)�Dict�Iterable�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� r2 �3/usr/lib/python3.9/site-packages/cockpit/beiboot.py�ensure_ferny_askpass1 s( r4 c c s<