From ed7dbb9cdf0fe0459999b7efc6ac1b777ce519dd Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 10 Oct 2009 21:51:43 +0200 Subject: ct: check_prereqs: Use an anonymous function to source the prereqs file --- bin/ct | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/bin/ct b/bin/ct index 329a35f..298bac9 100755 --- a/bin/ct +++ b/bin/ct @@ -469,18 +469,6 @@ function check_prereqs { cd $PKG_DIR/$package info "$1: checking prerequisites\n" - # function scope → typeset and localoptions are possible - function source_prereqs { - { - source prereqs - } always { - if (( TRY_BLOCK_ERROR )) { - warn "Error in prereqs script\n" - TRY_BLOCK_ERROR=0 - } - } - } - function is_installed { [[ -d $PKG_DIR/$1 ]] } @@ -521,7 +509,17 @@ function check_prereqs { } } - source_prereqs + # function scope → typeset and localoptions are possible + function { + { + source prereqs + } always { + if (( TRY_BLOCK_ERROR )) { + warn "Error in prereqs script\n" + TRY_BLOCK_ERROR=0 + } + } + } if [[ -n $warn || -n $info ]] { [[ -n $warn ]] && warn $warn -- cgit v1.2.3