From e626ab0833fd89d2e16e47745c5b58a84c694209 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Mon, 25 Dec 2023 16:27:55 +0200
Subject: [PATCH 9/9] Replace #!/bin/bash with posix shebang

See RM #44

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 bootstrap/generate_langstat.sh                 |  2 +-
 bootstrap/generate_meson_run.sh                |  6 +++---
 bootstrap/generate_metainfo.sh                 |  4 ++--
 data/flags/convert_png                         | 15 ++++++++++++++-
 flatpak/build_flatpak.sh                       |  4 ++--
 platforms/macos/homebrew-appbundle.sh          |  4 ++--
 scripts/capabilities                           |  4 ++--
 scripts/check_flags.sh                         | 15 ++++++++++++++-
 scripts/ci-build.sh                            | 18 +++++++++++++++++-
 scripts/mapimg2anim                            | 10 +++++-----
 scripts/potfiles                               | 15 ++++++++++++++-
 scripts/refresh_changelog.sh                   |  4 ++--
 scripts/replace                                | 15 ++++++++++++++-
 scripts/revision_describer.bash                | 15 ++++++++++++++-
 scripts/setup_auth_server.sh                   |  4 ++--
 tests/rs_test_res/ruleset_loads.sh.in          | 15 ++++++++++++++-
 tests/rs_test_res/upgrade_ruleset_sync.bash    | 15 ++++++++++++++-
 tests/rulesets_autohelp.sh.in                  | 15 ++++++++++++++-
 tests/rulesets_not_broken.sh.in                | 15 ++++++++++++++-
 tests/rulesets_save.sh.in                      | 15 ++++++++++++++-
 tests/rulesets_upgrade.sh.in                   | 15 ++++++++++++++-
 translations/generate_skips.sh                 |  2 +-
 translations/stats.sh                          |  2 +-
 .../installer_cross/build_all_installers.sh    |  4 ++--
 .../helpers/uninstaller-helper-gtk3.sh         | 15 ++++++++++++++-
 windows/installer_cross/installer_build.sh     |  2 +-
 26 files changed, 211 insertions(+), 39 deletions(-)

diff --git a/bootstrap/generate_langstat.sh b/bootstrap/generate_langstat.sh
index deaaf6a2cb..520a900f13 100755
--- a/bootstrap/generate_langstat.sh
+++ b/bootstrap/generate_langstat.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #/***********************************************************************
 # Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
 #   This program is free software; you can redistribute it and/or modify
diff --git a/bootstrap/generate_meson_run.sh b/bootstrap/generate_meson_run.sh
index 256f55aacd..cc9f43dd7e 100644
--- a/bootstrap/generate_meson_run.sh
+++ b/bootstrap/generate_meson_run.sh
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
-# Freeciv - Copyright (C) 2022 The Freeciv Team
+# Freeciv - Copyright (C) 2022-2023 The Freeciv Team
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
 #  the Free Software Foundation; either version 2, or (at your option)
@@ -14,7 +14,7 @@
 DATADIR="$(cd $(dirname "$0")/../data ; pwd)"
 SCENDIR="$(cd $(dirname "$0")/../data/scenarios ; pwd)"
 
-echo "#!/bin/bash"                                                                > "$1"
+echo "#!/usr/bin/env bash"                                                        > "$1"
 echo "# Generated by $(basename "$0")"                                           >> "$1"
 echo                                                                             >> "$1"
 echo "if test \"\$1\" = \"--help\" || test \"\$1\" = \"-h\" ||"                  >> "$1"
diff --git a/bootstrap/generate_metainfo.sh b/bootstrap/generate_metainfo.sh
index b2231aed84..97c8fd3c3c 100755
--- a/bootstrap/generate_metainfo.sh
+++ b/bootstrap/generate_metainfo.sh
@@ -1,6 +1,6 @@
-#!/bin/bash -e
+#!/usr/bin/env bash
 #/***********************************************************************
-# Freeciv - Copyright (C) 2022 The Freeciv project
+# Freeciv - Copyright (C) 2022-2023 The Freeciv project
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU General Public License as published by
 #   the Free Software Foundation; either version 2, or (at your option)
