summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-09-28 04:17:27 +0200
committerDave Reisner <dreisner@archlinux.org>2012-09-30 00:06:09 +0200
commit4bbca4a841eb6810b003009838cb681fd7ace07a (patch)
tree197a9417c19fbc94687535b646968848c035d8f7 /functions
parentc396a58ba7d4ce9f7087379537fa2251a90af52a (diff)
downloadmkinitcpio-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--functions6
1 files 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