From 965171246df6c48ff9e30c2f8f0969b3986105e2 Mon Sep 17 00:00:00 2001
From: cdsteinkuehler <charles@steinkuehler.net>
Date: Sat, 19 Nov 2016 11:41:42 -0600
Subject: [PATCH] Preprocess conf files with m4 (#92)

Use m4 to preprocess configuration files, allowing the use of
m4_include() and other features in configuration files.

Signed-off-by: Charles Steinkuehler <charles@steinkuehler.net>
---
 RootStock-NG.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/RootStock-NG.sh b/RootStock-NG.sh
index 9d96d2a52..9f72216db 100755
--- a/RootStock-NG.sh
+++ b/RootStock-NG.sh
@@ -106,7 +106,7 @@ check_project_config () {
 	#${project_config}.conf
 	project_config=$(echo ${project_config} | awk -F ".conf" '{print $1}')
 	if [ -f ${DIR}/configs/${project_config}.conf ] ; then
-		. ${DIR}/configs/${project_config}.conf
+		m4 -P ${DIR}/configs/${project_config}.conf | . /dev/fd/0
 		export_filename="${deb_distribution}-${release}-${image_type}-${deb_arch}-${time}"
 
 		# for automation
@@ -116,7 +116,7 @@ check_project_config () {
 		echo "time=\"${time}\"" >> ${DIR}/.project
 		echo "export_filename=\"${export_filename}\"" >> ${DIR}/.project
 		echo "#" >> ${DIR}/.project
-		cat ${DIR}/configs/${project_config}.conf >> ${DIR}/.project
+		m4 -P ${DIR}/configs/${project_config}.conf >> ${DIR}/.project
 	else
 		echo "Invalid *.conf"
 		exit
-- 
GitLab