summaryrefslogtreecommitdiff
path: root/auto/functions/debpool-hook
blob: adc0aaa62d1cc736e625dcb7d3f2a9059d5757cb (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
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash

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

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

if [ "$current_script" = "binary_rootfs" ]; then
	echo "HOOK: debpool@binary-rootfs"
	for dir in chroot/chroot/run/live/medium chroot/run/live/medium
	do
		[ -d $dir ] || continue
		rm -rf debpool
		echo "DEBUG: $dir"
		mv $dir debpool
		mkdir -p binary
		if [ -e debpool/bin ]; then
		#mkdir -p binary/bin
		mv debpool/bin binary
		fi

echo "DEBUG: debpool"
ls debpool
#ls debpool/image
#ls debpool/image/debian
		if [ -e debpool/debian ]; then
		mv debpool/debian binary/
		fi

		#rmdir debpool/image
		[ -e debpool/keep ] || rm -r debpool
		break
	done
fi