[meta-oe] gpsd: Only copy the Python files if they are created

Message ID 20220419220903.23827-1-pkj@axis.com
State New
Headers show
Series [meta-oe] gpsd: Only copy the Python files if they are created | expand

Commit Message

Peter Kjellerstedt April 19, 2022, 10:09 p.m. UTC
If one adds some configuration that disables the creation of the Python
files, e.g., minimal=yes, then the installation fails when it tries to
copy the non-existent files. Avoid this by checking for their existence
before copying them.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 meta-oe/recipes-navigation/gpsd/gpsd_3.23.1.bb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/meta-oe/recipes-navigation/gpsd/gpsd_3.23.1.bb b/meta-oe/recipes-navigation/gpsd/gpsd_3.23.1.bb
index c11d4c76d..22706f097 100644
--- a/meta-oe/recipes-navigation/gpsd/gpsd_3.23.1.bb
+++ b/meta-oe/recipes-navigation/gpsd/gpsd_3.23.1.bb
@@ -73,8 +73,10 @@  do_install:append() {
     install -m 0644 ${S}/packaging/deb/etc_default_gpsd ${D}${sysconfdir}/default/gpsd.default
 
     # Support for python
-    install -d ${D}${PYTHON_SITEPACKAGES_DIR}/gps
-    install -m 755 ${D}${libdir}/gps/*.py ${D}${PYTHON_SITEPACKAGES_DIR}/gps
+    if [ -d ${D}${libdir}/gps ]; then
+        install -d ${D}${PYTHON_SITEPACKAGES_DIR}/gps
+        install -m 755 ${D}${libdir}/gps/*.py ${D}${PYTHON_SITEPACKAGES_DIR}/gps
+    fi
 }
 
 PACKAGES =+ "libgps python3-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils"