aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-05-08 17:50:15 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-05-08 17:50:15 +0000
commit02c48a20f0d203cf68e2ef1ef4349fa11703506c (patch)
treec9f74cdbee54fa35b91492f0298c2450b4c0eddd
parent0fb6b25572ba11a4c394dc0165027b39574abd65 (diff)
downloadpaludis-02c48a20f0d203cf68e2ef1ef4349fa11703506c.tar.gz
paludis-02c48a20f0d203cf68e2ef1ef4349fa11703506c.tar.xz
Avoid temporarily removing symlinks where possible
-rwxr-xr-xebuild/utils/merge7
-rwxr-xr-xebuild/utils/unmerge3
2 files changed, 6 insertions, 4 deletions
diff --git a/ebuild/utils/merge b/ebuild/utils/merge
index 59abb67..567789b 100755
--- a/ebuild/utils/merge
+++ b/ebuild/utils/merge
@@ -87,10 +87,13 @@ merge_this()
fi
if [[ -L "${f}" ]] ; then
- if ( [[ -e "${2}/${ff}" ]] || [[ -h "${2}/${ff}" ]] ) && ! rm -f -- "${2}/${ff}" ; then
+ if ( [[ -e "${2}/${ff}" ]] || [[ -h "${2}/${ff}" ]] ) && \
+ [[ $(readlink -- "${2}/${ff}" ) != $(readlink -- "${f}" ) ]] && \
+ [[ -d "${2}/${ff%+(/)}" ]] && \
+ ! rm -f -- "${2}/${ff}" ; then
echo "error removing ${2}/${ff} for link ${f}"
r=1
- elif ! ln -s -- "$(readlink -- ${f} )" "${2}/${ff}" ; then
+ elif ! ln -sf -- "$(readlink -- ${f} )" "${2}/${ff}" ; then
echo "error installing link ${f}"
r=1
else
diff --git a/ebuild/utils/unmerge b/ebuild/utils/unmerge
index 6d8dcf5..a51d69e 100755
--- a/ebuild/utils/unmerge
+++ b/ebuild/utils/unmerge
@@ -27,8 +27,7 @@ fi
shopt -s dotglob
shopt -s nullglob
-ROOT=$(readlink -f "${1%/}" )
-ROOT="${ROOT//+(\/)/\/}"
+ROOT=$(readlink -f "${1%+(/)}/" )
export ROOT
export contents=${2}