makepkg: provide environment variable to disable PKGBUILD linting

On Windows based systems (e.g. msys), running PKGBUILD linting is very
slow due to time taken spawning bash subshells.  Additionally, some packages
have extreme amounts of (usually procedurally generated) splitting, which
also causes linting to be extremely slow.  Provide an environment variable
to disable PKGBUILD linting.

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2024-05-20 20:50:43 +10:00
parent 44b9a53b2d
commit b013ca4221
2 changed files with 10 additions and 1 deletions

View file

@ -297,6 +297,11 @@ Environment Variables
**BUILDTOOLVER=**"<version>"::
The version of the '$BUILDTOOL' used.
**MAKEPKG_LINT_PKGBUILD=**0
Setting to 0 disables PKGBUILD linting within makepkg. Useful on systems
with slow bash subshell operations, or on PKGBUILDs with extreme amounts of
package splitting.
Configuration
-------------

View file

@ -87,6 +87,8 @@ else
fi
export SOURCE_DATE_EPOCH
MAKEPKG_LINT_PKGBUILD=${MAKEPKG_LINT_PKGBUILD:-1}
PACMAN_OPTS=()
shopt -s extglob
@ -1151,7 +1153,9 @@ fi
pkgbase=${pkgbase:-${pkgname[0]}}
# check the PKGBUILD for some basic requirements
lint_pkgbuild || exit $E_PKGBUILD_ERROR
if (( MAKEPKG_LINT_PKGBUILD != 0 )); then
lint_pkgbuild || exit $E_PKGBUILD_ERROR
fi
if (( !SOURCEONLY && !PRINTSRCINFO )); then
merge_arch_attrs