From b013ca4221852edf920d1c7b0a910de303ce9826 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Mon, 20 May 2024 20:50:43 +1000 Subject: [PATCH] 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 --- doc/makepkg.8.asciidoc | 5 +++++ scripts/makepkg.sh.in | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/makepkg.8.asciidoc b/doc/makepkg.8.asciidoc index a2ad5279..bb5e2f4a 100644 --- a/doc/makepkg.8.asciidoc +++ b/doc/makepkg.8.asciidoc @@ -297,6 +297,11 @@ Environment Variables **BUILDTOOLVER=**"":: 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 ------------- diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index d5976434..75df3650 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -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