populate-extfs.sh: fix to handle /var/lib/opkg/alternatives/[[ correctly

There was a patch trying to fix this problem by using 'dirname', but it
caused some build failures, thus got reverted.

The problem is that $DIR might be empty and we should first do the check
before trying to use $(dirname $DIR).

[YOCTO #5712]

(From OE-Core rev: 8277c71747758e2ba0815a6f5cd11c9e0c9c90ce)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Chen Qi 2014-06-19 10:11:32 +08:00 committed by Richard Purdie
parent 09d260e3e5
commit 8c346a66b5
1 changed files with 2 additions and 1 deletions

View File

@ -23,12 +23,13 @@ DEBUGFS="debugfs"
find $SRCDIR | while read FILE; do
TGT="${FILE##*/}"
DIR="${FILE#$SRCDIR}"
DIR="${DIR%$TGT}"
# Skip the root dir
[ ! -z "$DIR" ] || continue
[ ! -z "$TGT" ] || continue
DIR="$(dirname $DIR)"
if [ "$DIR" != "$CWD" ]; then
echo "cd $DIR"
CWD="$DIR"