summaryrefslogtreecommitdiff
path: root/auto/functions/debpool-hook
blob: e56df349768ca9a15a4cce9e32d4f93d02a6da93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

current_script="$(basename "$0"|sed 's/^lb_//')"

if [ "$current_script" = "chroot_local-hooks" ]; then
	echo "HOOK: debpool@chroot_local-hooks"
	if [ -e config/chroot_debpool ]; then
		mkdir -p chroot/live
		cp config/chroot_debpool/* chroot/live/
	fi
fi

if [ "$current_script" = "binary_rootfs" ]; then
	echo "HOOK: debpool@binary-rootfs"
	for dir in chroot/chroot/live chroot/live
	do
		[ -d $dir ] || continue
		rm -rf debpool
		mv $dir debpool
		mkdir -p binary
		mv debpool/image/debian binary/
		rmdir debpool/image
		[ -e debpool/keep ] || rm -r debpool
		break
	done
fi