summaryrefslogtreecommitdiff
path: root/functions/conffile.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2010-09-26 12:38:38 +0200
committerDaniel Baumann <daniel@debian.org>2010-09-26 15:11:45 +0200
commit152d608f61fd22a1414c3a90ba061b790200350a (patch)
tree44a6d3a12cd11067aea2a4d43eb9133cc25bad2f /functions/conffile.sh
downloadvyos-live-build-152d608f61fd22a1414c3a90ba061b790200350a.tar.gz
vyos-live-build-152d608f61fd22a1414c3a90ba061b790200350a.zip
Adding debian version 3.0~a1-1.
Diffstat (limited to 'functions/conffile.sh')
-rwxr-xr-xfunctions/conffile.sh55
1 files changed, 55 insertions, 0 deletions
diff --git a/functions/conffile.sh b/functions/conffile.sh
new file mode 100755
index 000000000..02730dfd8
--- /dev/null
+++ b/functions/conffile.sh
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+## live-build(7) - System Build Scripts
+## Copyright (C) 2006-2010 Daniel Baumann <daniel@debian.org>
+##
+## live-build comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+## This is free software, and you are welcome to redistribute it
+## under certain conditions; see COPYING for details.
+
+
+Get_conffiles ()
+{
+ if [ -n "${LB_CONFIG}" ]
+ then
+ FILES="${LB_CONFIG}"
+ else
+ for FILE in ${@}
+ do
+ FILES="${FILES} ${FILE} ${FILE}.${LB_ARCHITECTURE} ${FILE}.${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}"
+ done
+ fi
+
+ echo ${FILES}
+}
+
+Read_conffiles ()
+{
+ for CONFFILE in Get_conffiles "${@}"
+ do
+ if [ -f "${CONFFILE}" ]
+ then
+ if [ -r "${CONFFILE}" ]
+ then
+ Echo_debug "Reading configuration file %s" "${CONFFILE}"
+ . "${CONFFILE}"
+ else
+ Echo_warning "Failed to read configuration file %s" "${CONFFILE}"
+ fi
+ fi
+ done
+}
+
+Print_conffiles ()
+{
+ for CONFFILE in Get_conffiles "${@}"
+ do
+ if [ -f "${CONFFILE}" ]
+ then
+ Echo_file "${CONFFILE}"
+ fi
+ done
+}