2026-03-05 11:01:18 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
|
|
2026-04-11 10:16:54 +02:00
|
|
|
from ..Cmd import Cmd as Base
|
|
|
|
|
|
2026-03-05 11:01:18 +01:00
|
|
|
if TYPE_CHECKING:
|
|
|
|
|
from typing import Iterable
|
|
|
|
|
from ...lib.Distro import Distro
|
|
|
|
|
from ..CmdDistro import CmdDistro
|
|
|
|
|
|
2026-04-11 10:16:54 +02:00
|
|
|
from .lib.util import *
|
2026-03-05 11:01:18 +01:00
|
|
|
|
|
|
|
|
class Cmd(Base): # export
|
|
|
|
|
|
|
|
|
|
async def _match_files(self, packages: Iterable[str], pattern: str) -> list[str]:
|
2026-04-11 10:16:54 +02:00
|
|
|
return await match_files(self.distro, packages, pattern)
|
2026-03-05 11:01:18 +01:00
|
|
|
|
|
|
|
|
async def _list_template_files(self, packages: Iterable[str]) -> list[str]:
|
2026-04-11 10:16:54 +02:00
|
|
|
return await list_template_files(self.distro, packages)
|
2026-03-05 11:01:18 +01:00
|
|
|
|
2026-03-08 07:43:37 +01:00
|
|
|
async def _list_secret_paths(self, packages: Iterable[str], ignore_missing: bool=False) -> list[str]:
|
2026-04-11 10:16:54 +02:00
|
|
|
return await list_secret_paths(self.distro, packages, ignore_missing)
|
2026-03-05 11:01:18 +01:00
|
|
|
|
2026-03-08 07:43:37 +01:00
|
|
|
async def _list_compilation_targets(self, packages: Iterable[str], ignore_missing: bool=False) -> list[str]:
|
2026-04-11 10:16:54 +02:00
|
|
|
return await list_compilation_targets(self.distro, packages, ignore_missing)
|
2026-03-05 11:01:18 +01:00
|
|
|
|
|
|
|
|
async def _remove_compilation_targets(self, packages: Iterable[str]) -> list[str]:
|
2026-04-11 10:16:54 +02:00
|
|
|
return await remove_compilation_targets(self.distro, packages)
|
2026-03-05 11:01:18 +01:00
|
|
|
|
2026-03-08 10:41:58 +01:00
|
|
|
async def _compile_template_files(self, packages: Iterable[str], default_attrs: Attrs) -> list[str]:
|
2026-04-11 10:16:54 +02:00
|
|
|
return await compile_template_files(self.distro, packages, default_attrs)
|
2026-03-05 11:01:18 +01:00
|
|
|
|
|
|
|
|
def __init__(self, parent: CmdDistro, name: str, help: str) -> None:
|
|
|
|
|
super().__init__(parent, name, help)
|
|
|
|
|
|
|
|
|
|
def add_arguments(self, parser: ArgumentParser) -> None:
|
|
|
|
|
super().add_arguments(parser)
|
|
|
|
|
parser.add_argument("packages", nargs='*', help="Package names")
|