From 55fa597f54cadd91cec67a5489183d71ff801640 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sat, 27 May 2017 01:34:57 +0200 Subject: [PATCH] MT#16391 Support custom output directories This let's us control the directory where files should be written to. Otherwise we'd have to write to the system's /etc/ + /var, which is clearly unwanted. Change-Id: I1010afcd4637928868fc81a0adfafebd3bbce874 --- helper/build_config | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/helper/build_config b/helper/build_config index c80518cb..26d4fd8a 100755 --- a/helper/build_config +++ b/helper/build_config @@ -34,9 +34,15 @@ input_file="$1" # like /etc/ngcp-config/templates/etc/mysql/my.cnf.tt2 [ -n "${PAIR_FILE:-}" ] && y=${y%%.tt2${PAIR_FILE}} # drop trailing suffix '.tt2.pairname' [ -n "${HOST_FILE:-}" ] && y=${y%%.tt2${HOST_FILE}} # drop trailing suffix '.tt2.hostname' y=${y%%.customtt} # drop trailing suffix '.customtt' +# export variable for usage within {pre,post}build scripts, +# OUTPUT_DIRECTORY is for customization during testing +if [ -n "${OUTPUT_DIRECTORY:-}" ] ; then + log_debug "Using output directory $OUTPUT_DIRECTORY" + export output_file="${OUTPUT_DIRECTORY}/${y}" +else + export output_file="${y}" +fi # }}} -export output_file="${y}" # like /etc/mysql/my.cnf, export variable - # for usage within {pre,post}build scripts # pre-execution script in template store: if [ -r "${NGCPCTL_MAIN}/templates/${output_file}.prebuild" ] ; then