]> code.ossystems Code Review - openembedded-core.git/commitdiff
gcc-cross-canadian: Clean non shipped empty directories.
authorLianhao Lu <lianhao.lu@intel.com>
Tue, 27 Mar 2012 04:38:29 +0000 (12:38 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 27 Mar 2012 12:19:53 +0000 (13:19 +0100)
Cleaning up non shipped empty directories.

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/gcc/gcc-package-sdk.inc

index 95d6804e93e2901537e39433476c49f82e1421cf..0cf62f113053060818b0ba08897533e082c58826 100644 (file)
@@ -47,11 +47,12 @@ do_install () {
        rm -f ${D}${libdir}/libiberty.a
 
        # Cleanup empty directories which are not shipped
-       # we use rmdir instead of 'rm -f' to ensure the directories are empty
-       rmdir ${D}${libdir}/../lib
-       rmdir ${D}${prefix}/${TARGET_SYS}/lib
-       rmdir ${D}${prefix}/${TARGET_SYS}
-       rmdir ${D}${includedir}
+       # we use rmdir instead of 'rm -f' to ensure the non empty directories are not deleted
+       # ${D}${libdir}/../lib only seems to appear with SDKMACHINE=i686
+       local empty_dirs="${D}${libdir}/../lib ${D}${prefix}/${TARGET_SYS}/lib ${D}${prefix}/${TARGET_SYS} ${D}${includedir}"
+       for i in $empty_dirs; do
+               [ -d $i ] && rmdir --ignore-fail-on-non-empty $i
+       done
 
        # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
        # found.