From e6bbf8437cd24d664c3583f7714ef6c450016fd9 Mon Sep 17 00:00:00 2001 From: Alexey I. Froloff Date: Tue, 31 Aug 2010 12:14:50 +0400 Subject: [PATCH 1/2] Do not process non-ELF's with ldd Signed-off-by: Alexey I. Froloff --- arepo.py | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/arepo.py b/arepo.py index 2cb7ec8..b41b938 100755 --- a/arepo.py +++ b/arepo.py @@ -554,15 +554,21 @@ for file in "$@"; do install -d -- "%buildroot$file" else echo === $file - list="${list} `ldd "$file"|cut -d '>' -f 2|grep \.so|cut -f 1 -d '('`" + case "$(file -L -- "$file")" in + 'ELF '*' shared object'|'ELF '*' executable') + list="${list} `ldd "$file"|cut -d '>' -f 2|grep \.so|cut -f 1 -d '('`" + ;; + esac mkdir -p -- "`dirname %buildroot$file`" cp -a -- "$file" "%buildroot$file" fi done -list=`for l in $list; do echo $l; done|sort|uniq` -list=`for l in $list; do rpm -qf --queryformat '%{NAME}\n' $l; done|sort|uniq` -echo search for $pkg in $list -for l in $list; do [ $l = $pkg ] && echo skip $l || echo i586-$l >> ${TMP:-/tmp}/${pkg}-requires; done +if [ -n "$list" ]; then + list=`for l in $list; do echo $l; done|sort|uniq` + list=`for l in $list; do rpm -qf --queryformat '%{NAME}\n' $l; done|sort|uniq` + echo search for $pkg in $list + for l in $list; do [ $l = $pkg ] && echo skip $l || echo i586-$l >> ${TMP:-/tmp}/${pkg}-requires; done +fi EOF chmod +x install.sh -- 1.7.1.1