xbps-src: implement a 'check' stage
Add another stage 'check' between 'build' and 'install'. It is be enabled using the variable XBPS_CHECK_PKGS=yes and disabled if unset, set to "0" or "no" in your local etc/conf. A new xbps-src option `-q` for `quick` will disable XBPS_CHECK_PKGS by overriding it to 0. If enabled, `common/xbps-src/shutils/xbps-src-docheck.sh` checks for an existing `do_check()` function in the package's template and, if it exists, calls it. A new template variable `checkdepends` may be present and list packages required to run the `do_check()` function. Example: `checkdepends="bc unittest-cpp"`.
This commit is contained in:
parent
f9dface61c
commit
c31dd888f6
14 changed files with 156 additions and 13 deletions
|
@ -33,7 +33,7 @@ XBPS_SRC_VERSION="$XBPS_SRC_VERSION"
|
|||
PATH=/void-packages:/usr/bin:/usr/sbin
|
||||
|
||||
exec env -i SHELL=/bin/sh PATH="\$PATH" DISTCC_HOSTS="\$XBPS_DISTCC_HOSTS" DISTCC_DIR="/host/distcc" @@XARCH@@ \
|
||||
CCACHE_DIR="/host/ccache" IN_CHROOT=1 LC_COLLATE=C LANG=en_US.UTF-8 TERM=linux HOME="/tmp" \
|
||||
@@CHECK@@ CCACHE_DIR="/host/ccache" IN_CHROOT=1 LC_COLLATE=C LANG=en_US.UTF-8 TERM=linux HOME="/tmp" \
|
||||
PS1="[\u@$XBPS_MASTERDIR \W]$ " /bin/bash +h
|
||||
_EOF
|
||||
if [ -n "$XBPS_ARCH" ]; then
|
||||
|
@ -41,6 +41,11 @@ _EOF
|
|||
else
|
||||
sed -e 's,@@XARCH@@,,g' -i $XBPS_MASTERDIR/bin/xbps-shell
|
||||
fi
|
||||
if [ -z "$XBPS_CHECK_PKGS" -o "$XBPS_CHECK_PKGS" = "0" -o "$XBPS_CHECK_PKGS" = "no" ]; then
|
||||
sed -e 's,@@CHECK@@,,g' -i $XBPS_MASTERDIR/bin/xbps-shell
|
||||
else
|
||||
sed -e "s,@@CHECK@@,XBPS_CHECK_PKGS=$XBPS_CHECK_PKGS,g" -i $XBPS_MASTERDIR/bin/xbps-shell
|
||||
fi
|
||||
chmod 755 $XBPS_MASTERDIR/bin/xbps-shell
|
||||
|
||||
cp -f /etc/resolv.conf $XBPS_MASTERDIR/etc
|
||||
|
@ -170,7 +175,7 @@ chroot_handler() {
|
|||
[ -z "$action" -a -z "$pkg" ] && return 1
|
||||
|
||||
case "$action" in
|
||||
fetch|extract|build|configure|install|install-destdir|pkg|build-pkg|bootstrap-update|chroot)
|
||||
fetch|extract|build|check|configure|install|install-destdir|pkg|build-pkg|bootstrap-update|chroot)
|
||||
chroot_prepare || return $?
|
||||
chroot_init || return $?
|
||||
chroot_sync_repos || return $?
|
||||
|
@ -188,6 +193,7 @@ chroot_handler() {
|
|||
[ -n "$XBPS_BUILD_FORCEMODE" ] && arg="$arg -f"
|
||||
[ -n "$XBPS_MAKEJOBS" ] && arg="$arg -j$XBPS_MAKEJOBS"
|
||||
[ -n "$XBPS_DEBUG_PKGS" ] && arg="$arg -g"
|
||||
[ -z "$XBPS_CHECK_PKGS" -o "$XBPS_CHECK_PKGS" = "0" -o "$XBPS_CHECK_PKGS" = "no" ] && arg="$arg -q"
|
||||
[ -n "$XBPS_SKIP_DEPS" ] && arg="$arg -I"
|
||||
[ -n "$XBPS_ALT_REPOSITORY" ] && arg="$arg -r $XBPS_ALT_REPOSITORY"
|
||||
[ -n "$XBPS_USE_GIT_REVS" ] && arg="$arg -G"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue