From 727e97151490b2811612049bc102235d564f86da Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 11 Nov 2013 13:29:15 +0100 Subject: initcpio: only add if not set already --- initcpio/hook/paccache | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'initcpio') diff --git a/initcpio/hook/paccache b/initcpio/hook/paccache index eaf3484..bd961ee 100644 --- a/initcpio/hook/paccache +++ b/initcpio/hook/paccache @@ -3,12 +3,13 @@ run_latehook() { local newroot="/new_root/" - if [[ -n "${pacserve}" ]]; then + 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 - case $(uname -m) in + 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..." @@ -21,5 +22,6 @@ run_latehook() { echo "pacdbserve hosts = ${pacdbserve_i686}" >> ${newroot}/etc/pacredir.conf fi ;; - esac + esac + fi } -- cgit v1.2.3-70-g09d2