Up until now we created a backup of pacman.conf and restored it after
the build was done. This can leave the environment in an undefined state
if something crashes inbetween.
Instead create a temporary pacman.conf and use that during building.
In theory pacman allows setting a custom config via "--config", but
makepkg doesn't expose this, so that's not working. Luckily makepkg
allows overriding the pacman path via the PACMAN env var, so we create
a temporary script which just forwards everything to pacman and always
sets the temporary config.
Up until now we created a backup of pacman.conf and restored it after the build was done. This can leave the environment in an undefined state if something crashes inbetween.
Instead create a temporary pacman.conf and use that during building. In theory pacman allows setting a custom config via "--config", but makepkg doesn't expose this, so that's not working. Luckily makepkg allows overriding the pacman path via the PACMAN env var, so we create a temporary script which just forwards everything to pacman and always sets the temporary config.