#!/bin/ash -efu

. "${0%/*}"/mki-sh-functions

verbose "has started executing."

case "$PROG" in
	*-image-*) dir="$subdir" ;;
esac

[ -d "$chroot" ] ||
	fatal "$dir: not look like a work directory of hasher."

hasher_args="$verbose $quiet ${HSH_EXCLUDE_DOCS:+--excludedocs} ${HSH_NUMBER:+--number="$HSH_NUMBER"}"

mki_list_pkgs "$@" |
	xargs -r env -i PATH="$PATH" hsh-install $hasher_args -- "$dir"
