Files
apt-ostree/apt_ostree/cmd/compose/install.py
Lindley Werner 407a3151a5 Build OSTree commit using component
When installing Debian packages, apt-ostree can reference packages
from an specific component. Each component is related to a patch
version (sw_release).

Test Plan:
PASS Install apt-ostree from git repo.
PASS Run "apt-ostree compose create \
--base config/debian/bookworm \
--repo /repo debian/bookworm \
bookworm-test"
PASS Run "apt-ostree compose install --repo /repo \
--branch bookworm-test --component <sw_release> docker.io"
PASS Check the output of "ostree log --repo /repo bookworm-test"

Story: 2010867
Task: 50184

Change-Id: I33cc01d1b2f8a9212b7b96591165334c25f9ceab
Signed-off-by: Lindley Werner <Lindley.Vieira@windriver.com>
2024-05-29 16:00:37 +00:00

51 lines
1.2 KiB
Python

"""
Copyright (c) 2023-2024 Wind River Systems, Inc.
SPDX-License-Identifier: Apache-2.0
"""
import errno
import sys
import click
from apt_ostree.cmd.options import branch_option
from apt_ostree.cmd.options import component_option
from apt_ostree.cmd.options import gpg_key_option
from apt_ostree.cmd.options import packages_option
from apt_ostree.cmd.options import repo_option
from apt_ostree.cmd import pass_state_context
from apt_ostree.packages import Packages
@click.command(
help="Install Debian package in a target to an OSTree repository.")
@pass_state_context
@branch_option
@repo_option
@click.option(
"--feed",
help="Debian package feed",
nargs=1)
@gpg_key_option
@component_option
@packages_option
def install(state,
branch,
repo,
feed,
gpg_key,
component,
packages):
try:
Packages(state).install(packages, feed, component)
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.")