mtd-utils.inc: flexible handling of ${mtd_utils} in do_stage and do_install
authorMartin Dietze <herbert@spamcop.net>
Sun, 29 Nov 2009 20:12:38 +0000 (21:12 +0100)
committerMartin Dietze <herbert@spamcop.net>
Sun, 29 Nov 2009 20:12:38 +0000 (21:12 +0100)
 * the include file relies on a given list of utils to be installed, but the list is not correct for all versions which include it
 * this revision adds a check for the existence of these files before trying to install/stage them

recipes/mtd/mtd-utils.inc

index dcf0e7c..813a09f 100644 (file)
@@ -17,7 +17,9 @@ do_stage () {
                install -m 0644 $f ${STAGING_INCDIR}/mtd/
        done
        for binary in ${mtd_utils}; do
-               install -m 0755 $binary ${STAGING_BINDIR}
+               if [ -f $binary ]; then
+                       install -m 0755 $binary ${STAGING_BINDIR}
+               fi
        done
 }
 
@@ -25,7 +27,9 @@ do_install () {
        install -d ${D}${bindir}
        install -d ${D}${includedir}/mtd
        for binary in ${mtd_utils}; do
-               install -m 0755 $binary ${D}${bindir}
+               if [ -f $binary ]; then
+                       install -m 0755 $binary ${D}${bindir}
+               fi
        done
        for f in ${S}/include/mtd/*.h; do
                install -m 0644 $f ${D}${includedir}/mtd