From patchwork Fri Mar 11 18:11:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 596446 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 1258F140180 for ; Sat, 12 Mar 2016 05:11:18 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=UUPWk9+C; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id AB2B695EB7; Fri, 11 Mar 2016 18:11:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TWM3HT0uUs1h; Fri, 11 Mar 2016 18:11:16 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id D86B895ED1; Fri, 11 Mar 2016 18:11:15 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id A68001CF176 for ; Fri, 11 Mar 2016 18:11:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9DB00A6316 for ; Fri, 11 Mar 2016 18:11:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fK0UggGdmSnJ for ; Fri, 11 Mar 2016 18:11:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by fraxinus.osuosl.org (Postfix) with ESMTPS id B3BFBA62CE for ; Fri, 11 Mar 2016 18:11:12 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id p65so3846409wmp.1 for ; Fri, 11 Mar 2016 10:11:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=XLEPWvw8oWZOP/jiOS9kHX7chIQpofWj0exV5j6setw=; b=UUPWk9+CNQyuqzLFbVbdVg0K+dhFjsC39XsRR1NUme1uwnGqaGxwvbns87vizcyi+3 SF+fe1/zlLKxOI9PvhhAAfwDJBcNKgaM7LjV40jmnTmjEB2zYwrHIYC/j8xXArB4tAP7 TrRb7ueMW2FegilzR+5hqtUrOP5WWshB850kLaUzR8WP0uYt8Y8eA7BCDBBAg5QXhiHo hhgONjLMapZWjWV3/QlYmJHjNPfdeHG0SkAxeOlh5aIZhJehadnXR6Y/8yNIoq4F8bdP VE5nOBzPvBV576tK4BlVvl2RK4nL563NS/ET+H8My4FjHWIIwF40gjDL7ZOlYmWGHGO/ 3BXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=XLEPWvw8oWZOP/jiOS9kHX7chIQpofWj0exV5j6setw=; b=HdLXBjT7N6evQxNGkccTQbpgQ1acZfla3VXikhEUfhdQxLWISFNPUEiWKryksSTYKn gV5DoKOGGR/EJc0ozWcG/aKjTpoX+ajPkwQe6wuV4cRY2luLfEkcl5C4br/1NhEpBPiT Vty32CgRdyo1kDYoDCSqIXuLOZbUuYTWe+DMKWDlwHmXB9hdMG7HHOl40tvvPTFK/dkF 4oODVqaPXPVmCyYuS7kchuIfePv2ARGhYer5/hapSE9ATLxv7ZB9ldL4TfUroGHP7Lmf VHmVl3pBxLgOtJFA1uaKTma1743ntlcvdxitmK+DblJf/gTibiGzRytysM70/cEDCkWh cdKw== X-Gm-Message-State: AD7BkJK8kzQc9UKo/TT9KuyNBFSq1+cahCylqSJmWPhm28bXX1fEE3X1zhLiRWVIfWMtqw== X-Received: by 10.194.22.97 with SMTP id c1mr11321802wjf.19.1457719871389; Fri, 11 Mar 2016 10:11:11 -0800 (PST) Received: from gourin.bzh.lan (ns304657.ip-46-105-103.eu. [46.105.103.66]) by smtp.gmail.com with ESMTPSA id k124sm3374347wmb.11.2016.03.11.10.11.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Mar 2016 10:11:10 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Fri, 11 Mar 2016 19:11:03 +0100 Message-Id: <11e477b207329f6971e2dd87899cde5d16df2ed7.1457719643.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Cc: Thomas Petazzoni , "Yann E. MORIN" , Romain Naour Subject: [Buildroot] [PATCH 3/3 v2] core/pkg-generic: check proper package installation X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" 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" Cc: Thomas Petazzoni Cc: Romain Naour --- package/pkg-generic.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 3904c09..244983a 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