Skip to content

Commit

Permalink
dnf5: Don't output to a PTY
Browse files Browse the repository at this point in the history
If DNF 5 sees an "interactive" TTY on stdout, it will try to draw
progress bars and cause the Mock logs to be garbled:
fedora-copr/copr#3040. A simple fix is to have
DNF 5 output to a pipe instead of a PTY.

I'm not sure why output is collected via a PTY from yum/dnf (seems to
start from commit 99ca2fa), but it's probably no longer needed
for DNF 5?
  • Loading branch information
evan-goode committed Dec 1, 2023
1 parent 92c4885 commit df855a4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mock/py/mockbuild/package_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,5 +758,9 @@ class Dnf5(Dnf):
"""
name = 'dnf5'
place_common_opts_after = True

def execute(self, *args, **kwargs):
return super(Dnf, self).execute(*args, **{"pty": False, **kwargs})

def update(self, *args, **_kwargs):
return self.execute('upgrade', *args)

0 comments on commit df855a4

Please sign in to comment.