diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-09-28 04:17:27 +0200 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2012-09-30 00:06:09 +0200 |
commit | 4bbca4a841eb6810b003009838cb681fd7ace07a (patch) | |
tree | 197a9417c19fbc94687535b646968848c035d8f7 /functions | |
parent | c396a58ba7d4ce9f7087379537fa2251a90af52a (diff) | |
download | mkinitcpio-4bbca4a841eb6810b003009838cb681fd7ace07a.tar.gz mkinitcpio-4bbca4a841eb6810b003009838cb681fd7ace07a.tar.xz |
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 <dreisner@archlinux.org>
Diffstat (limited to 'functions')
-rw-r--r-- | functions | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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 |