summaryrefslogtreecommitdiff
path: root/package/pkg-generic.mk
diff options
context:
space:
mode:
authorYann E. MORIN <yann.morin.1998@free.fr>2016-10-24 18:38:52 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2016-10-26 22:36:44 +0200
commit938f47c7e89362e7b824dbd0bd1ee9839d56d603 (patch)
treec68e5842cf2a252e16d420a131c6bb659e78a253 /package/pkg-generic.mk
parentb63951da35f56a2c606b9383e6e39bfd61e92b34 (diff)
core/pkg-generic: check proper package installation
Some packages misbehave, and install files in either $(STAGING_DIR)/$(O) or in $(TARGET_DIR)/$(O) . One common reason for that is that pkgconf now prepends the sysroot path to all the paths it returns. Other reasons vary, but are mostly due to poorly writen generic-packages. And a new step hooks to check that no file gets installed in either location, called after the install-target and install-staging steps. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Romain Naour <romain.naour@openwide.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/pkg-generic.mk')
-rw-r--r--package/pkg-generic.mk15
1 files changed, 15 insertions, 0 deletions
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 33490929b..827de627e 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -95,6 +95,21 @@ define check_host_rpath
endef
GLOBAL_INSTRUMENTATION_HOOKS += check_host_rpath
+define step_check_build_dir_one
+ if [ -d $(2) ]; then \
+ printf "%s: installs files in %s\n" $(1) $(2) >&2; \
+ exit 1; \
+ fi
+endef
+
+define step_check_build_dir
+ $(if $(filter install-staging,$(2)),\
+ $(if $(filter end,$(1)),$(call step_check_build_dir_one,$(3),$(STAGING_DIR)/$(O))))
+ $(if $(filter install-target,$(2)),\
+ $(if $(filter end,$(1)),$(call step_check_build_dir_one,$(3),$(TARGET_DIR)/$(O))))
+endef
+GLOBAL_INSTRUMENTATION_HOOKS += step_check_build_dir
+
# User-supplied script
ifneq ($(BR2_INSTRUMENTATION_SCRIPTS),)
define step_user