summaryrefslogtreecommitdiffstats
path: root/remote
diff options
context:
space:
mode:
authorJonathan Bauer2014-03-11 17:03:23 +0100
committerJonathan Bauer2014-03-11 17:03:23 +0100
commit5d236667db593089aa6fec791ce31b442e1a049e (patch)
tree0c4f855d64ca9aca8286f3df262b9099fb0e7753 /remote
parent[cleanup.inc] added traps for SIGINT and SIGTERM (diff)
downloadtm-scripts-5d236667db593089aa6fec791ce31b442e1a049e.tar.gz
tm-scripts-5d236667db593089aa6fec791ce31b442e1a049e.tar.xz
tm-scripts-5d236667db593089aa6fec791ce31b442e1a049e.zip
[binutil.inc] fix special case:
if link exists but target does not, check if the target exists in the MODULE_BUILD_DIR and if so, add "./target" to copylist.
Diffstat (limited to 'remote')
-rw-r--r--remote/includes/binutil.inc15
1 files changed, 10 insertions, 5 deletions
diff --git a/remote/includes/binutil.inc b/remote/includes/binutil.inc
index 906b6cc2..73371c25 100644
--- a/remote/includes/binutil.inc
+++ b/remote/includes/binutil.inc
@@ -136,12 +136,14 @@ get_link_chain() {
# sanity checks
if [[ "$1" == /* ]]; then
- [ -e $1 ] || perror "get_link_chain: no such file: $1"
+ if [ ! -e $1 -a ! -L $1 ]; then
+ perror "'$1' is a link but its target '$LINK_TARGET' is not in '${LOCALSEARCHDIR}'"
+ fi
else
perror "get_link_chain() requires absolute paths, given: $1"
fi
if [ $# == 2 ] ; then
- [ ! -d $2 ] && perror "get_link_chain: $2 is not a directory."
+ [ ! -d $2 ] && perror "get_link_chain: '$2' is not a directory. Local search can't work..."
# got a prefix
local PREFIX=$(readlink -f $2)
else
@@ -184,7 +186,11 @@ get_link_chain() {
if [ "x$PREFIX" != "x" -a "x$PREFIX" != "xnotset" ]; then
if [ "x${LINK#$PREFIX}" == "x${LINK}" ]; then
# prefix was not in the link
- echo "$LINK"
+ if [ ! -e "$LINK" ]; then
+ [ -e "$PREFIX/$LINK" ] && echo "./$LINK"
+ else
+ echo "$LINK"
+ fi
else
# prefix was in the link
echo ./"${LINK#$PREFIX}"
@@ -206,8 +212,7 @@ get_link_chain() {
# - libc.so, ld-linux.so
#
list_basic_libs() {
- for i in $(ldd ${SHELL})
- do
+ for i in $(ldd ${SHELL}); do
[ $(echo $i | grep '^/' | grep -c ld) -eq 1 -o $(echo $i | grep '^/' | grep -c libc.so) -eq 1 ] && get_link_chain $i
done
}