
[Why] we use makepkg 2>&1 so that many errors are not output to the file stderr now. Like these: ==> WARNING: Skipping verification of source file PGP signatures. leptonica-1.79.0.tar.gz ... FAILED ==> ERROR: One or more files did not pass the validity check! And stats/build-pkg can not analyze them so it ignores them. [How] Redirect stderr in functions build(), check(), packages() when STDERR_REDIR = y. Signed-off-by: Lin Jiaxin <ljx.joe@qq.com> --- sbin/makepkg | 18 +++++++++++++++--- tests/build-pkg | 4 ++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/sbin/makepkg b/sbin/makepkg index 498b4872..131ae690 100755 --- a/sbin/makepkg +++ b/sbin/makepkg @@ -1761,11 +1761,19 @@ run_build() { [[ -d /usr/lib/ccache/bin ]] && export PATH="/usr/lib/ccache/bin:$PATH" fi - run_function_safe "build" + if [[ $STDERR_REDIR == y ]];then + run_function_safe "build" 2>&1 + else + run_function_safe "build" + fi } run_check() { - run_function_safe "check" + if [[ $STDERR_REDIR == y ]];then + run_function_safe "check" 2>&1 + else + run_function_safe "check" + fi } run_package() { @@ -1776,7 +1784,11 @@ run_package() { pkgfunc="package_$1" fi - run_function_safe "$pkgfunc" + if [[ $STDERR_REDIR == y ]];then + run_function_safe "$pkgfunc" 2>&1 + else + run_function_safe "$pkgfunc" + fi } build_id() { diff --git a/tests/build-pkg b/tests/build-pkg index c6717d48..aafc120e 100755 --- a/tests/build-pkg +++ b/tests/build-pkg @@ -125,8 +125,8 @@ build_source_pkg() [ -n "$PKGBUILD_TAG" ] && replace_source "PKGBUILD-$PKGBUILD_TAG" cgz_name="$PKG_MNT/${pack_to}/${pkgname}/${upstream_commit}.cgz" - PACMAN=true BUILDDIR=$TMP CARCH=$os_arch PKGEXT=.cgz CGZDEST="$cgz_name" \ - $LKP_SRC/sbin/makepkg -A --check --skippgpcheck --config $LKP_SRC/etc/makepkg.conf 2>&1 + PACMAN=true BUILDDIR=$TMP CARCH=$os_arch PKGEXT=.cgz CGZDEST="$cgz_name" STDERR_REDIR=y\ + $LKP_SRC/sbin/makepkg -A --check --skippgpcheck --config $LKP_SRC/etc/makepkg.conf [ "$?" == 0 ] || exit 1 create_softlink -- 2.23.0