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

hooks_pre_build+=("clean_chroot")

clean_chroot() (
	set +x
	local copydir=$1
	if $INCHROOT; then
		cd /build
		sudo -u nobody "$(librelib chroot/chcleanup)"
	else
		librechroot -l "$copydir" clean-pkgs
	fi
	r=$?; echo clean_chroot returning $r; return $r
)