From 4bbca4a841eb6810b003009838cb681fd7ace07a Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 27 Sep 2012 22:17:27 -0400 Subject: functions: avoid fully resolving soname symlinks It's okay to fully resolve the symlink to add the regular file it points to, but avoid mangling the symlink name to try and preserve relative links. Signed-off-by: Dave Reisner --- functions | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/functions b/functions index 2e1ae3f..e213580 100644 --- a/functions +++ b/functions @@ -507,7 +507,7 @@ add_binary() { # $2: destination on initcpio (optional, defaults to same as source) local -a sodeps - local line= regex= binary= dest= mode= sodep= resolved= dirname= + local line= regex= binary= dest= mode= sodep= resolved= if [[ ${1:0:1} != '/' ]]; then binary=$(type -P "$1") @@ -545,9 +545,7 @@ add_binary() { add_file "$sodep" "$sodep" "$(stat -c %a "$sodep")" else resolved=$(readlink -e "$sodep") - dirname=${resolved%/*} - add_dir "$dirname" 755 - add_symlink "$sodep" "$resolved" + add_symlink "$sodep" "$(readlink "$sodep")" add_file "$resolved" "$resolved" 755 fi fi -- cgit v1.2.3-24-g4f1b