diff --git a/data/flags/convert_png b/data/flags/convert_png
index 5a7a98ea4b..ba34991698 100755
--- a/data/flags/convert_png
+++ b/data/flags/convert_png
@@ -1,4 +1,17 @@
-#!/bin/bash
+#!/usr/bin/env bash
+#/***********************************************************************
+# Freeciv - Copyright (C) 2017-2023
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2, or (at your option)
+#   any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#***********************************************************************/
 
 # Using absolute paths due to bug in Inkscape on macOS
 files="$(pwd)/$@"
diff --git a/flatpak/build_flatpak.sh b/flatpak/build_flatpak.sh
index bbc9746a23..24a3a18cda 100755
--- a/flatpak/build_flatpak.sh
+++ b/flatpak/build_flatpak.sh
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
-# Freeciv - Copyright (C) 2022 - The Freeciv Team
+# Freeciv - Copyright (C) 2022-2023 - The Freeciv Team
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
 #  the Free Software Foundation; either version 2, or (at your option)
diff --git a/platforms/macos/homebrew-appbundle.sh b/platforms/macos/homebrew-appbundle.sh
index 5472e687e9..dde0e66ef3 100755
--- a/platforms/macos/homebrew-appbundle.sh
+++ b/platforms/macos/homebrew-appbundle.sh
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
-# Freeciv - Copyright (C) 2022 - Freeciv team
+# Freeciv - Copyright (C) 2022-2023 - Freeciv team
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
 #  the Free Software Foundation; either version 2, or (at your option)
diff --git a/scripts/capabilities b/scripts/capabilities
index a839d44f65..6a95c77c45 100755
--- a/scripts/capabilities
+++ b/scripts/capabilities
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #/***********************************************************************
-# Freeciv - Copyright (C) 2010
+# Freeciv - Copyright (C) 2010-2023
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU General Public License as published by
 #   the Free Software Foundation; either version 2, or (at your option)
diff --git a/scripts/check_flags.sh b/scripts/check_flags.sh
index 0abe68b78c..e1cc5f6419 100755
--- a/scripts/check_flags.sh
+++ b/scripts/check_flags.sh
@@ -1,4 +1,17 @@
-#!/bin/bash
+#!/usr/bin/env bash
+#/***********************************************************************
+# Freeciv - Copyright (C) 2017-2023
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2, or (at your option)
+#   any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#***********************************************************************/
 
 is_verbose=false
 non_quiet=true
diff --git a/scripts/ci-build.sh b/scripts/ci-build.sh
index 893a69329e..fe3226b821 100755
--- a/scripts/ci-build.sh
+++ b/scripts/ci-build.sh
@@ -1,8 +1,24 @@
-#!/bin/bash
+#!/usr/bin/env bash
+#/***********************************************************************
+# Freeciv - Copyright (C) 2017-2023
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2, or (at your option)
+#   any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#***********************************************************************/
+
 #
 # Freeciv CI Script
 #
 # https://github.com/freeciv/freeciv/actions
+#
+
 echo "Running CI job $1 for Freeciv."
 basedir=$(pwd)
 logfile="${basedir}/freeciv-CI.log"
diff --git a/scripts/mapimg2anim b/scripts/mapimg2anim
index 9b86244a85..ca7e4b2f5e 100755
--- a/scripts/mapimg2anim
+++ b/scripts/mapimg2anim
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #/***********************************************************************
-# Freeciv - Copyright (C) 2010
+# Freeciv - Copyright (C) 2010-2023
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU General Public License as published by
 #   the Free Software Foundation; either version 2, or (at your option)
@@ -13,13 +13,13 @@
 #
 #***********************************************************************/
 
-# convert map images to animations
+# Convert map images to animations
 #
-# requirements:
+# Requirements:
 # - convert (from ImageMagick)
 # - ffmpeg (for avi and flv)
 
-# default values
+# Default values
 animation="gif"
 civgame="freeciv"
 mapstr=""
diff --git a/scripts/potfiles b/scripts/potfiles
index 34c24e25d6..dce783145b 100755
--- a/scripts/potfiles
+++ b/scripts/potfiles
@@ -1,4 +1,17 @@
-#!/bin/bash
+#!/usr/bin/env bash
+#/***********************************************************************
+# Freeciv - Copyright (C) 2017-2023
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2, or (at your option)
+#   any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#***********************************************************************/
 
 domains="core nations ruledit"
 
