Change several python and robot files to 110 chars
Taking advantage of current team limit of 110 chars.
Change-Id: If7ab51fe894889967b8c8bb2f2fa4664f01117d5
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/bin/select_version b/bin/select_version
index ff09003..d6fca43 100755
--- a/bin/select_version
+++ b/bin/select_version
@@ -1,26 +1,22 @@
#!/bin/bash
-# This script is a wrapper for programs that may have alternate versions
-# (e.g. python2, python3). This wrapper allows the user to influence the
-# selection of the program version by setting the <program name>_VERSION (e.g.
-# PYTHON_VERSION, ROBOT_VERSION, etc.) environment variable.
+# This script is a wrapper for programs that may have alternate versions (e.g. python2, python3). This
+# wrapper allows the user to influence the selection of the program version by setting the <program
+# name>_VERSION (e.g. PYTHON_VERSION, ROBOT_VERSION, etc.) environment variable.
-# Users would be expected to create a link with the base name of the program
-# that points to this file.
+# Users would be expected to create a link with the base name of the program that points to this file.
# Example:
# cd openbmc-test-automation/bin
# ln -s select_version python
-# The PATH variable should contain the expanded path to
-# openbmc-test-automation/bin.
+# The PATH variable should contain the expanded path to openbmc-test-automation/bin.
-# If <program name>_VERSION is blank or not set, then the program version
-# will be whatever the system default program version is. If <program
-# name>_VERSION is set to a value, then that value will be appended to the name
-# of the program (e.g. if PYTHON_VERSION = "3", then python3 will be used.).
-# If <program name>_VERSION is set to some value that does not correspond to a
-# valid program version for the given system, this program will fail.
+# If <program name>_VERSION is blank or not set, then the program version will be whatever the system
+# default program version is. If <program name>_VERSION is set to a value, then that value will be appended
+# to the name of the program (e.g. if PYTHON_VERSION = "3", then python3 will be used.). If <program
+# name>_VERSION is set to some value that does not correspond to a valid program version for the given
+# system, this program will fail.
# Make sure program_name is set.
@@ -31,12 +27,10 @@
function get_target_program_path {
local target_program_path_var="${1:-target_program_path}" ; shift
- # Get the full path to the "real" program and assign it to the variable
- # named in target_program_path_var.
+ # Get the full path to the "real" program and assign it to the variable named in target_program_path_var.
# Description of argument(s):
- # target_program_path_var The name of the variable to receive the
- # result.
+ # target_program_path_var The name of the variable to receive the result.
# Example result:
@@ -52,8 +46,7 @@
# The typical use of this program would be to create a link to it like this:
# ln -s select_version python
- # That being the case, get the name of this actual program (rather than the
- # name of the link to it).
+ # That being the case, get the name of this actual program (rather than the name of the link to it).
base_program_path=$(readlink -f "${0}")
base_program_name=${base_program_path##*/}
@@ -70,8 +63,7 @@
# Compose the alternate_program_name (e.g. python3).
alternate_program_name=${program_name}${!version_var_name}
- # Now use the "type" built-in to search the PATH variable for a list of
- # target program candidates.
+ # Now use the "type" built-in to search the PATH variable for a list of target program candidates.
candidates=$(type -ap ${alternate_program_name})
# Example candidates:
@@ -79,20 +71,17 @@
# /usr/bin/python
# In this example, the first candidate is actually a link to
- # /home/robot/openbmc-test-automation/bin/select_version. As such it will
- # be rejected.
+ # /home/robot/openbmc-test-automation/bin/select_version. As such it will be rejected.
for candidate in ${candidates}
do
if [ -L "${candidate}" ] ; then
- # The candidate is a link so we need to see if it's a link to this
- # program file.
+ # The candidate is a link so we need to see if it's a link to this program file.
base_file_path=$(readlink "${candidate}")
[ "${base_file_path}" == "${base_program_name}" ] && continue
fi
- # The candidate is NOT a link so it qualifies as the desired target
- # program path.
+ # The candidate is NOT a link so it qualifies as the desired target program path.
eval ${target_program_path_var}=\"\${candidate}\"
return
@@ -107,8 +96,8 @@
# Compose program path var name (e.g. PYTHON_PGM_PATH).
pgm_path_var_name=${program_uppercase_name}_PGM_PATH
- # Set and export pgm_path_var_name (e.g. PYTHON_PGM_PATH=/usr/bin/python3).
- # This value can be used by child programs for debug.
+ # Set and export pgm_path_var_name (e.g. PYTHON_PGM_PATH=/usr/bin/python3). This value can be used by
+ # child programs for debug.
eval export ${pgm_path_var_name}=${target_program_path}
if [ "${1}" == "--print_only" ] ; then