summaryrefslogtreecommitdiff
path: root/helpers/lh_depends
blob: 1cb1f52a0a0c0032950d5847f8f42c61fc5a44a6 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/sh

# lh_depends.sh <action> <type>

case "${1}" in
	install)
		if [ -z "${KEEP_MEMTEST86}" ]
		then
			if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
			then
				lh_chroot "aptitude install --assume-yes memtest86+"
			fi
		fi

		if [ -z "${KEEP_SYSLINUX}" ]
		then
			lh_chroot "aptitude install --assume-yes syslinux"
		fi

		case "${2}" in
			usb)
				if [ -z "${KEEP_DOSFSTOOLS}" ]
				then
					lh_chroot "aptitude install --assume-yes dosfstools"
				fi

				if [ -z "${KEEP_MTOOLS}" ]
					then
					lh_chroot "aptitude install --assume-yes mtools"
				fi

				if [ -z "${KEEP_PARTED}" ]
				then
					lh_chroot "aptitude install --assume-yes parted"
				fi
				;;
		esac
		;;

	remove)
		if [ -z "${KEEP_MEMTEST86}" ]
		then
			if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
			then
				lh_chroot "aptitude purge --assume-yes memtest86+"
			fi
		fi

		if [ -z "${KEEP_SYSLINUX}" ]
		then
			lh_chroot "aptitude purge --assume-yes syslinux"
		fi

		case "${2}" in
			usb)
				if [ -z "${KEEP_DOSFSTOOLS}" ]
				then
					lh_chroot "aptitude purge --assume-yes dosfstools"
				fi

				if [ -z "${KEEP_MEMTEST86}" ]
				then
					if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
					then
						lh_chroot "aptitude purge --assume-yes memtest86+"
					fi
				fi

				if [ -z "${KEEP_MTOOLS}" ]
				then
					lh_chroot "aptitude purge --assume-yes mtools"
				fi

				if [ -z "${KEEP_PARTED}" ]
				then
					lh_chroot "aptitude purge --assume-yes parted"
				fi

				if [ -z "${KEEP_SYSLINUX}" ]
				then
					lh_chroot "aptitude purge --assume-yes syslinux"
				fi
				;;
		esac
		;;
esac