]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
OS400: post-shellcheck changes adjustments
authorPatrick Monnerat <patrick@monnerat.net>
Sun, 14 Apr 2024 23:10:10 +0000 (01:10 +0200)
committerViktor Szakats <commit@vsz.me>
Mon, 15 Apr 2024 08:58:13 +0000 (08:58 +0000)
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 8a622baf9e9233241bbe93d6599c99cb46478614
Closes #13366

packages/OS400/config400.default
packages/OS400/initscript.sh
packages/OS400/make-include.sh
packages/OS400/make-lib.sh
packages/OS400/make-src.sh
packages/OS400/make-tests.sh
packages/OS400/makefile.sh

index 41d62653112699246b8c40d03b524ea6254d91a3..91a82771fb9eff350da65430de8ee837e4252278 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index e42980bf1a3b936190db20cd4b4ef7f93a5530d4..cdb8fab3cebf6d097d044fa1ddbca80b9699499a 100755 (executable)
@@ -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}")"
 }
index 6f092c4845c2f0ae20a17bdde544b9ecb78822b3..e30e950539ee3838b177d840fc5cf3988a695198 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index d2f467feaa69ce7b117a607d60f5ed82eb4d951b..e7b5b519e7e88443a582be515e509e6f38b8c4ea 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index c58b1c186480fa46aac5a7aed05e728ca2fdd201..6775f98bd363d74efc373d1b875d65b457bcb867 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index c76a8f60e79719ea7d20b685c95d36483042bae1..8ff64d2fb8da148228e6fa3ed66ad35db573e378 100755 (executable)
@@ -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
index 777cf026fb118b76ced0f65d976204f24141fb26..e58b835e1f37c8b74d932114cd4fcfe9e423f9eb 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |