From e51e734b00bb75a9bf2eb84559bb852e13589246 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel@debian.org>
Date: Fri, 16 Jan 2009 15:48:01 +0100
Subject: If config.cfg is executable, we execute it and accept its output as
 extra arguments. This makes dynamic configuration possible.

---
 helpers/lh_config | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/helpers/lh_config b/helpers/lh_config
index 2cb1126..c2137ad 100755
--- a/helpers/lh_config
+++ b/helpers/lh_config
@@ -714,13 +714,16 @@ fi
 # Reading existing configuration
 Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
 
-if [ -e config.cfg ]
+if [ -x config.cfg ]
 then
-	Local_arguments $(cat config.cfg) "${@}"
-else
-	Local_arguments "${@}"
+	EXTRA_ARGUMENTS="./config.cfg"
+elif [ -r config.cfg ]
+then
+	EXTRA_ARGUMENTS="$(cat config.cfg)"
 fi
 
+Local_arguments ${EXTRA_ARGUMENTS} "${@}"
+
 if [ -n "${_CONFFILE}" ]
 then
 	Read_conffiles "${_CONFFILE}"
-- 
cgit v1.0