summaryrefslogtreecommitdiff
path: root/functions/conffile.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-11-13 21:09:34 +0100
committerDaniel Baumann <daniel@debian.org>2011-03-09 18:22:29 +0100
commita2c2b6841f29e09a4da4d55d7e690c011dd963db (patch)
treef330f2865fa94ea48840b2f32ee2df5f216d2f33 /functions/conffile.sh
parent914b4739de5d892bc060791cee6b1014d59d8ca9 (diff)
downloadvyos-live-build-a2c2b6841f29e09a4da4d55d7e690c011dd963db.tar.gz
vyos-live-build-a2c2b6841f29e09a4da4d55d7e690c011dd963db.zip
Extending conffiles to allow config/., config/., as well as config/, config/. and config/..
Diffstat (limited to 'functions/conffile.sh')
-rwxr-xr-xfunctions/conffile.sh24
1 files changed, 15 insertions, 9 deletions
diff --git a/functions/conffile.sh b/functions/conffile.sh
index bd5547e60..f60abe243 100755
--- a/functions/conffile.sh
+++ b/functions/conffile.sh
@@ -11,16 +11,22 @@ set -e
Read_conffile ()
{
- FILE="${1}"
+ FILES="${1} ${1}.${LH_ARCHITECTURE} ${1}.${DISTRIBUTION}"
+ FILES="${FILES} config/$(echo ${PROGRAM} | sed -e 's/^lh_//')"
+ FILES="${FILES} config/$(echo ${PROGRAM} | sed -e 's/^lh_//').${ARCHITECTURE}"
+ FILES="${FILES} config/$(echo ${PROGRAM} | sed -e 's/^lh_//').${DISTRIBUTION}"
- if [ -f "${FILE}" ]
- then
- if [ -r "${FILE}" ]
+ for FILE in ${FILES}
+ do
+ if [ -f "${FILE}" ]
then
- Echo_debug "Reading configuration file ${FILE}"
- . "${FILE}"
- else
- Echo_warning "Failed to read configuration file ${FILE}"
+ if [ -r "${FILE}" ]
+ then
+ Echo_debug "Reading configuration file ${FILE}"
+ . "${FILE}"
+ else
+ Echo_warning "Failed to read configuration file ${FILE}"
+ fi
fi
- fi
+ done
}