cassava / repoctl

Make it easy to manage your local Arch Linux repository.
MIT License
119 stars 14 forks source link

Repoctl down "pkgbase" errors if the pkgbase is not available in pkgname=() #69

Open dr460nf1r3 opened 2 years ago

dr460nf1r3 commented 2 years ago

Currently, repoctl down does not work with pkgbase when it is not available in the pkgname array. An example of this is the yaru pkgbase.

λ repoctl down yaru
Error: package "yaru" could not be found on AUR

Meanwhile, the pkgbase can still be downloaded by its git URL (https://aur.archlinux.org/pkgbase/yaru)

cassava commented 1 year ago

Hi @dr460nf1r3, thanks for reporting this. I seem to have missed it when you initially reported it. I'll see if I can fix this quickly, but if its not trivial it may take a little longer.

cassava commented 1 year ago

Alright, the API I'm using is the Web RPC, as documented here: https://wiki.archlinux.org/title/Aurweb_RPC_interface

However, neither with the search nor with the info command am I actually able to get information on the package base. So dealing with this... is not easily feasible.

For comparison, the tool paru can't find yaru either.

cassava commented 1 year ago

So what I could do when not being able to find a package via the Web RPC protocol is just try to download it using the expected URL. But I'm not sure how to correctly sanitize the input package names so that we don't make arbitrary HTTP calls.

cassava commented 1 year ago

Since this goes beyond what is available from the Web RPC, I'm going to call this an "enhancement" as opposed to a "bug". We can also see that in other tools, the same behavior is present.

dr460nf1r3 commented 1 year ago

Hey @cassava ! Thanks for taking a look at this issue - would using the git URL not be an option? I'm not really experienced with how the RPC protocol works, so bear with me. Anyways, we do have a workaround and it is not that much of an issue. <3

cassava commented 4 months ago

So I got around to looking into this again today, and I found that there are some new RPC endpoints available that I could use to not have to resort to magic.

Here is the overview of endpoints: https://aur.archlinux.org/rpc/swagger

And the endpoint of interest is suggest-basepkg. I can use this to at least discover whether a base package exists at all. From there I'm still missing a lot of data, but maybe I can make do without.

dr460nf1r3 commented 4 months ago
nico@temeraire ~> repoctl down firefox-esr
Downloading: firefox-esr

Seems to work running the latest version 🤔