summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>2021-08-20 11:10:30 +0300
committerIlmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>2021-08-20 12:32:22 +0200
commitac586d1caecaa5be4bce05b073ce4c7bda10f13e (patch)
tree0f8edfa7e9bf7ad5c5be49cd168c20dc9e16d1a1
parenttdf#141097 Revert "Veto process exit while an OLE client is connected" (diff)
downloadcore-ac586d1caecaa5be4bce05b073ce4c7bda10f13e.tar.gz
core-ac586d1caecaa5be4bce05b073ce4c7bda10f13e.zip
Make some scripts more portable
Change-Id: Ia89059eea51ca396a7c74143625ac9a6706de198 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120773 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
-rwxr-xr-xbin/check-elf-dynamic-objects2
-rwxr-xr-xbin/find-undocumented-classes2
-rwxr-xr-xbin/fixincludeguards.sh2
-rwxr-xr-xbin/gen-boost-headers2
-rwxr-xr-xbin/gen-iwyu-dummy-lib2
-rwxr-xr-xbin/merge-app-bundles2
-rwxr-xr-xbin/moveglobalheaders.sh2
-rwxr-xr-xbin/oss-fuzz-build.sh4
-rwxr-xr-xbin/sanitize-image-links2
-rwxr-xr-xbin/ui-translatable.sh2
-rw-r--r--bin/update/common.sh2
-rwxr-xr-xbin/update/make_full_update.sh2
-rwxr-xr-xbin/update/make_incremental_update.sh2
-rw-r--r--external/python3/ExternalProject_python3.mk2
-rwxr-xr-xinstall_deps.sh2
-rwxr-xr-xoox/source/drawingml/customshapes/generate.sh2
-rwxr-xr-xscripting/Format_java_code.sh2
-rw-r--r--setup_native/scripts/install_linux.sh2
-rw-r--r--setup_native/scripts/mac_install.script2
-rw-r--r--setup_native/scripts/uninstall_linux.sh2
-rwxr-xr-xsolenv/bin/add-modelines2
-rwxr-xr-xsolenv/bin/macosx-codesign-app-bundle2
-rwxr-xr-xsolenv/bin/mkdocs_portal.sh2
-rwxr-xr-xsolenv/bin/mkonedoc.sh2
-rwxr-xr-xsw/qa/extras/find-unused-data.sh2
-rwxr-xr-xsysui/desktop/share/apparmor.sh2
-rwxr-xr-xwriterfilter/qa/ooxml/watch-generated-code.sh2
-rwxr-xr-xxmlsecurity/qa/create-certs/create-certs.sh4
28 files changed, 32 insertions, 28 deletions
diff --git a/bin/check-elf-dynamic-objects b/bin/check-elf-dynamic-objects
index 9b823ff7d843..523a892e4259 100755
--- a/bin/check-elf-dynamic-objects
+++ b/bin/check-elf-dynamic-objects
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# This file is part of the LibreOffice project.
#
diff --git a/bin/find-undocumented-classes b/bin/find-undocumented-classes
index 8bab72bc977c..3476596c0039 100755
--- a/bin/find-undocumented-classes
+++ b/bin/find-undocumented-classes
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# finds undocumented classes in the current directory (recursive)
diff --git a/bin/fixincludeguards.sh b/bin/fixincludeguards.sh
index 2655534aa416..5e05e944205f 100755
--- a/bin/fixincludeguards.sh
+++ b/bin/fixincludeguards.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
diff --git a/bin/gen-boost-headers b/bin/gen-boost-headers
index efcb712c832a..cf633532ae75 100755
--- a/bin/gen-boost-headers
+++ b/bin/gen-boost-headers
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# This file is part of the LibreOffice project.
#
diff --git a/bin/gen-iwyu-dummy-lib b/bin/gen-iwyu-dummy-lib
index c7d64817db49..3de15f95c31e 100755
--- a/bin/gen-iwyu-dummy-lib
+++ b/bin/gen-iwyu-dummy-lib
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# This file is part of the LibreOffice project.
#
diff --git a/bin/merge-app-bundles b/bin/merge-app-bundles
index 10c6e1d7b836..2a2200f1c44d 100755
--- a/bin/merge-app-bundles
+++ b/bin/merge-app-bundles
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# This file is part of the LibreOffice project.
#
diff --git a/bin/moveglobalheaders.sh b/bin/moveglobalheaders.sh
index ca202832bd6a..0de4cf5fc705 100755
--- a/bin/moveglobalheaders.sh
+++ b/bin/moveglobalheaders.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
diff --git a/bin/oss-fuzz-build.sh b/bin/oss-fuzz-build.sh
index 36390015dbc2..906cadd500d4 100755
--- a/bin/oss-fuzz-build.sh
+++ b/bin/oss-fuzz-build.sh
@@ -1,4 +1,6 @@
-#!/bin/bash -e
+#!/usr/bin/env bash
+
+set -e
if [ -z "${OUT}" ] || [ -z "${SRC}" ] || [ -z "${WORK}" ]; then
echo "OUT, SRC or WORK not set - script expects to be called inside oss-fuzz build env"
diff --git a/bin/sanitize-image-links b/bin/sanitize-image-links
index 6b5a2ec485b0..143eeec3ce55 100755
--- a/bin/sanitize-image-links
+++ b/bin/sanitize-image-links
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# This file is part of the LibreOffice project.
#
diff --git a/bin/ui-translatable.sh b/bin/ui-translatable.sh
index d8188778b10a..e3240826b22c 100755
--- a/bin/ui-translatable.sh
+++ b/bin/ui-translatable.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
diff --git a/bin/update/common.sh b/bin/update/common.sh
index 5bba576c702c..dcdbea8bb815 100644
--- a/bin/update/common.sh
+++ b/bin/update/common.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
diff --git a/bin/update/make_full_update.sh b/bin/update/make_full_update.sh
index cb7de49b23d4..4140ecae6d14 100755
--- a/bin/update/make_full_update.sh
+++ b/bin/update/make_full_update.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
diff --git a/bin/update/make_incremental_update.sh b/bin/update/make_incremental_update.sh
index e76f2159fe2a..31bddabdb082 100755
--- a/bin/update/make_incremental_update.sh
+++ b/bin/update/make_incremental_update.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
diff --git a/external/python3/ExternalProject_python3.mk b/external/python3/ExternalProject_python3.mk
index 807b3875d8b2..dc268e8bb619 100644
--- a/external/python3/ExternalProject_python3.mk
+++ b/external/python3/ExternalProject_python3.mk
@@ -154,7 +154,7 @@ $(call gb_ExternalProject_get_state_target,python3,fixscripts) : $(call gb_Exter
pydoc$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \
python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)-config \
; do { rm "$$file" && $(gb_AWK) '\
- BEGIN {print "#!/bin/bash\n\
+ BEGIN {print "#!/usr/bin/env bash\n\
origpath=$$(pwd)\n\
bindir=$$(cd $$(dirname \"$$0\") ; pwd)\n\
cd \"$$origpath\"\n\
diff --git a/install_deps.sh b/install_deps.sh
index 7759527cf4a8..c16fd92517bf 100755
--- a/install_deps.sh
+++ b/install_deps.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# This file is part of the LibreOffice project.
#
diff --git a/oox/source/drawingml/customshapes/generate.sh b/oox/source/drawingml/customshapes/generate.sh
index 90e0e09404f7..b0e661ec1914 100755
--- a/oox/source/drawingml/customshapes/generate.sh
+++ b/oox/source/drawingml/customshapes/generate.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# This script is used to generate the custom shape presets
diff --git a/scripting/Format_java_code.sh b/scripting/Format_java_code.sh
index 8fbffe884790..bb8e40dd2fb3 100755
--- a/scripting/Format_java_code.sh
+++ b/scripting/Format_java_code.sh
@@ -1,2 +1,2 @@
-#!/bin/bash
+#!/usr/bin/env bash
astyle --options=astyle.options --verbose --recursive ./*.java
diff --git a/setup_native/scripts/install_linux.sh b/setup_native/scripts/install_linux.sh
index df224211e530..d2b10e88959a 100644
--- a/setup_native/scripts/install_linux.sh
+++ b/setup_native/scripts/install_linux.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# This file is part of the LibreOffice project.
#
diff --git a/setup_native/scripts/mac_install.script b/setup_native/scripts/mac_install.script
index eb92d70ba982..b81cca764dd6 100644
--- a/setup_native/scripts/mac_install.script
+++ b/setup_native/scripts/mac_install.script
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# This file is part of the LibreOffice project.
#
diff --git a/setup_native/scripts/uninstall_linux.sh b/setup_native/scripts/uninstall_linux.sh
index 8ae8ae7ae51f..d0f062c50fdf 100644
--- a/setup_native/scripts/uninstall_linux.sh
+++ b/setup_native/scripts/uninstall_linux.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# This file is part of the LibreOffice project.
#
diff --git a/solenv/bin/add-modelines b/solenv/bin/add-modelines
index 3fa358cc2909..a3f59fe8ead4 100755
--- a/solenv/bin/add-modelines
+++ b/solenv/bin/add-modelines
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# This file is part of the LibreOffice project.
#
diff --git a/solenv/bin/macosx-codesign-app-bundle b/solenv/bin/macosx-codesign-app-bundle
index f4df4d4e6639..b79c3d8003b3 100755
--- a/solenv/bin/macosx-codesign-app-bundle
+++ b/solenv/bin/macosx-codesign-app-bundle
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# Use of unset variable is an error
set -u
diff --git a/solenv/bin/mkdocs_portal.sh b/solenv/bin/mkdocs_portal.sh
index 284af9e741f5..867198fa8c59 100755
--- a/solenv/bin/mkdocs_portal.sh
+++ b/solenv/bin/mkdocs_portal.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
if [ -n "$debug" ] ; then
set -x
diff --git a/solenv/bin/mkonedoc.sh b/solenv/bin/mkonedoc.sh
index 6ec3f5e72625..654ce56819a1 100755
--- a/solenv/bin/mkonedoc.sh
+++ b/solenv/bin/mkonedoc.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
module="$1"
mode="$2"
diff --git a/sw/qa/extras/find-unused-data.sh b/sw/qa/extras/find-unused-data.sh
index 17b5678bece4..460c01caaaec 100755
--- a/sw/qa/extras/find-unused-data.sh
+++ b/sw/qa/extras/find-unused-data.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
for i in */data/*
do
diff --git a/sysui/desktop/share/apparmor.sh b/sysui/desktop/share/apparmor.sh
index c801f0f3b217..90d6ac34fd48 100755
--- a/sysui/desktop/share/apparmor.sh
+++ b/sysui/desktop/share/apparmor.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# This file is part of the LibreOffice project.
# ------------------------------------------------------------------
#
diff --git a/writerfilter/qa/ooxml/watch-generated-code.sh b/writerfilter/qa/ooxml/watch-generated-code.sh
index 22dc44011db5..d7026be82b0c 100755
--- a/writerfilter/qa/ooxml/watch-generated-code.sh
+++ b/writerfilter/qa/ooxml/watch-generated-code.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
if [ ! -e bin/get_config_variables ]; then
cd ../../..
diff --git a/xmlsecurity/qa/create-certs/create-certs.sh b/xmlsecurity/qa/create-certs/create-certs.sh
index 4a0298047c01..5a4c244c6bdf 100755
--- a/xmlsecurity/qa/create-certs/create-certs.sh
+++ b/xmlsecurity/qa/create-certs/create-certs.sh
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/usr/bin/env bash
#
# This file is part of the LibreOffice project.
#
@@ -27,6 +27,8 @@
# the PKCS#12 export of self-signed certificates
#
+set -e
+
root="$PWD"
algo="RSA"