summaryrefslogtreecommitdiff
path: root/helpers/lh_installapt
blob: ec199312eece846eab80a204a540bd9d3086e5d4 (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
#!/bin/sh

# lh_installapt

# Install aptitude
lh_chroot "apt-get install --yes --force-yes aptitude"

# FIXME
lh_chroot "apt-key update"

# Install secure apt
if [ "${LIVE_DISTRIBUTION}" = "unstable" ] || [ "${LIVE_DISTRIBUTION}" = "${CODENAME_UNSTABLE}" ] || \
[ "${LIVE_DISTRIBUTION}" = "testing" ] || [ "${LIVE_DISTRIBUTION}" = "${CODENAME_TESTING}" ]
then
	if [ "${LIVE_FLAVOUR}" != "minimal" ] || [ "${LIVE_FLAVOUR}" != "mini" ]
	then
		lh_chroot "apt-get install --yes --force-yes ${LIVE_REPOSITORY_KEYRING}"

		for NAME in ${LIVE_REPOSITORIES}
		do
			eval REPOSITORY_KEY="$`echo LIVE_REPOSITORY_KEY_$NAME`"
			eval REPOSITORY_KEYRING="$`echo LIVE_REPOSITORY_KEYRING_$NAME`"

			if [ -n "${REPOSITORY_KEYRING}" ]
			then
				lh_chroot "aptitude install ${REPOSITORY_KEYRING}"
			elif [ -n "${REPOSITORY_KEY}" ]
			then
				lh_chroot "wget ${REPOSITORY_KEY}"
				lh_chroot "apt-key add `basename ${REPOSITORY_KEY}`"
				lh_chroot "rm -f `basename ${REPOSITORY_KEY}`"
			fi
		done
	fi
fi