beautysh: re-format
beautysh is enabled in the openbmc-build-scripts on Bash/Zsh/POSIX-sh
files to have a consistent formatting. Re-run the formatter on the
whole repository.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I584c76da2eb35af2177a97d5cd4b882f9881fb80
diff --git a/bin/gen_setup.sh b/bin/gen_setup.sh
index 2aed0ea..148fe4b 100755
--- a/bin/gen_setup.sh
+++ b/bin/gen_setup.sh
@@ -13,43 +13,43 @@
shopt -s extglob
-function get_pgm_path_info {
- local program_path_var="${1:-program_path}" ; shift
- local program_name_var="${1:-program_name}" ; shift
- local program_dir_path_var="${1:-program_dir_path}" ; shift
- local follow_links="${1:-0}" ; shift
+function get_pgm_path_info() {
+ local program_path_var="${1:-program_path}" ; shift
+ local program_name_var="${1:-program_name}" ; shift
+ local program_dir_path_var="${1:-program_dir_path}" ; shift
+ local follow_links="${1:-0}" ; shift
- # Determine the program path, name and dir path and assign them to the variables indicated by the caller.
+ # Determine the program path, name and dir path and assign them to the variables indicated by the caller.
- # Description of argument(s):
- # program_path_var The name of the variable to receive the program path.
- # program_name_var The name of the variable to receive the program name.
- # program_dir_path_var The name of the variable to receive the program dir path.
- # follow_links If the program running is actually a link to another file, use that file
- # when calculating the above values.
+ # Description of argument(s):
+ # program_path_var The name of the variable to receive the program path.
+ # program_name_var The name of the variable to receive the program name.
+ # program_dir_path_var The name of the variable to receive the program dir path.
+ # follow_links If the program running is actually a link to another file, use that file
+ # when calculating the above values.
- local _spn_loc_program_path_="${0}"
+ local _spn_loc_program_path_="${0}"
- # The program name is the program path minus all characters up to and including the first slash.
- local _spn_loc_program_name_=${_spn_loc_program_path_##*/}
- # The program dir path is the program path minus everything from the last slash to the end of the string.
- local _spn_loc_program_dir_path_=${_spn_loc_program_path_%${_spn_loc_program_name_}}
+ # The program name is the program path minus all characters up to and including the first slash.
+ local _spn_loc_program_name_=${_spn_loc_program_path_##*/}
+ # The program dir path is the program path minus everything from the last slash to the end of the string.
+ local _spn_loc_program_dir_path_=${_spn_loc_program_path_%${_spn_loc_program_name_}}
- # If program dir path does not start with a slash then it is relative. Convert it to absolute.
- if [ "${_spn_loc_program_dir_path_:0:1}" != "/" ] ; then
- _spn_loc_program_dir_path_="$(readlink -f ${_spn_loc_program_dir_path_})/"
- # Re-assemble the parts into program path variable.
- _spn_loc_program_path_="${_spn_loc_program_dir_path_}${_spn_loc_program_name_}"
- fi
+ # If program dir path does not start with a slash then it is relative. Convert it to absolute.
+ if [ "${_spn_loc_program_dir_path_:0:1}" != "/" ] ; then
+ _spn_loc_program_dir_path_="$(readlink -f ${_spn_loc_program_dir_path_})/"
+ # Re-assemble the parts into program path variable.
+ _spn_loc_program_path_="${_spn_loc_program_dir_path_}${_spn_loc_program_name_}"
+ fi
- if (( follow_links )) ; then
- _spn_loc_program_path_=$(readlink -f ${_spn_loc_program_path_})
- # Re-calculate program_name in case it is different now.
- _spn_loc_program_name_=${_spn_loc_program_path_##*/}
- fi
+ if (( follow_links )) ; then
+ _spn_loc_program_path_=$(readlink -f ${_spn_loc_program_path_})
+ # Re-calculate program_name in case it is different now.
+ _spn_loc_program_name_=${_spn_loc_program_path_##*/}
+ fi
- # Set caller's variables.
- cmd_buf="${program_path_var}=\"\${_spn_loc_program_path_}\" ; ${program_name_var}=\"\${_spn_loc_program_name_}\" ; ${program_dir_path_var}=\"\${_spn_loc_program_dir_path_}\""
- eval "${cmd_buf}"
+ # Set caller's variables.
+ cmd_buf="${program_path_var}=\"\${_spn_loc_program_path_}\" ; ${program_name_var}=\"\${_spn_loc_program_name_}\" ; ${program_dir_path_var}=\"\${_spn_loc_program_dir_path_}\""
+ eval "${cmd_buf}"
}