Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnf5: Don't output to a PTY #1261

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion mock/py/mockbuild/package_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def _execute_mounted(self, *args, **kwargs):
if not self.config['print_main_output']:
kwargs.pop('printOutput', None)
else:
kwargs['pty'] = kwargs.get('pty', True)
kwargs.setdefault("pty", True)
self.buildroot.nuke_rpm_db()

error = None
Expand Down Expand Up @@ -758,5 +758,10 @@ class Dnf5(Dnf):
"""
name = 'dnf5'
place_common_opts_after = True

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

def update(self, *args, **_kwargs):
return self.execute('upgrade', *args)
4 changes: 4 additions & 0 deletions releng/release-notes-next/dnf5-logs-with-no-pty.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
If DNF 5 sees an "interactive" TTY on stdout, it will try to draw progress bars
and cause the Mock logs to [be garbled](https://github.com/fedora-copr/copr/issues/3040).
This release brings a fix that simply sets the output of DNF5 to a pipe instead
of a PTY.