summaryrefslogtreecommitdiff
path: root/src/chroot-tools/hooks-chcleanup.sh
blob: 86c872c19f7323f74cb3eac59f804d7dd6bc9e36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env bash
set -euE

hook_pre_build+=("clean_chroot")

clean_chroot() (
	set +x
	local copydir=$1
	if $INCHROOT; then
		cd /startdir
		sudo -u nobody "$(librelib chroot/chcleanup)"
	else
		librechroot "${librechroot_flags[@]}" clean-pkgs
	fi
)