diff --git a/scripts/refresh_changelog.sh b/scripts/refresh_changelog.sh
index 7336c1f364..21d1f16339 100755
--- a/scripts/refresh_changelog.sh
+++ b/scripts/refresh_changelog.sh
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #/***********************************************************************
-# Freeciv - Copyright (C) 2022
+# Freeciv - Copyright (C) 2022-2023
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU General Public License as published by
 #   the Free Software Foundation; either version 2, or (at your option)
diff --git a/scripts/replace b/scripts/replace
index a62cd605d2..e3d5a3fff3 100755
--- a/scripts/replace
+++ b/scripts/replace
@@ -1,4 +1,17 @@
-#!/bin/bash
+#!/usr/bin/env bash
+#/***********************************************************************
+# Freeciv - Copyright (C) 2017-2023
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2, or (at your option)
+#   any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#***********************************************************************/
 
 if test "x$1" = "x-h" || test "x$1" = "x--help" || test "x$3" = "x" ; then
     echo "Usage: $0 <path> <string to replace> <replace with>"
diff --git a/scripts/revision_describer.bash b/scripts/revision_describer.bash
index 223b1668cc..ac8661d221 100755
--- a/scripts/revision_describer.bash
+++ b/scripts/revision_describer.bash
@@ -1,4 +1,17 @@
-#!/bin/bash
+#!/usr/bin/env bash
+#/***********************************************************************
+# Freeciv - Copyright (C) 2017-2023
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2, or (at your option)
+#   any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#***********************************************************************/
 
 if test x$1 = x ; then
   REVISION="HEAD"
diff --git a/scripts/setup_auth_server.sh b/scripts/setup_auth_server.sh
index e4af63232f..41b10920e8 100755
--- a/scripts/setup_auth_server.sh
+++ b/scripts/setup_auth_server.sh
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
-# Freeciv - Copyright (C) 2007 - Marko Lindqvist
+# Freeciv - Copyright (C) 2007-2023 - Marko Lindqvist
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
 #  the Free Software Foundation; either version 2, or (at your option)
diff --git a/tests/rs_test_res/ruleset_loads.sh.in b/tests/rs_test_res/ruleset_loads.sh.in
index c4a52ab01a..0b5693bef2 100644
--- a/tests/rs_test_res/ruleset_loads.sh.in
+++ b/tests/rs_test_res/ruleset_loads.sh.in
@@ -1,4 +1,17 @@
-#!/bin/bash
+#!/usr/bin/env bash
+#/***********************************************************************
+# Freeciv - Copyright (C) 2017-2023
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2, or (at your option)
+#   any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#***********************************************************************/
 
 # ruleset_loads.sh ruleset
 # Exits with 0 when the specified ruleset is able to load. Exits with 1 if
diff --git a/tests/rs_test_res/upgrade_ruleset_sync.bash b/tests/rs_test_res/upgrade_ruleset_sync.bash
index 27c4e6698b..59422b00b0 100755
--- a/tests/rs_test_res/upgrade_ruleset_sync.bash
+++ b/tests/rs_test_res/upgrade_ruleset_sync.bash
@@ -1,4 +1,17 @@
-#!/bin/bash
+#!/usr/bin/env bash
+#/***********************************************************************
+# Freeciv - Copyright (C) 2017-2023
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2, or (at your option)
+#   any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#***********************************************************************/
 
 # the revision from the old branch to pick if no revision is specified
 DEFAULT_REVISION="6263b3424b"
diff --git a/tests/rulesets_autohelp.sh.in b/tests/rulesets_autohelp.sh.in
index 51a4e1db5e..461067f245 100644
--- a/tests/rulesets_autohelp.sh.in
+++ b/tests/rulesets_autohelp.sh.in
@@ -1,4 +1,17 @@
-#!/bin/bash
+#!/usr/bin/env bash
+#/***********************************************************************
+# Freeciv - Copyright (C) 2017-2023
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2, or (at your option)
+#   any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#***********************************************************************/
 
 # rulesets_autohelp.sh [ruleset]...
 # Exits with 0 when each specified ruleset or, if no rulesets are specified,
