From 3388de698bfb9bbc456c08f03e83bf3e749df35c Mon Sep 17 00:00:00 2001 From: Luca Di Sera Date: Tue, 25 Jun 2024 03:55:19 +0200 Subject: [PATCH] Do not assume FHS in scripts On systems that do not follow the Filesystem Hierarchy Standard, such as guix, the hardcoded `/bin/pwd` will fail to be found so that the script will fail. Use `pwd`, instead, so that the command can be found through the normal path search mechanism. Change-Id: Ib5480aeda5ca9d241286be6d1f95e9a0810476a8 Reviewed-by: Joerg Bornemann --- bin/qmake-and-qtpaths-wrapper.in | 2 +- bin/qt-cmake-create.in | 2 +- bin/qt-cmake.in | 2 +- bin/qt-configure-module.in | 2 +- configure | 4 ++-- libexec/qt-internal-configure-examples.in | 2 +- libexec/qt-internal-configure-tests.in | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/qmake-and-qtpaths-wrapper.in b/bin/qmake-and-qtpaths-wrapper.in index bf3d50cc228..42dd5428ba8 100755 --- a/bin/qmake-and-qtpaths-wrapper.in +++ b/bin/qmake-and-qtpaths-wrapper.in @@ -2,6 +2,6 @@ # The directory of this script is the expanded absolute path of the "$qt_prefix/bin" directory. script_dir_path=`dirname $0` -script_dir_path=`(cd "$script_dir_path"; /bin/pwd)` +script_dir_path=`(cd "$script_dir_path"; pwd)` @host_qt_bindir@/@tool_name@@tool_version@ -qtconf "$script_dir_path/target_qt.conf" $* diff --git a/bin/qt-cmake-create.in b/bin/qt-cmake-create.in index 7865d0fe91b..0387f13b2cd 100755 --- a/bin/qt-cmake-create.in +++ b/bin/qt-cmake-create.in @@ -5,7 +5,7 @@ HELP_MESSAGE="Usage # The directory of this script is the expanded absolute path of the "$qt_prefix/bin" directory. script_dir_path=`dirname $0` -script_dir_path=`(cd "$script_dir_path"; /bin/pwd)` +script_dir_path=`(cd "$script_dir_path"; pwd)` # Try to use original cmake, otherwise to make it relocatable, use any cmake found in PATH. original_cmake_path="@CMAKE_COMMAND@" diff --git a/bin/qt-cmake.in b/bin/qt-cmake.in index 14de927c3a6..363c490960c 100755 --- a/bin/qt-cmake.in +++ b/bin/qt-cmake.in @@ -2,7 +2,7 @@ # The directory of this script is the expanded absolute path of the "$qt_prefix/bin" directory. script_dir_path=`dirname $0` -script_dir_path=`(cd "$script_dir_path"; /bin/pwd)` +script_dir_path=`(cd "$script_dir_path"; pwd)` # Try to use original cmake, otherwise to make it relocatable, use any cmake found in PATH. original_cmake_path="@CMAKE_COMMAND@" diff --git a/bin/qt-configure-module.in b/bin/qt-configure-module.in index 1b96f6a8620..edc28b0b6df 100755 --- a/bin/qt-configure-module.in +++ b/bin/qt-configure-module.in @@ -2,7 +2,7 @@ set -eu script_dir_path=`dirname $0` -script_dir_path=`(cd "$script_dir_path"; /bin/pwd)` +script_dir_path=`(cd "$script_dir_path"; pwd)` printUsage() { diff --git a/configure b/configure index 6d7704a9dd5..852d9f86d0f 100755 --- a/configure +++ b/configure @@ -9,9 +9,9 @@ # the directory of this script is the "source tree" relpath=`dirname "$0"` -relpath=`(cd "$relpath"; /bin/pwd)` +relpath=`(cd "$relpath"; pwd)` # the current directory is the "build tree" or "object tree" -outpath=`/bin/pwd` +outpath=`pwd` outpathPrefix=$outpath # do this early so we don't store it in config.status diff --git a/libexec/qt-internal-configure-examples.in b/libexec/qt-internal-configure-examples.in index d0bf333ee6e..14baa5d11af 100755 --- a/libexec/qt-internal-configure-examples.in +++ b/libexec/qt-internal-configure-examples.in @@ -1,5 +1,5 @@ #!/bin/sh script_dir_path=`dirname $0` -script_dir_path=`(cd "$script_dir_path"; /bin/pwd)` +script_dir_path=`(cd "$script_dir_path"; pwd)` "$script_dir_path/@relative_path_from_libexec_dir_to_bin_dir@/qt-cmake" @script_passed_args@ "$@" diff --git a/libexec/qt-internal-configure-tests.in b/libexec/qt-internal-configure-tests.in index d0bf333ee6e..14baa5d11af 100755 --- a/libexec/qt-internal-configure-tests.in +++ b/libexec/qt-internal-configure-tests.in @@ -1,5 +1,5 @@ #!/bin/sh script_dir_path=`dirname $0` -script_dir_path=`(cd "$script_dir_path"; /bin/pwd)` +script_dir_path=`(cd "$script_dir_path"; pwd)` "$script_dir_path/@relative_path_from_libexec_dir_to_bin_dir@/qt-cmake" @script_passed_args@ "$@"