Skip to content

Commit

Permalink
Merge pull request #59 from yselkowitz/dnf5
Browse files Browse the repository at this point in the history
Fix log parsing for DNF5
  • Loading branch information
tdawson authored Jan 18, 2024
2 parents cf393c5 + ba3a1db commit cc436b7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions feedback_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2884,8 +2884,9 @@ def _get_build_deps_from_a_root_log(self, root_log):

# "Package already installed" indicates it's directly required,
# so save it.
# DNF5 quotes the NVR in that statement, where DNF4 did not.
if "is already installed." in file_line:
pkg_name = file_line.split()[3].rsplit("-",2)[0]
pkg_name = file_line.split()[3].strip('"').rsplit("-",2)[0]
required_pkgs.append(pkg_name)

# That's all! Next state!
Expand Down Expand Up @@ -2955,7 +2956,8 @@ def _get_build_deps_from_a_root_log(self, root_log):
continue

elif len(file_line.split()) == 5:
if file_line.split()[4] in ["B", "k", "M", "G"]:
# DNF5 uses B/KiB/MiB/GiB, DNF4 uses B/k/M/G
if file_line.split()[4] in ["B", "KiB", "k", "MiB", "M", "GiB", "G"]:
continue
else:
pkg_name = file_line.split()[2]
Expand Down

0 comments on commit cc436b7

Please sign in to comment.