]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blobdiff - package/pkg-kconfig.mk
infra/pkg-kconfig: do not update-(def)config to a directory
[coffee/buildroot.git] / package / pkg-kconfig.mk
index 0da6d0ab4e5653eeceee07b6c6692cd98c5be439..81bba5220c61c029e903ed1ab11caa2c15ec91ce 100644 (file)
@@ -18,6 +18,11 @@ define kconfig-package-update-config
                echo "Unable to perform $(@) when fragment files are set"; exit 1)
        @$(if $($(PKG)_KCONFIG_DEFCONFIG), \
                echo "Unable to perform $(@) when using a defconfig rule"; exit 1)
+       $(Q)if [ -d $($(PKG)_KCONFIG_FILE) ]; then \
+               echo "Unable to perform $(@) when $($(PKG)_KCONFIG_FILE) is a directory"; \
+               exit 1; \
+       fi
+       $(Q)mkdir -p $(dir $($(PKG)_KCONFIG_FILE))
        cp -f $($(PKG)_DIR)/$(1) $($(PKG)_KCONFIG_FILE)
        $(Q)touch --reference $($(PKG)_DIR)/$($(PKG)_KCONFIG_DOTCONFIG) $($(PKG)_KCONFIG_FILE)
 endef