Closed xiota closed 10 months ago
This is what this function is all about.
Double check me, but this could do last point
# * Add newline to end if there is not
if [[ $(tail -c 1 "PKGBUILD" | wc -l) -eq 0 ]]; then
echo -e "\n" >> "PKGBUILD"
fi
Examples of issues with replaces
...
network-manager-applet-nolibappindicator
[had] replaces against extra/network-manager-applet
.connman-git
[still] has replaces against extra/connman
AUR submission guidelines state, "Do not use replaces
in an AUR PKGBUILD unless the package is to be renamed..."
Have already sent requests for all packages with replaces directives in chaotic-aur.
@Technetium1 Why not just unconditionally printf "\n" >> PKGBUILD
?
@xiota yes lol, that's valid and much simpler. I was assuming it would be less intensive to not write to all the files, instead only appending if needed. If it's running in memory (which I think it might be right now actually), then it's probably faster to just append the newline blindly.
What about storing everything that needs to be appended in a variable.
_PKGBUILD_APPEND+=$'unset PKGEXT\n'
_PKGBUILD_APPEND+=$'unset groups\n'
_PKGBUILD_APPEND+=$'unset replaces\n'
printf '\n\n%s\n' "$_PKGBUILD_APPEND" >> PKGBUILD
Would also be nice for packages with pkgver()
to set pkgver
, pkgrel
, epoch
to match last built package. That should allow bumps to work for -git
packages.
TIL! Didn't know this was possible, sounds very handy!
What about storing everything that needs to be appended in a variable.
We already do that with the "wizard.sh", there is a command makepkg-gen-bash-append
. There is no need to put everything into a variable, as we can already write to the file.
Also, it's important to reuse the current CAUR_
file paths as maximum as possible, as we're 100% sure those changes when building tons of packages, and they don't need cleanup. Which is super important since we fork into new processes for every package.
What about storing everything that needs to be appended in a variable.
We can already append to the PKGBUILD at any time. This is not better than what we already have.
Would also be nice for packages with pkgver() to set pkgver, pkgrel, epoch to match last built package. That should allow bumps to work for -git packages.
This sounds more as an adjusts that should be done in the bump interference (by detecting functions and treating them). But remember, we can't really call pkgver ahead-of-time since they execute code that needs to be run inside the building container.
For this last one open a new issue, it's quite unrelated to this.
Add an interfere that applies to all packages.
Can be used to do some clean-up that should be applied to all packages, like:
groups
.replaces
.PKGBUILD
to prevent problems like this.