From c137ae3b039a6315b067deaa3548e483bda32637 Mon Sep 17 00:00:00 2001 From: Adrian Szyndela Date: Thu, 5 Mar 2020 09:12:59 +0100 Subject: [PATCH] tree-wide: replace realpath with readlink -f Tizen's coreutils doesn't include 'realpath' utility, which was introduced in coreutils 8.15. However, Tizen's coreutils includes 'readlink' utility, which is very close to 'realpath' if called with '-f' param. Change-Id: I08b6ed68fc6bf0c384b599f4de3724724345d5c7 --- mkosi.build | 2 +- src/boot/efi/meson.build | 2 +- test/test-functions | 2 +- tools/find-build-dir.sh | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mkosi.build b/mkosi.build index 114e617..3f09fb2 100755 --- a/mkosi.build +++ b/mkosi.build @@ -40,7 +40,7 @@ if [ "$(locale charmap)" != "UTF-8" ] ; then fi if [ ! -f "$BUILDDIR"/build.ninja ] ; then - sysvinit_path=`realpath /etc/init.d` + sysvinit_path=`readlink -f /etc/init.d` nobody_user=`id -u -n 65534 2> /dev/null` if [ "$nobody_user" != "" ] ; then diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build index aa897c6..eaf9d4c 100644 --- a/src/boot/efi/meson.build +++ b/src/boot/efi/meson.build @@ -60,7 +60,7 @@ if conf.get('ENABLE_EFI') == 1 and get_option('gnu-efi') != 'false' ret = run_command(efi_cc + ['-print-multi-os-directory']) if ret.returncode() == 0 path = join_paths('/usr/lib', ret.stdout().strip()) - ret = run_command('realpath', '-e', path) + ret = run_command('readlink', '-f', '-e', path) if ret.returncode() == 0 efi_libdir = ret.stdout().strip() endif diff --git a/test/test-functions b/test/test-functions index 3706939..f3d08c2 100644 --- a/test/test-functions +++ b/test/test-functions @@ -26,7 +26,7 @@ PATH_TO_INIT=$ROOTLIBDIR/systemd BASICTOOLS="test sh bash setsid loadkeys setfont login sulogin gzip sleep echo mount umount cryptsetup date dmsetup modprobe sed cmp tee rm true false chmod chown ln xargs" DEBUGTOOLS="df free ls stty cat ps ln ip route dmesg dhclient mkdir cp ping dhclient strace less grep id tty touch du sort hostname find" -STATEDIR="${BUILD_DIR:-.}/test/$(basename $(dirname $(realpath $0)))" +STATEDIR="${BUILD_DIR:-.}/test/$(basename $(dirname $(readlink -f $0)))" STATEFILE="$STATEDIR/.testdir" TESTLOG="$STATEDIR/test.log" diff --git a/tools/find-build-dir.sh b/tools/find-build-dir.sh index 06b6297..b1a870a 100755 --- a/tools/find-build-dir.sh +++ b/tools/find-build-dir.sh @@ -5,11 +5,11 @@ set -e # we look for subdirectories of the parent directory that look like ninja build dirs. if [ -n "$BUILD_DIR" ]; then - echo "$(realpath "$BUILD_DIR")" + echo "$(readlink -f "$BUILD_DIR")" exit 0 fi -root="$(dirname "$(realpath "$0")")" +root="$(dirname "$(readlink -f "$0")")" found= for i in "$root"/../*/build.ninja; do @@ -29,4 +29,4 @@ if [ -z "$found" ]; then exit 1 fi -echo "$(realpath $found)" +echo "$(readlink -f $found)" -- 2.7.4