Feat aur automatic fallback#264
Feat aur automatic fallback#264ZorudaRinku wants to merge 14 commits intoarchlinux-downgrade:mainfrom
Conversation
There was a problem hiding this comment.
This looks good but I'm wondering if we actually need any of these conditions / guard rails:
- Package is foreign
- AUR cache directory exists
- AUR cache directory is not already given in
PACMAN_CACHE
What happens if we check none of that, and simply append the conventional AUR cache directories to PACMAN_CACHE as its default value at the start of the script, then let it just run as it does?
We may need to make search_cache tolerant of missing or duplicate cache directories, but I think that would be a better use of complexity.
ad5cb69 to
e785828
Compare
|
This approach is so much simpler lol
|
Apply suggestions from code review Co-authored-by: Pat Brisbin <pbrisbin@gmail.com>
|
I didn't notice the --pacman-cache behavior so good call. It works as expected now (only searching the cache specified). This does make the command a little noisy with some false errors. Find searches pacman, paru, and yay now so one will always return an error (assuming people don't install both aur and paru). We could redirect stderr again but if find runs into any other issue then we'd silence it. We could grep and redirect stderr but seems kinda messy? Then search_git searches all cache dirs and throws errors for pacman and the 1 non-existent cache dir. We could just silently continue instead of outputting this warning? |
Yeah, fair enough. The easiest answer may be to bring back your
I think that's what we'd want to do. Before, git was opt-in, so if you opted in and then it wasn't a git directory you'd probably want to see this warning. I'm OK going back to that, if you'd like to keep this PR smaller for now. However, if you are going to keep this bit that automatically enables the git behavior, then we shouldn't warn for the (now expected and common) case of there being no git package. |
Co-authored-by: Pat Brisbin <pbrisbin@gmail.com>
| # version: 1:2025.11.12.r15.g0eed3fe | ||
| version_regex="[a-zA-Z0-9.:]+" |
There was a problem hiding this comment.
I'm surprised this code is wholly duplicated with ~L251, and so requires fixing twice.
Not your fault, or holding up this PR, just something I'm thinking about.
search_cache no longer needs to tolerate missing directories now that we returned checks for directories in detect_aur_caches with [[ -d ]]
This makes sense to me.
I'm OK with it not being "perfect", so we can avoid trickery. But which implementation is your image showing? I would expect a |
|
We're sorting using pacsort but it doesn't seem handle epochs for cache built correctly. Well it does but it's as if the epoch is part of the main version number so 1:1.2 appears right next to 1.1.x but it's actually 1.2. I've been trying to figure out a way to simply/properly sort it but it's just not handled properly with pacsort. I sorta got this but it feels a little gross. We extract the epoch prefix then sort it properly after doing so. I also notice this is only for packages with specified epoch (I think that's how it works?) So it just happened I was testing with spotify which specify the epoch in the filename and if I try other packages it's usually not a problem anyways. |
877b894 to
2b084a3
Compare
pbrisbin
left a comment
There was a problem hiding this comment.
I see about pacsort. I think using that and accepting whatever it does is the right move. If we think it's mishandling packages with epoch, that feels like a bug we could report there. I'm inclined to not care though.
|
I can take over to address the conflicts and Restyled failure. I think I also want to squash merge into one |
|
Fine by me :) And yeah sorry I couldn't figure out the restyled thing lol After thinking about this a lot more I think how I was imagining it was flipped. I don't think this is pacsorts fault, I think the problem is how we generated the list R276. Pacsort handles epochs fine, but when we were previously generating the git list we didn't include the epoch. And because I randomly decided to use spotify in testing it brought up how it was sorting poorly because of that. I think we should include the proper sorting I committed in Epoch sorting as it should be the proper fix for this. It's just that the epoch is specified in a different variable in the pkgbuild instead of being included in the pkgver and it was just never accounted for. |

Checklist
doc/*.ronnlocale/*.poDescription
Add new feature; automatically falling back to AUR git downgrading when package is foreign to pacman.
Equivalent to manually passing
--git --pacman-cache ~/.cache/yay --maxdepth 2ifpacman -Qmreturns 0 on a package.Automatically checks for yay and paru in their default dirs to find git repos for downgrading.