forked from Mirror/pmbootstrap
commands: move shutdown command to pmb/commands (MR 2252)
Another one bites the dust Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
parent
a99ae02068
commit
656ff3f5bb
3 changed files with 17 additions and 5 deletions
|
@ -12,13 +12,13 @@ from .base import Command
|
|||
from .log import Log
|
||||
from .index import Index
|
||||
from .repo_bootstrap import RepoBootstrap
|
||||
from .shutdown import Shutdown
|
||||
|
||||
"""New way to model pmbootstrap subcommands that can be invoked without PmbArgs."""
|
||||
|
||||
# Commands that are still invoked via pmb/helpers/frontend.py
|
||||
unmigrated_commands = [
|
||||
"init",
|
||||
"shutdown",
|
||||
"work_migrate",
|
||||
"repo_missing",
|
||||
"kconfig",
|
||||
|
@ -66,6 +66,8 @@ def run_command(args: PmbArgs):
|
|||
command = Index()
|
||||
elif args.action == "repo_bootstrap":
|
||||
command = RepoBootstrap(args.arch, args.repository)
|
||||
elif args.action == "shutdown":
|
||||
command = Shutdown()
|
||||
else:
|
||||
raise NotImplementedError(f"Command '{args.action}' is not implemented.")
|
||||
|
||||
|
|
14
pmb/commands/shutdown.py
Normal file
14
pmb/commands/shutdown.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
# Copyright 2024 Caleb Connolly
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
from pmb import commands
|
||||
import pmb.chroot
|
||||
|
||||
class Shutdown(commands.Command):
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def run(self):
|
||||
pmb.chroot.shutdown()
|
||||
|
|
@ -547,10 +547,6 @@ def qemu(args: PmbArgs):
|
|||
pmb.qemu.run(args)
|
||||
|
||||
|
||||
def shutdown(args: PmbArgs):
|
||||
pmb.chroot.shutdown(args)
|
||||
|
||||
|
||||
def stats(args: PmbArgs):
|
||||
# Chroot suffix
|
||||
chroot = Chroot.native()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue