diff mbox series

[2/2] harfbuzz: remove bindir only if it exists

Message ID 20230104114555.575278-2-kubiznak@2n.com
State New
Headers show
Series [1/2] gobject-introspection: check for GI_DATA_ENABLED | expand

Commit Message

Petr Kubizňák - 2N Jan. 4, 2023, 11:45 a.m. UTC
In some scenarios (e.g. when "glib" removed from PACKAGECONFIG),
"${D}${bindir}" might not exist which caused `rmdir` to fail.

Signed-off-by: Petr Kubizňák <kubiznak@2n.com>
---
 meta/recipes-graphics/harfbuzz/harfbuzz_5.3.1.bb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/meta/recipes-graphics/harfbuzz/harfbuzz_5.3.1.bb b/meta/recipes-graphics/harfbuzz/harfbuzz_5.3.1.bb
index f56403d428..26692d4e13 100644
--- a/meta/recipes-graphics/harfbuzz/harfbuzz_5.3.1.bb
+++ b/meta/recipes-graphics/harfbuzz/harfbuzz_5.3.1.bb
@@ -30,9 +30,9 @@  PACKAGES =+ "${PN}-icu ${PN}-icu-dev ${PN}-subset"
 LEAD_SONAME = "libharfbuzz.so"
 
 do_install:append() {
-    # If no tools are installed due to PACKAGECONFIG then this directory is
-    #still installed, so remove it to stop packaging wanings.
-    rmdir --ignore-fail-on-non-empty ${D}${bindir}
+    # If no tools are installed due to PACKAGECONFIG then this directory might
+    # still be installed, so remove it to stop packaging warnings.
+    [ ! -d ${D}${bindir} ] || rmdir --ignore-fail-on-non-empty ${D}${bindir}
 }
 
 FILES:${PN}-icu = "${libdir}/libharfbuzz-icu.so.*"