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

Fix log parsing for DNF5 #59

Merged
merged 1 commit into from
Jan 18, 2024
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
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
Loading