aboutsummaryrefslogtreecommitdiffstats
path: root/initcpio/hook/paccache
blob: bd961ee89be17d71826e6aed5ffe1d5125c0ee79 (about) (plain) (blame)
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/sh

run_latehook() {
	local newroot="/new_root/"
	
	if ! grep -q '^pacserve hosts' ${newroot}/etc/pacredir.conf -a [[ -n "${pacserve}" ]]; then
		msg ":: Adding pacserve host '${pacserve}' to pacredir.conf..."
		echo "pacserve hosts = ${pacserve}" >> ${newroot}/etc/pacredir.conf
	fi

	if ! grep -q '^pacdbserve hosts' ${newroot}/etc/pacredir.conf; then
		case $(uname -m) in
			x86_64)
				if [[ -n "${pacdbserve_x86_64}" ]]; then
					msg ":: Adding pacdbserve host '${pacdbserve_x86_64}' to pacredir.conf..."
					echo "pacdbserve hosts = ${pacdbserve_x86_64}" >> ${newroot}/etc/pacredir.conf
				fi
				;;
			i686)
				if [[ -n "${pacdbserve_i686}" ]]; then
					msg ":: Adding pacdbserve host '${pacdbserve_i686}' to pacredir.conf..."
					echo "pacdbserve hosts = ${pacdbserve_i686}" >> ${newroot}/etc/pacredir.conf
				fi
				;;
		esac
	fi
}