init.sh: Use readlink in pybin()

Use realpath only as a fallback.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-05-07 19:00:13 +01:00
parent a94bd3c093
commit cba04aa74b
2 changed files with 13 additions and 2 deletions
+12
View File
@@ -144,6 +144,18 @@ singletree()
return 1
}
findpath()
{
[ $# -gt 0 ] || err "findpath: No arguments provided"
while [ $# -gt 0 ]; do
found="`readlink -f "$1" 2>/dev/null`" || return 1; :
[ -n "$found" ] || found="`realpath "$1" 2>/dev/null`" || \
return 1; :
printf "%s\n" "$found"
shift 1
done
}
fx_()
{
fd="`mktemp`" && x_ rm -f "$fd" && x_ touch "$fd"