paru icon indicating copy to clipboard operation
paru copied to clipboard

split packages support for GETPKGBUILD

Open arenevier opened this issue 1 year ago • 1 comments

Split packages are not supported in. For example, running paru -Gp gvim will display the html content of this 404 page

This patch adds support for split packages. In split_repo_aur_pkgbuilds, the base package of the target is checked. If different from the target, the base name will be used instead.

Test: run paru -Gp gvim. It will now display vim PKGBUILD.

No need to do anything for aur. split packages are already supported.

Implementation note:

  • Since the base() string lifetime is less than the lifetime of targets, the only way I could find to make it work is to use String instead of &str. I tried to add lifetime annotation for the config parameter, but it was not working out (since it's borrowed in some other place). I am novice in rust. So maybe there is a better way.

  • I also modified split_repo_aur_pkgbuilds to return strings instead of the Targ struct. Indeed, the repo field is never used.

arenevier avatar Aug 07 '24 06:08 arenevier

test all pass locally for me. (by running cargo test --features mock)

arenevier avatar Aug 07 '24 06:08 arenevier

Sorry I'm so behind on PRs and issues. I fixed this a while ago with c894e25bd7cb19028642b046bf419dc078dd0399

I think it's the better approach as split_repo_aur_pkgbuilds still returns Targs so the caller can choose which part they care about.

Morganamilo avatar Dec 27 '24 09:12 Morganamilo