PKGBUILD can lack update, especially on `-git` AUR packages
Affected Version
yay v12.3.1 - libalpm v13.0.2
Describe the bug
Sometimes PKGBUILD isn't updated to its latest version available on AUR, this can especially be seen on -git packages, which can be updated with no changes to pkgver or pkgrel. Some of those changes can fix package building breakages (new dependency, new option and so on).
Currently, PKGBUILD seems to be updated if pkgver or pkgrel are updated (I'm not 100% sure of this, but that's what my observations suggest).
Note that even when asking for a clean build, yay remove many things but not the PKGBUILD, so user have to go remove it manually.
Reproduction Steps
No clear STR, but I think description above is complete enough.
Expected behavior
PKGBUILD should always be updated and at the very very least should also be removed when user ask for a Clean Build.
Output
No relevant output to provide here.
EDIT: Just thought about checking on some options after opening the issue; there's indeed https://github.com/Jguer/yay/blob/next/cmd.go#L112-L114 (in which the two first seems mutually exclusive?).
However, my config include "redownload": "no", and I don't remember specifically modifying something about this (and dunno how to check the default here), so maybe I got it from someone else, can't remember. What's the default? If default is what I do have, I think it'd be worth a change.
And no matter the answer to the previous paragraph, I think a Clean Build should also get rid of the PKGBUILD.
Note that even when asking for a clean build,
yayremove many things but not thePKGBUILD, so user have to go remove it manually.
Even if package is selected to be built cleanly? Probably a bug then...
Note that even when asking for a clean build,
yayremove many things but not thePKGBUILD, so user have to go remove it manually.Even if package is selected to be built cleanly? Probably a bug then...
Yes, even in that case.
(I tried many times. I didn't checked what exactly is removed and what's not, as it would require you to be very fast to check this, but PKGBUILD wasn't changing unless I manually remove it or the whole directory. yay would only update it when either pkgrel or pkgver would change.
I'm affected by this as well. I was checking how my package builds for users and couldn't understand why PKGBUILD still contains old information even though I already updated it.
Still getting the issue with for example a package that's not a -git one. Worse is that removing manually the PKGBUILD somehow doesn't update it to the latest one but "restore" the one I removed. I assume the restore comes from /home/$USER/.cache/yay/[package]/.git, notably I see AUR_SEEN which I assume is set by yay, although I'm not sure.
Maybe completely removing /home/$USER/.cache/yay/[package]/ would do the trick, but then I'm not even sure where yay is storing its DB of the packages it manage (the one generated from --gendb).
EDIT: It appears yay doesn't update (pull) the git repo with the PKGBUILD, but why…