From dd763e4635f74c52592ff27571e25a4c36d5210e Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 7 Dec 2020 18:28:06 +0100 Subject: Add script helpers This patch adds script helpers, so that we do not have to write out echo "#BUTIDO:STATE:OK:succeeded" but can write {{state "OK"}} for example. Three helpers were added, for progress, state and phase. These can be only used in bash scripts for now. Signed-off-by: Matthias Beyer --- examples/packages/example_3/pkg.toml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'examples/packages') diff --git a/examples/packages/example_3/pkg.toml b/examples/packages/example_3/pkg.toml index c8cd1cf..f908065 100644 --- a/examples/packages/example_3/pkg.toml +++ b/examples/packages/example_3/pkg.toml @@ -32,33 +32,34 @@ unpack.script = ''' # repo where we prepare a build container. # This is, of course, not be the way it would be done in a real-world scenario! depinst.script = ''' - echo "#BUTIDO:PHASE:depinst" - echo "#BUTIDO:PROGRESS:0" + {{phase "depinst"}} + {{progress 0}} for n in {1..10}; do sleep 0.1; done - echo "#BUTIDO:PROGRESS:10" + {{progress 10}} ''' configure.script = ''' - echo "#BUTIDO:PHASE:configure-preparing" + {{phase "configure-preparing"}} for n in {1..10}; do sleep 0.1; done - echo "#BUTIDO:PROGRESS:20" + {{progress 20}} for n in {1..10}; do sleep 0.1; done ''' build.script = ''' - echo "#BUTIDO:PHASE:build" + {{phase "build"}} for n in {1..10}; do sleep 0.1; done echo "#BUTIDO:PROGRESS:60" + {{progress 60}} ''' install.script = ''' - echo "#BUTIDO:PHASE:install" + {{phase "install"}} for n in {1..10}; do sleep 0.1; done - echo "#BUTIDO:PROGRESS:80" + {{progress 80}} ''' -- cgit v1.2.3