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]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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"