packages/pkgbuild: internal makepkg: wrap initial declarations into a function as well.
packages/pkgbuild: call _makepkg_api_preinit.
packages/pkgbuild: add legacy repository to the source list only if ALL_SOURCES=1.
packages/pkgbuild: pkgbuild_sanitize: redirect `rm` messages to stderr.
packages/pkgbuild: rename some _pkgbuild_update_* functions.
packages/pkgbuild: pkgbuild_need_update: get version from upstream branch instead of writing to PKGBUILD to revert changes.