Fix "No such file or directory" error in sysroot_ld_path.sh if ld.so.conf include pattern doesn't match any file.

Sometimes ld.so.conf has pattern include like "include ld.so.conf.d/*.conf",
but there is no files that match pattern. In this case "for" loop in process_ld_so_conf
function fails with error "No such file or directory".
This patch uses "ls" to check that pattern matches at least one file.

BUG=none

Review URL: https://chromiumcodereview.appspot.com/19044004

git-svn-id: http://src.chromium.org/svn/trunk/src/build@214230 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
sl.ostapenko@samsung.com 2013-07-29 21:51:23 +00:00
Родитель b7f95e0d9e
Коммит 395cb1cd18
1 изменённых файлов: 10 добавлений и 8 удалений

Просмотреть файл

@ -46,14 +46,16 @@ process_ld_so_conf() {
echo "$ENTRY" | grep -qs ^include
if [ $? -eq 0 ]; then
local included_files=$(echo "$ENTRY" | sed 's/^include //')
for inc_file in $included_files; do
echo $inc_file | grep -qs ^/
if [ $? -eq 0 ]; then
process_ld_so_conf "$root" "$root$inc_file"
else
process_ld_so_conf "$root" "$(pwd)/$inc_file"
fi
done
if ls $included_files >/dev/null 2>&1 ; then
for inc_file in $included_files; do
echo $inc_file | grep -qs ^/
if [ $? -eq 0 ]; then
process_ld_so_conf "$root" "$root$inc_file"
else
process_ld_so_conf "$root" "$(pwd)/$inc_file"
fi
done
fi
continue
fi