split packages support for GETPKGBUILD
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.
test all pass locally for me. (by running cargo test --features mock)
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.