scripts/git-submodule.sh: Don't rely on non-POSIX 'read' behaviour
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 25 Jul 2023 09:56:51 +0000 (10:56 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 25 Jul 2023 09:56:51 +0000 (10:56 +0100)
The POSIX definition of the 'read' utility requires that you
specify the variable name to set; omitting the name and
having it default to 'REPLY' is a bashism. If your system
sh is dash, then it will print an error message during build:

qemu/pc-bios/s390-ccw/../../scripts/git-submodule.sh: 106: read: arg count

Specify the variable name explicitly.

Fixes: fdb8fd8cb915647b ("git-submodule: allow partial update of .git-submodule-status")
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20230720153038.1587196-1-peter.maydell@linaro.org

scripts/git-submodule.sh

index 335f7f5fdf89e3ff33e3282bd126829d845c8dc1..bb1222c772792fc7b8c0185d7b9bf24916b5a053 100755 (executable)
@@ -103,7 +103,7 @@ update)
         check_updated $module || echo Updated "$module"
     done
 
-    (while read -r; do
+    (while read -r REPLY; do
         for module in $modules; do
             case $REPLY in
                 *" $module "*) continue 2 ;;