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

Add printing of which package failed to clean in aur cache #1074

Merged
merged 5 commits into from
Nov 28, 2023

Conversation

triarius
Copy link
Contributor

I recently installed a package from the AUR that srcinfo.rs failed to parse the .SRCINFO of. As a result, when I attempted to clean the caches (with paru -Sc), I get an error message of the parse failure, but there is no indication of which package the error originated from. This PR adds that information to the output.

Before

2023-11-19-18-12-54

After

2023-11-19-18-14-01

@Morganamilo
Copy link
Owner

Good change but I'm not a fan of the nesting here and change of a for loop to a for_each. The compiler warning about unused values is a sign it's probably not the ideal way to write this.

I think the way to do this is just .with_context() the original error returned by clean_aur_pkg then if let it as usual. Also the error message needs to be in a tr!() so it can be translated.

@triarius
Copy link
Contributor Author

@Morganamilo how about now?

This is what it looks like
2023-11-28-08-37-13

let file_name = file.file_name();
tr!(
"could not parse .SRCINFO for '{}'",
file_name.to_string_lossy()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use .display() here instead. Otherwise all good.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this is the filename and not a Path so nevermind.

@Morganamilo Morganamilo merged commit 711722e into Morganamilo:master Nov 28, 2023
2 checks passed
@triarius triarius deleted the show-package-on-clean-fail branch November 28, 2023 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants