Skip to content

Commit

Permalink
Adjust extract_section_content_from_text for dnf5
Browse files Browse the repository at this point in the history
  • Loading branch information
glum23 committed Aug 2, 2023
1 parent bbb3ec5 commit 18a8b4b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 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,13 @@ 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:
# in dnf5 there can be spaces after some section headers
# (e.g. 'Installing:', 'Upgrading:' etc.)
if (not copy) and (section_header == line or section_header == line.strip()):
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 (line.strip() not in SECTION_HEADERS) and (line not in SECTION_HEADERS):
parsed += "%s\n" % line
else:
return parsed
Expand Down

0 comments on commit 18a8b4b

Please sign in to comment.