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

More dependency detection fixes with DNF5 #60

Merged
merged 1 commit into from
May 23, 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
23 changes: 19 additions & 4 deletions feedback_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2884,22 +2884,37 @@ 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.
# DNF5 does this after "Repositories loaded" and quotes the NVR;
# DNF4 does this before "Dependencies resolved" without the quotes.
if "is already installed." in file_line:
pkg_name = file_line.split()[3].strip('"').rsplit("-",2)[0]
required_pkgs.append(pkg_name)

# That's all! Next state!
# That's all! Next state! (DNF4)
elif "Dependencies resolved." in file_line:
state += 1


# That's all! Next state! (DNF5)
elif "Repositories loaded." in file_line:
state += 1


# 2/
# going through the log right before the first package name
elif state == 2:

# "Package already installed" indicates it's directly required,
# so save it.
# DNF5 does this after "Repositories loaded" and quotes the NVR;
# DNF4 does this before "Dependencies resolved" without the quotes.
if "is already installed." in file_line:
pkg_name = file_line.split()[3].strip('"').rsplit("-",2)[0]
required_pkgs.append(pkg_name)

# The next line will be the first package. Next state!
if "Installing:" in file_line:
# DNF5 reports "Installing: ## packages" in the Transaction Summary,
# which we need to ignore
if "Installing:" in file_line and len(file_line.split()) == 3:
state += 1


Expand Down
Loading