summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-02-07 17:39:18 +0100
committerMichał Górny <mgorny@gentoo.org>2024-02-10 11:47:21 +0100
commit5fcce58386dfb317020d7c88478480592b98b4e4 (patch)
treef19a8e79b0b7a7c5e755260c64aa331e6a0636dc /eclass/tests
parentllvm-utils.eclass: Split out PATH prepending logic (diff)
downloadgentoo-5fcce58386dfb317020d7c88478480592b98b4e4.tar.gz
gentoo-5fcce58386dfb317020d7c88478480592b98b4e4.tar.bz2
gentoo-5fcce58386dfb317020d7c88478480592b98b4e4.zip
llvm-utils.eclass: Fix llvm_prepend_path to avoid duplicates
Fix llvm_prepend_path() not to append the new path multiple times, if the original PATH variable contained multiple LLVM directories. Thanks to Alexander Miller who spotted it in: https://github.com/gentoo/gentoo/pull/35196#discussion_r1480330001 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/tests')
-rwxr-xr-xeclass/tests/llvm-utils.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/eclass/tests/llvm-utils.sh b/eclass/tests/llvm-utils.sh
index 5a46b25b7ad6..6fe3da3eda13 100755
--- a/eclass/tests/llvm-utils.sh
+++ b/eclass/tests/llvm-utils.sh
@@ -98,9 +98,21 @@ ESYSROOT=
test_prepend_path 17 /usr/bin /usr/bin:/usr/lib/llvm/17/bin
test_prepend_path 17 /usr/lib/llvm/17/bin:/usr/bin /usr/lib/llvm/17/bin:/usr/bin
test_prepend_path 17 /usr/bin:/usr/lib/llvm/17/bin /usr/bin:/usr/lib/llvm/17/bin
+test_prepend_path 17 /usr/lib/llvm/17/bin:/usr/bin:/usr/lib/llvm/17/bin \
+ /usr/lib/llvm/17/bin:/usr/bin
+test_prepend_path 17 /usr/lib/llvm/17/bin:/usr/lib/llvm/17/bin:/usr/bin \
+ /usr/lib/llvm/17/bin:/usr/bin
+test_prepend_path 17 /usr/bin:/usr/lib/llvm/17/bin:/usr/lib/llvm/17/bin \
+ /usr/bin:/usr/lib/llvm/17/bin
test_prepend_path 18 /usr/lib/llvm/17/bin:/usr/bin \
/usr/lib/llvm/18/bin:/usr/lib/llvm/17/bin:/usr/bin
test_prepend_path 18 /usr/bin:/usr/lib/llvm/17/bin \
/usr/bin:/usr/lib/llvm/18/bin:/usr/lib/llvm/17/bin
+test_prepend_path 18 /usr/lib/llvm/17/bin:/usr/lib/llvm/16/bin:/usr/bin \
+ /usr/lib/llvm/18/bin:/usr/lib/llvm/17/bin:/usr/lib/llvm/16/bin:/usr/bin
+test_prepend_path 18 /usr/bin:/usr/lib/llvm/17/bin:/usr/lib/llvm/16/bin \
+ /usr/bin:/usr/lib/llvm/18/bin:/usr/lib/llvm/17/bin:/usr/lib/llvm/16/bin
+test_prepend_path 18 /usr/lib/llvm/17/bin:/usr/bin:/usr/lib/llvm/16/bin \
+ /usr/lib/llvm/18/bin:/usr/lib/llvm/17/bin:/usr/bin:/usr/lib/llvm/16/bin
texit