OS400: post-shellcheck changes adjustments

Build scripts must be executed by the os/400 shell (sh), not bash which
is a PASE program.

Shell function get_make_vars() escaping reworked to match $() subcommand
construct.

Follow-up to 8a622baf9e
Closes #13366
This commit is contained in:
Patrick Monnerat 2024-04-15 01:10:10 +02:00 committed by Viktor Szakats
parent 8bac53ecf0
commit 5e46c2909f
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
7 changed files with 20 additions and 18 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
@ -120,6 +120,7 @@ action_needed()
{
[ ! -e "${1}" ] && return 0
[ -n "${2}" ] || return 1
# shellcheck disable=SC3013
[ "${1}" -ot "${2}" ] && return 0
return 1
}
@ -276,15 +277,16 @@ get_make_vars()
{
eval "$(sed -e ': begin' \
-e '/\\\\$/{' \
-e '/\\$/{' \
-e 'N' \
-e 's/\\\\\\n/ /' \
-e 's/\\\n/ /' \
-e 'b begin' \
-e '}' \
-e '/^[A-Za-z_][A-Za-z0-9_]*[[:space:]]*=/!d' \
-e 's/@\\([A-Za-z0-9_]*\\)@/${\\1}/g' \
-e 's/[[:space:]]*=[[:space:]]*/=/' \
-e 's/=\\(.*[^[:space:]]\\)[[:space:]]*$/=\\"\\1\\"/' \
-e 's/\\\$(\\([^)]*\\))/\${\\1}/g' \
< \""${1}"\")"
-e 's/[[:space:]][[:space:]]*/ /g' \
-e '/^[A-Za-z_][A-Za-z0-9_]* *=/!d' \
-e 's/@\([A-Za-z0-9_]*\)@/${\1}/g' \
-e 's/ *= */=/' \
-e 's/=\(.*[^ ]\) *$/="\1"/' \
-e 's/\$(\([^)]*\))/${\1}/g' \
< "${1}")"
}

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
@ -104,10 +104,10 @@ build_all_programs()
if [ -n "${LINK}" ]
then PGMLDADD="$(eval echo "\${${PGM}_LDADD}")"
for ARG in ${PGMLDADD}
do case "${ARG}" in
for M in ${PGMLDADD}
do case "${M}" in
-*) ;; # Ignore non-module.
*) MODULES="${MODULES} $(db2_name "${ARG}")"
*) MODULES="${MODULES} $(db2_name "${M}")"
;;
esac
done

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |