[lttng-dev] [PATCH babeltrace] Port: do not depend on GNU readlink

Michael Jeanson mjeanson at efficios.com
Tue Sep 19 20:26:30 UTC 2017


Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
 tests/lib/test_ctf_writer_complete.in      | 3 +--
 tests/lib/test_plugin_complete.in          | 3 +--
 tests/plugins/test-utils-muxer-complete.in | 3 +--
 tests/plugins/test_bin_info_complete.in    | 3 +--
 tests/plugins/test_dwarf_complete.in       | 3 +--
 5 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/tests/lib/test_ctf_writer_complete.in b/tests/lib/test_ctf_writer_complete.in
index 4502d44..abb0575 100644
--- a/tests/lib/test_ctf_writer_complete.in
+++ b/tests/lib/test_ctf_writer_complete.in
@@ -20,7 +20,6 @@
 NO_SH_TAP=1
 . "@abs_top_builddir@/tests/utils/common.sh"
 
-script="$(readlink -f "$0")"
-curdir="$(dirname "$script")"
+curdir="$(cd -P "$(dirname "$0")" >/dev/null && pwd)"
 
 "${curdir}/test_ctf_writer" "$BT_BIN"
diff --git a/tests/lib/test_plugin_complete.in b/tests/lib/test_plugin_complete.in
index 24bea07..4bcf2bf 100644
--- a/tests/lib/test_plugin_complete.in
+++ b/tests/lib/test_plugin_complete.in
@@ -20,8 +20,7 @@
 NO_SH_TAP=1
 . "@abs_top_builddir@/tests/utils/common.sh"
 
-script="$(readlink -f "$0")"
-curdir="$(dirname "$script")"
+curdir="$(cd -P "$(dirname "$0")" >/dev/null && pwd)"
 
 plugin_dir="${curdir}/test-plugin-plugins/.libs"
 
diff --git a/tests/plugins/test-utils-muxer-complete.in b/tests/plugins/test-utils-muxer-complete.in
index 85b51dd..beb6f0a 100644
--- a/tests/plugins/test-utils-muxer-complete.in
+++ b/tests/plugins/test-utils-muxer-complete.in
@@ -20,8 +20,7 @@
 NO_SH_TAP=1
 . "@abs_top_builddir@/tests/utils/common.sh"
 
-script="$(readlink -f "$0")"
-curdir="$(dirname "$script")"
+curdir="$(cd -P "$(dirname "$0")" >/dev/null && pwd)"
 
 plugin_dir="${BT_BUILD_PATH}/plugins/utils"
 
diff --git a/tests/plugins/test_bin_info_complete.in b/tests/plugins/test_bin_info_complete.in
index 09ab708..0069dd7 100644
--- a/tests/plugins/test_bin_info_complete.in
+++ b/tests/plugins/test_bin_info_complete.in
@@ -20,8 +20,7 @@
 NO_SH_TAP=1
 . "@abs_top_builddir@/tests/utils/common.sh"
 
-script="$(readlink -f "$0")"
-curdir="$(dirname "$script")"
+curdir="$(cd -P "$(dirname "$0")" >/dev/null && pwd)"
 
 debug_info_data="${BT_SRC_PATH}/tests/debug-info-data"
 
diff --git a/tests/plugins/test_dwarf_complete.in b/tests/plugins/test_dwarf_complete.in
index a0ae51b..0a99e7d 100644
--- a/tests/plugins/test_dwarf_complete.in
+++ b/tests/plugins/test_dwarf_complete.in
@@ -20,8 +20,7 @@
 NO_SH_TAP=1
 . "@abs_top_builddir@/tests/utils/common.sh"
 
-script="$(readlink -f "$0")"
-curdir="$(dirname "$script")"
+curdir="$(cd -P "$(dirname "$0")" >/dev/null && pwd)"
 
 debug_info_data="${BT_SRC_PATH}/tests/debug-info-data"
 
-- 
2.7.4



More information about the lttng-dev mailing list