fn eval_build_template
content = set ${1}
# Build related definitions
content = replace ${content} "{build_branch_name}" ${BUILD_BRANCH}
content = replace ${content} "{build_tag}" ${BUILD_TAG}
content = replace ${content} "{version}" ${BUILD_VERSION}
content = replace ${content} "{target_short}" ${BUILD_FLAVOR}
content = replace ${content} "{target}" ${BUILD_TARGET}
content = replace ${content} "{build_arch}" ${BUILD_ARCH}
content = replace ${content} "{deb_arch}" ${DEB_ARCH}
content = replace ${content} "{build_dir}" ${BUILD_DIR}
# File hash
content = replace ${content} "{source_package_tar_hash}" ${SOURCE_PACKAGE_TAR_HASH}
return ${content}
end
fn eval_build_template_file
echo "Evaluating build template file: File = ${1}, Target = ${2}"
content = readfile ${1}
content = eval_build_template ${content}
echo "Write evaluated build template file: File = ${2}, Content = ${content}"
writefile ${2} ${content}
end