Mini Shell
3
C��e�2 � @ s d dl Z d dlZd dlZd dlmZmZ d dlmZ d dlm Z d dl
mZmZm
Z
mZ d dlmZ d dlmZ ejdd � ejd
d� d dlmZmZmZmZmZ d d
lmZ ee�ZdgZG dd� de�Z G dd� de�Z!G dd� de!�Z"G dd� de!�Z#dS )� N)�ABC�abstractmethod)�get_module_logger)�_)�GError�VariantType�Variant�Bytes)� progressQ)�FlatpakInstallErrorZFlatpakz1.0ZGioz2.0)�Transaction�Installation�Remote�TransactionOperationType�TransactionErrorDetails)�File�FlatpakPayloadc @ s� e Zd ZdZdZdZdd� Zdd� Zdd � Zd
d� Z dd
� Z
dd� Zdd� Ze
dd� �Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zd d!� Zd"d#� Zd$d%� Zed&d'� �Zd(S ))r z9Main class to handle flatpak installation and management.ZAnacondazfile:///flatpak/repoc C s || _ d| _d| _dS )a� Create and initialize this class.
This flatpak implementation works on a repository stored in the stage2 image specifically
for the SilverBlue image. It will be used from the ostree payload after the installation.
This is a temporal solution for SilverBlue use-case. It will be extended as full featured
payload in the future.
:param sysroot: path to the system root
:type sysroot: str
N)�_sysroot�_remote_refs_list�_transaction)�selfZsysroot� r �/usr/lib64/python3.6/flatpak.py�__init__2 s zFlatpakPayload.__init__c C s t jj| jd�}| j|� dS )z�Create flatpak objects and set them to install to the result system.
This call will re-initialize current settings so everything set here will be cleaned.
zvar/lib/flatpakN)�os�path�joinr �initialize_with_path)r �target_pathr r r �initialize_with_system_pathB s z*FlatpakPayload.initialize_with_system_pathc C sD t jd|� | j| j| jd�}| j||�}| j|�| _t|�| _ dS )a> Create flatpak objects and set them for the given target path.
The initialization process will create a repository on the given path.
This call will re-initialize current settings so everything set here will be cleaned.
:param str target_path: path where we want to install flatpaks
zConfigure flatpak for path %sFN)
�log�debug�_create_flatpak_remote�LOCAL_REMOTE_NAME�LOCAL_REMOTE_PATH�_create_flatpak_installation�_create_flatpak_transactionr �RemoteRefsListr )r r �remote�installationr r r r J s
z#FlatpakPayload.initialize_with_pathc C s"