diff --git a/tests/rulesets_not_broken.sh.in b/tests/rulesets_not_broken.sh.in
index f75de7f646..b3f5ba7842 100644
--- a/tests/rulesets_not_broken.sh.in
+++ b/tests/rulesets_not_broken.sh.in
@@ -1,4 +1,17 @@
-#!/bin/bash
+#!/usr/bin/env bash
+#/***********************************************************************
+# Freeciv - Copyright (C) 2017-2023
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2, or (at your option)
+#   any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#***********************************************************************/
 
 # rulesets_not_broken.sh [ruleset]...
 # Exits with 0 when each specified ruleset or, if no rulesets are specified,
diff --git a/tests/rulesets_save.sh.in b/tests/rulesets_save.sh.in
index 35ee4cc33d..1d7b5f94be 100644
--- a/tests/rulesets_save.sh.in
+++ b/tests/rulesets_save.sh.in
@@ -1,4 +1,17 @@
-#!/bin/bash
+#!/usr/bin/env bash
+#/***********************************************************************
+# Freeciv - Copyright (C) 2017-2023
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2, or (at your option)
+#   any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#***********************************************************************/
 
 # rulesets_save.sh [ruleset]...
 # Exits with 0 when each specified ruleset or, if no rulesets are specified,
diff --git a/tests/rulesets_upgrade.sh.in b/tests/rulesets_upgrade.sh.in
index 8a6809872c..a5f8351de5 100644
--- a/tests/rulesets_upgrade.sh.in
+++ b/tests/rulesets_upgrade.sh.in
@@ -1,4 +1,17 @@
-#!/bin/bash
+#!/usr/bin/env bash
+#/***********************************************************************
+# Freeciv - Copyright (C) 2017-2023
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2, or (at your option)
+#   any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#***********************************************************************/
 
 # rulesets_upgrade.sh
 # Exits with 0 when each ruleset specified in upgrade_ruleset_list.txt can
diff --git a/translations/generate_skips.sh b/translations/generate_skips.sh
index ef25d8ef57..b4b5a4f3ed 100755
--- a/translations/generate_skips.sh
+++ b/translations/generate_skips.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #/***********************************************************************
 # Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
 #   This program is free software; you can redistribute it and/or modify
diff --git a/translations/stats.sh b/translations/stats.sh
index d97d128baa..e0b655ddc1 100755
--- a/translations/stats.sh
+++ b/translations/stats.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #/**********************************************************************
 # Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
 #   This program is free software; you can redistribute it and/or modify
diff --git a/windows/installer_cross/build_all_installers.sh b/windows/installer_cross/build_all_installers.sh
index 34e1722615..c9cea0b182 100755
--- a/windows/installer_cross/build_all_installers.sh
+++ b/windows/installer_cross/build_all_installers.sh
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #/***********************************************************************
-# Freeciv - Copyright (C) 2017
+# Freeciv - Copyright (C) 2017-2023
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU General Public License as published by
 #   the Free Software Foundation; either version 2, or (at your option)
diff --git a/windows/installer_cross/helpers/uninstaller-helper-gtk3.sh b/windows/installer_cross/helpers/uninstaller-helper-gtk3.sh
index 71a162c875..aa6cb64d8f 100755
--- a/windows/installer_cross/helpers/uninstaller-helper-gtk3.sh
+++ b/windows/installer_cross/helpers/uninstaller-helper-gtk3.sh
@@ -1,4 +1,17 @@
-#!/bin/bash
+#!/usr/bin/env bash
+#/***********************************************************************
+# Freeciv - Copyright (C) 2017-2023
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2, or (at your option)
+#   any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#***********************************************************************/
 
 delfile() {
   echo "  Delete \"\$INSTDIR/$1\"" | sed 's,/,\\,g'
diff --git a/windows/installer_cross/installer_build.sh b/windows/installer_cross/installer_build.sh
index 9294a0f947..140f60f344 100755
--- a/windows/installer_cross/installer_build.sh
+++ b/windows/installer_cross/installer_build.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #/***********************************************************************
 # Freeciv - Copyright (C) 2017-2023
 #   This program is free software; you can redistribute it and/or modify
-- 
2.43.0

