From d4e185764f4413a085076468c9e91d6e5eaa0cee Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 9 Jul 2019 11:46:49 +0200 Subject: [PATCH] TT#62401 Special case ngcp-service files and generate them always first These files are an intermediate data source, which are being used also during builds of templates. We cannot make them first stage YAML sources as they do depend on information coming from the first stage YAML sources themselves. So we need to special-case them to make sure they are always built first, so that the other files have up-to-date information to use when being built. Change-Id: I6cfd6e80823ddfaf71e2246de5518b9cb6d6a1d2 --- functions/main | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/functions/main b/functions/main index e87ba77b..8f8bd8fa 100644 --- a/functions/main +++ b/functions/main @@ -219,6 +219,7 @@ generate_template_list() { local filelist_prepared=$(mktemp) local filelist_final=$(mktemp) + local filelist_sorted=$(mktemp) for dir in ${CONFIG_POOL} ; do [ -n "${dir}" ] || ( echo "${dir} doesn't exist" >&2 ; continue ) @@ -323,16 +324,23 @@ generate_template_list() { echo "$line" >> "${filelist_final}" done - # output file list, make sure we provide the file names just once - sort -u ${filelist_final} + sort -u ${filelist_final} >${filelist_sorted} + + # Output file list, make sure we provide the file names just once, and + # special case the ngcp-service files, as they are a second stage source + # of data required during configuration file building, which depends at + # the same time on the main YAML files. + grep ngcp-service ${filelist_sorted} || true + grep -v ngcp-service ${filelist_sorted} || true if [ -n "${DEBUG:-}" ] ; then # send to stderr since stdout is used from outside log_debug "Not removing temporary filelist files since we are in debug mode:" >&2 log_debug " filelist_prepared = ${filelist_prepared}" >&2 log_debug " filelist_final = ${filelist_final}" >&2 + log_debug " filelist_sorted = ${filelist_sorted}" >&2 else - rm -f "${filelist_prepared}" "${filelist_final}" + rm -f "${filelist_prepared}" "${filelist_final}" "${filelist_sorted}" fi unset filelist_prepared filelist_final