kiss: Added pre-extract hook.

This is handy for manipulating the package manager internals prior
to source extraction. I currently use this to conditionally run the
source extraction, build and tarball creation in memory (tmpfs).

    pre-extract)
        case $PKG in
            # Reset the directories to their default values.
            firefox*|rust|llvm|clang)
                mak_dir=${KISS_TMPDIR:-$cac_dir}/build-${pid:=$$}
                pkg_dir=${KISS_TMPDIR:-$cac_dir}/pkg-$pid
            ;;

            # Package is not in the above list, do everything in
            # memory. Really nice speedups.
            *)
                log "$PKG" "Activating tmpfs"

                mak_dir=/tmp/build-$pid
                pkg_dir=/tmp/pkg-$pid
            ;;
        esac

        mkdir -p "$mak_dir" "$pkg_dir/$PKG/var/db/kiss/installed"
    ;;
This commit is contained in:
Dylan Araps 2020-06-06 07:33:50 +03:00
parent bf3bc4a546
commit 8fc5b5c85e
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
2 changed files with 3 additions and 1 deletions

1
kiss
View File

@ -645,6 +645,7 @@ pkg_build() {
for pkg do in=$((in + 1))
log "$pkg" "Building package ($in/$#)"
run_hook pre-extract "$pkg" "$pkg_dir/$pkg"
pkg_extract "$pkg"
repo_dir=$(pkg_find "$pkg")

3
kiss.1
View File

@ -62,7 +62,8 @@ export KISS_FORCE=0
#
# $PKG: Name of the current package .
# $TYPE: The type of hook (valid: pre-build, post-build, build-fail,
# pre-install, post-install).
# pre-install, post-install
# pre-extract, post-package).
# $DEST: The full path to where 'make install' will put the package.
#
# Simple example script: