[how] before: whether build container or not, all will call log_info(): "start/finish build $container" after: only when actually build container, will call log_info(): "start/finish build $container"
[why] if not build container, but echo "start build $container", it's very confusing, mistakenly think that repeatedly build container.
Signed-off-by: Liu Yinsi liuyinsi@163.com --- sparrow/4-docker/buildall | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/sparrow/4-docker/buildall b/sparrow/4-docker/buildall index c838f86..c676e6f 100755 --- a/sparrow/4-docker/buildall +++ b/sparrow/4-docker/buildall @@ -26,21 +26,24 @@ do_one() local container_name=$(basename $container) lockfile-create -q --use-pid --retry 100 --lock-name "$container_name".lock
- log_info "start build $container." mkdir $tmpdir/$container_name 2>/dev/null && ( cd "$container" [ "$container_name" == 'ssh-r' ] && exit docker images | grep -wq "$container_name" if [ "$?" != 0 ] || [ "$action" != "run-only" ]; then + + log_info "start build $container." + [ -x build ] && ./build [ -x install ] && ./install + + log_info "finish build $container." fi [ -x first-run ] && ./first-run [ -x start ] && ./start [ "$container_name" == 'initrd-lkp' ] && ./run ) - log_info "finish build $container." lockfile-remove --lock-name "$container_name".lock }