From 4004a3a9cabc584df629bfc74167d9c6a3cca734 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Thu, 4 Jun 2015 11:01:26 +0200 Subject: [PATCH] cpu_quota: pre-define variables in run script If a regexp does not match but the variable is used later, the script exits with an error like can't read "slow_quota_sp": no such variable --- repos/os/run/cpu_quota.run | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/repos/os/run/cpu_quota.run b/repos/os/run/cpu_quota.run index 0211e8b348..2fe1bf0ed2 100644 --- a/repos/os/run/cpu_quota.run +++ b/repos/os/run/cpu_quota.run @@ -170,6 +170,10 @@ proc check_quota { name opt_sp quota_sp opt quota } { } } +# pre-define variables if regexp does not match +set slow_quota ""; set midl_quota ""; set fast_quota "" +set slow_quota_sp ""; set midl_quota_sp ""; set fast_quota_sp "" + regexp {[0-9]+} [regexp -inline {slow. quota [0-9]+} $output] slow_quota regexp {[0-9]+} [regexp -inline {midl. quota [0-9]+} $output] midl_quota regexp {[0-9]+} [regexp -inline {fast. quota [0-9]+} $output] fast_quota