From 6b326744d86824fce093cc858535c28affc2fcd6 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Fri, 20 Oct 2023 12:27:25 +0200 Subject: [PATCH 1/2] sdk_lib,run_sdk_container: Modernize a bit - Make cosmetic fixes in help output. - There is usually no need for putting variables inside quotes in assignments. - Use [[ ]] to avoid putting everything into strings. - Use arrays instead of relying on strings to be split on whitespace as it was the case for invoking docker and getting GPG volume flags for docker. - Make sure that some cleanup and trap strings quote variables properly. - Add a "call_docker" function to avoid dealing with "docker" and a new "docker_a" variables when willing to invoke docker. The "docker" variable rather shouldn't be used, but it is still there in case some other scripts were using it. --- run_sdk_container | 131 +++++++++++++++++--------------- sdk_lib/sdk_container_common.sh | 37 +++++---- 2 files changed, 93 insertions(+), 75 deletions(-) diff --git a/run_sdk_container b/run_sdk_container index 43f6b78058..b73f2f73ce 100755 --- a/run_sdk_container +++ b/run_sdk_container @@ -12,38 +12,38 @@ source sdk_lib/sdk_container_common.sh arch="all" name="" -os_version="$(get_git_version)" -sdk_version="$(get_sdk_version_from_versionfile)" +os_version=$(get_git_version) +sdk_version=$(get_sdk_version_from_versionfile) custom_image="" -tty="" +tty=() remove="" cleanup="" usage() { echo " Usage:" - echo " $0 [-t] [-v ] [-V sdk version] [-a arch] [-n ] [-x