summaryrefslogtreecommitdiff
path: root/auto/functions/debpool-hook
blob: c86a065e6a696e3ace489a5677c7956bdf9f1132 (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
#!/bin/bash

if [ "$(basename "$0")" = "lb_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 [ "$(basename "$0")" = "lb_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