From 26e8f0b19d4b6bbf13c7b7a70bddb67c6550ba72 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Wed, 6 Aug 2008 07:52:00 +0530 Subject: Initialise some basic variables: ATOMS, P, PN, PV --- slave/autotua/bin/jobuild-functions.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/slave/autotua/bin/jobuild-functions.sh b/slave/autotua/bin/jobuild-functions.sh index c146a1b..5dd2749 100644 --- a/slave/autotua/bin/jobuild-functions.sh +++ b/slave/autotua/bin/jobuild-functions.sh @@ -14,6 +14,24 @@ die() { exit 1 } +jvars() { + P=${jobuild##*/} + P=${P%.jobuild} + PN=${P%-*} + PV=${P##*-} +} + +atoms() { + local temp + temp="${jobuild%/*}/conf/${P}.atoms" + [ -f "${temp}" ] && ATOMS=$(<"${temp}") +} + +initialize() { + jvars + atoms +} + has() { local this=${1}; shift local those=${@} @@ -43,7 +61,7 @@ unpack() { [ ! -s "${srcdir}${x}" ] && die "$myfail: empty file" [ "${x/${JOBFILES_DIR}}" != "${x}" ] && \ - die "Arguments to unpack() should not begin with \${DISTDIR}." + die "Arguments to unpack() should not begin with \${JOBFILES_DIR}." case "${x}" in *.tar) @@ -108,6 +126,7 @@ get_param() { # Param to extract local param="${1}" local jobuild="${2}" + initialise if ! source "${jobuild}"; then die "Unable to source ${jobuild}" @@ -121,6 +140,7 @@ get_jobuild_path() { run_all_phases() { local jobuild="${1}" + initialise if ! source "${jobuild}"; then die "Unable to source ${jobuild}" -- cgit v1.2.3-65-gdbad