e2fsprogs/populate-extfs.sh: fix a problem on dash
authorRobert Yang <liezhi.yang@windriver.com>
Mon, 20 Jan 2014 12:24:43 +0000 (20:24 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 21 Jan 2014 10:45:28 +0000 (10:45 +0000)
The dash can't handle the or [[ in parameter expansion, for example:

A=/usr/bin/[[
B=[[
C="${A%$B}"

The C should be "/usr/bin" in common, but it will be /usr/bin/[[ on
dash, use dirname to fix it.

NOTE:
There are 3 lines about parameter expansion, only fix the
DIR="${DIR%$TGT}" since the other 2 works will and are very useful in
this case.

[YOCTO #5712]

(From OE-Core rev: 22f90c5aec4f0b0360d1d960226f9965d83d589b)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/e2fsprogs/e2fsprogs/populate-extfs.sh

index 7de720b..9b55a4b 100644 (file)
@@ -23,7 +23,7 @@ DEBUGFS="debugfs"
        find $SRCDIR | while read FILE; do
                 TGT="${FILE##*/}"
                 DIR="${FILE#$SRCDIR}"
-                DIR="${DIR%$TGT}"
+                DIR="$(dirname $DIR)"
 
                # Skip the root dir
                [ ! -z "$DIR" ] || continue