diff options
author | Christian Hesse <mail@eworm.de> | 2013-11-11 13:29:15 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2013-11-11 13:29:15 +0100 |
commit | 727e97151490b2811612049bc102235d564f86da (patch) | |
tree | 70e1ed02a32a7acca7dd764af36b7b54ce0a857e /initcpio/hook | |
parent | 4f784fe7f50bc0205d31e643f0ec64eff7195232 (diff) | |
download | pacredir-727e97151490b2811612049bc102235d564f86da.tar.gz pacredir-727e97151490b2811612049bc102235d564f86da.tar.zst |
initcpio: only add if not set already
Diffstat (limited to 'initcpio/hook')
-rw-r--r-- | initcpio/hook/paccache | 8 |
1 files changed, 5 insertions, 3 deletions
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 } |