
Add the "compose init" command to allow users to create an empty ostree repository. Story: 2010867 Task: 48556 Test Plan PASSED Installed apt-ostree from git repo. PASSED Run sudo apt-ostree compose init \ --repo /repo PASSED Check for /repo/config Change-Id: Iecd63a1ae6c1726914b16566df32f1adec382955 Signed-off-by: Charles Short <charles.short@windriver.com>
33 lines
704 B
Python
33 lines
704 B
Python
"""
|
|
Copyright (c) 2023 Wind River Systems, Inc.
|
|
|
|
SPDX-License-Identifier: Apache-2.0
|
|
|
|
"""
|
|
|
|
import errno
|
|
import sys
|
|
|
|
import click
|
|
|
|
from apt_ostree.cmd.options import repo_option
|
|
from apt_ostree.cmd import pass_state_context
|
|
from apt_ostree.compose import Compose
|
|
|
|
|
|
@click.command(
|
|
help="Initialize an OStree repository.")
|
|
@pass_state_context
|
|
@repo_option
|
|
def init(state, repo):
|
|
try:
|
|
Compose(state).create()
|
|
except KeyboardInterrupt:
|
|
click.secho("\n" + ("Exiting at your request."))
|
|
sys.exit(130)
|
|
except BrokenPipeError:
|
|
sys.exit()
|
|
except OSError as error:
|
|
if error.errno == errno.ENOSPC:
|
|
sys.exit("error - No space left on device.")
|