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

Adjust extract_section_content_from_text for dnf5 #1355

Merged
merged 1 commit into from
Oct 26, 2023
Merged
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: 5 additions & 2 deletions dnf-behave-tests/dnf/steps/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ def extract_section_content_from_text(section_header, text):
parsed = ''
copy = False
for line in text.split('\n'):
if (not copy) and section_header == line:
strippedline = line.strip()
# in dnf5 there can be spaces after some section headers
# (e.g. 'Installing:', 'Upgrading:' etc.)
if (not copy) and section_header == strippedline:
copy = True
continue
if copy: # copy lines until hitting empty line or another known header
if line.strip() and line not in SECTION_HEADERS:
if strippedline and strippedline not in SECTION_HEADERS:
parsed += "%s\n" % line
else:
return parsed
Expand Down
Loading