summaryrefslogtreecommitdiff
path: root/bin/ct
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-10-10 21:51:43 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2009-10-10 21:51:43 +0200
commited7dbb9cdf0fe0459999b7efc6ac1b777ce519dd (patch)
tree29d74a2c1036c49a7812ad044efae5d2412624d5 /bin/ct
parent5036a08b042b5f311ac2f21956ac3ab133942b60 (diff)
ct: check_prereqs: Use an anonymous function to source the prereqs file
Diffstat (limited to 'bin/ct')
-rwxr-xr-xbin/ct24
1 files 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