<commit_before># This hook registers a XBPS binary package into the specified local repository.

registerpkg() {
	local repo="$1" pkg="$2" arch="$3"

	if [ ! -f ${repo}/${pkg} ]; then
		msg_error "Unexistent binary package ${repo}/${pkg}!\n"
	fi

	if [ -n "${arch}" ]; then
		export XBPS_TARGET_ARCH=${arch}
	fi
	msg_normal "Registering ${pkg} into ${repo} ...\n"

	if [ -n "$XBPS_CROSS_BUILD" ]; then
		$XBPS_RINDEX_XCMD ${XBPS_BUILD_FORCEMODE:+-f} -a ${repo}/${pkg}
	else
		$XBPS_RINDEX_CMD ${XBPS_BUILD_FORCEMODE:+-f} -a ${repo}/${pkg}
	fi
	unset XBPS_TARGET_ARCH
}

hook() {
	local arch= binpkg= pkgdir=

	if [ -n "$noarch" ]; then
		arch=noarch
	elif [ -n "$XBPS_TARGET_MACHINE" ]; then
		arch=$XBPS_TARGET_MACHINE
	else
		arch=$XBPS_MACHINE
	fi
	if [ -z "$noarch" -a -z "$XBPS_CROSS_BUILD" -a -n "$XBPS_ARCH" -a "$XBPS_ARCH" != "$XBPS_TARGET_MACHINE" ]; then
		arch=${XBPS_ARCH}
	fi
	if [ -n "$repository" ]; then
		pkgdir=$XBPS_REPOSITORY/$repository
	else<commit_msg>hooks/register-pkg: register 32bit pkgs in cross mode too.<commit_after># This hook registers a XBPS binary package into the specified local repository.

registerpkg() {
	local repo="$1" pkg="$2" arch="$3"

	if [ ! -f ${repo}/${pkg} ]; then
		msg_error "Unexistent binary package ${repo}/${pkg}!\n"
	fi

	msg_normal "Registering ${pkg} into ${repo} ...\n"
	if [ -n "${arch}" ]; then
		XBPS_TARGET_ARCH=${arch} $XBPS_RINDEX_CMD ${XBPS_BUILD_FORCEMODE:+-f} -a ${repo}/${pkg}
	else
		if [ -n "$XBPS_CROSS_BUILD" ]; then
			$XBPS_RINDEX_XCMD ${XBPS_BUILD_FORCEMODE:+-f} -a ${repo}/${pkg}
		else
			$XBPS_RINDEX_CMD ${XBPS_BUILD_FORCEMODE:+-f} -a ${repo}/${pkg}
		fi
	fi
}

hook() {
	local arch= binpkg= pkgdir=

	if [ -n "$noarch" ]; then
		arch=noarch
	elif [ -n "$XBPS_TARGET_MACHINE" ]; then
		arch=$XBPS_TARGET_MACHINE
	else
		arch=$XBPS_MACHINE
	fi
	if [ -z "$noarch" -a -z "$XBPS_CROSS_BUILD" -a -n "$XBPS_ARCH" -a "$XBPS_ARCH" != "$XBPS_TARGET_MACHINE" ]; then
		arch=${XBPS_ARCH}
	fi
	if [ -n "$repository" ]; then
		pkgdir=$XBPS_REPOSITORY/$repository
	else
{'fraction_non_alphanumeric': 0.17820324005891017, 'fraction_numerical': 0.0039273441335297005, 'mean_word_length': 4.252577319587629, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6802154', 'n_tokens_mistral': 910, 'n_tokens_neox': 879, 'n_words': 200}