@@ -, +, @@ --- bin/ebuild-helpers/{ => 3}/doins | 12 +++++------- bin/ebuild-helpers/{ => 3}/newins | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) copy bin/ebuild-helpers/{ => 3}/doins (90%) copy bin/ebuild-helpers/{ => 3}/newins (82%) --- a/bin/ebuild-helpers/doins +++ a/bin/ebuild-helpers/doins @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2007 Gentoo Foundation +# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ @@ -32,17 +32,15 @@ mkdir -p "$TMP"/{1,2} [[ ! -d ${D}${INSDESTTREE} ]] && dodir "${INSDESTTREE}" _doins() { - local mysrc="$1" mydir="$2" cleanup="" rval + local mysrc="$1" mydir="$2" rval if [ -L "$mysrc" ] ; then - cp "$mysrc" "$TMP/2" - mysrc="$TMP/2/${mysrc##*/}" - cleanup=${mysrc} + ln -snf "$(readlink "${mysrc}")" "${D}${INSDESTTREE}/${mydir}/${mysrc##*/}" + return $? fi install ${INSOPTIONS} "${mysrc}" "${D}${INSDESTTREE}/${mydir}" rval=$? - [[ -n ${cleanup} ]] && rm -f "${cleanup}" [ $rval -ne 0 ] && echo "!!! ${0##*/}: $mysrc does not exist" 1>&2 return $rval } @@ -56,7 +54,7 @@ _xdoins() { success=0 for x in "$@" ; do - if [ -d "$x" ] ; then + if [ -d "$x" ] && ! [ -L "$x" ]; then if [ "${DOINSRECUR}" == "n" ] ; then continue fi --- a/bin/ebuild-helpers/newins +++ a/bin/ebuild-helpers/newins @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2006 Gentoo Foundation +# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ @@ -14,7 +14,7 @@ if [ ! -e "$1" ] ; then fi rm -rf "${T}/${2}" || exit $? -cp -f "${1}" "${T}/${2}" || exit $? +cp -Pf "${1}" "${T}/${2}" || exit $? doins "${T}/${2}" ret=$? rm -rf "${T}/${2}" --