From 3f39d0e11b54d025d47eea298a08fc744d1b8974 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 28 Apr 2017 23:12:29 +0200 Subject: rename files to 'pacredir' --- initcpio/hooks/paccache | 29 ----------------------------- initcpio/hooks/pacredir | 29 +++++++++++++++++++++++++++++ initcpio/install/paccache | 9 --------- initcpio/install/pacredir | 11 +++++++++++ 4 files changed, 40 insertions(+), 38 deletions(-) delete mode 100644 initcpio/hooks/paccache create mode 100644 initcpio/hooks/pacredir delete mode 100644 initcpio/install/paccache create mode 100644 initcpio/install/pacredir (limited to 'initcpio') diff --git a/initcpio/hooks/paccache b/initcpio/hooks/paccache deleted file mode 100644 index 5f8d560..0000000 --- a/initcpio/hooks/paccache +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -run_latehook() { - local newroot="/new_root/" - - if ! grep -q '^pacserve hosts' ${newroot}/etc/pacredir.conf; then - if [[ -n "${pacserve}" ]]; then - msg ":: Adding pacserve host '${pacserve}' to pacredir.conf..." - echo "pacserve hosts = ${pacserve}" >> ${newroot}/etc/pacredir.conf - fi - 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 -} diff --git a/initcpio/hooks/pacredir b/initcpio/hooks/pacredir new file mode 100644 index 0000000..5f8d560 --- /dev/null +++ b/initcpio/hooks/pacredir @@ -0,0 +1,29 @@ +#!/bin/sh + +run_latehook() { + local newroot="/new_root/" + + if ! grep -q '^pacserve hosts' ${newroot}/etc/pacredir.conf; then + if [[ -n "${pacserve}" ]]; then + msg ":: Adding pacserve host '${pacserve}' to pacredir.conf..." + echo "pacserve hosts = ${pacserve}" >> ${newroot}/etc/pacredir.conf + fi + 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 +} diff --git a/initcpio/install/paccache b/initcpio/install/paccache deleted file mode 100644 index 1cb06a4..0000000 --- a/initcpio/install/paccache +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -build() { - add_runscript -} - -help() { - echo "This hook adds Server to pacredir.conf from inside initramfs." -} diff --git a/initcpio/install/pacredir b/initcpio/install/pacredir new file mode 100644 index 0000000..f9663af --- /dev/null +++ b/initcpio/install/pacredir @@ -0,0 +1,11 @@ +#!/bin/sh + +build() { + add_runscript +} + +help() { + echo 'This hook adds servers to pacredir.conf from inside initramfs.' + echo 'Useless for installed systems, but can be handy with' + echo 'no-persistent configurations.' +} -- cgit v1.2.3-70-g09d2