Allow --downloadonly on read-only bootc system

"dnf install --downloadonly" failed on read-only bootc system despite
not running the transaction. The downloaded packages are stored under
writable /var or to a directory explicitly choosen by a user.

This patch suppresses the bootc read-only bailout if --downloadonly
option is used.

https://issues.redhat.com/browse/RHEL-61745
This commit is contained in:
Petr Písař 2024-10-10 10:57:48 +02:00 committed by kolage
parent d50a6b2a63
commit 8d888d26e6
1 changed files with 2 additions and 1 deletions

View File

@ -215,7 +215,8 @@ class BaseCli(dnf.Base):
logger.info(_("{prog} will only download packages, install gpg keys, and check the "
"transaction.").format(prog=dnf.util.MAIN_PROG_UPPER))
if dnf.util._is_bootc_host() and \
os.path.realpath(self.conf.installroot) == "/":
os.path.realpath(self.conf.installroot) == "/" and \
not self.conf.downloadonly:
_bootc_host_msg = _("""
*** Error: system is configured to be read-only; for more
*** information run `bootc --help`.