From patchwork Fri Feb 24 10:21:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 732038 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vV6Zt3kXfz9s7x for ; Fri, 24 Feb 2017 21:21:26 +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="Fmg3jcx0"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C1D488BAE1; Fri, 24 Feb 2017 10:21:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WWe4Zc84Dm9z; Fri, 24 Feb 2017 10:21:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 02F738BA7C; Fri, 24 Feb 2017 10:21:21 +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 45E081C0028 for ; Fri, 24 Feb 2017 10:21:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 330B4C28D8 for ; Fri, 24 Feb 2017 10:21:20 +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 nJDvhm4wVTkg for ; Fri, 24 Feb 2017 10:21:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 5E5A9C28A6 for ; Fri, 24 Feb 2017 10:21:19 +0000 (UTC) Received: by mail-wr0-f193.google.com with SMTP id o22so827359wro.3 for ; Fri, 24 Feb 2017 02:21:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=QP6vOVRMXWHgmiXqmCnjGRGL6FefBg/Ch/+9YplzbLs=; b=Fmg3jcx0hDfXF8XzaPvewEPG8r5IVay0Zxh5sLRNm5YpPQlPRCOa9RKMKiPabpncpt xe5Ow5QfV0ub0La/jtQWaMMQinhtHgDn0nwO89rkUr9mg/oZmeo95ICeBSFFDUUEDxr3 pzaJLEarOZg8aZFzu/IqojcdqTu5GqPtn+dlvmRVAn1P/enksx7xPJowKzTXtFv7K3uU JDrBaQuUYf/UV3RHGzByD666yD29rK7hSfIG6uBYWp6BrPr6ASIBSgoh8xPKLkgde5YV xIy8RY2CbicrZsOJRPLih/kBXWwr7G85JSOJuDGK6WOFrzVjQ5hdIXMnnEhR9I8jqbb9 Oo4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=QP6vOVRMXWHgmiXqmCnjGRGL6FefBg/Ch/+9YplzbLs=; b=bp+k2MWRLq2V2HQgBxOt6DJtTAaAhSKKJUGcSE+a2FQJkhxtyyW9ThD4YuMHptCttm z0isbxpeCDN2ujPUF38Ug54KFBuORHOa9mzbuVrpiYbUucwAYt9+rZyDbDnXD+2u8Jhb BKxqBzxBsKQPk/RutPVkp1NyKIIL7jw/03RV9rbRqvvRJIXsW7ncitTgTxrfEYb3yEMz D2vwF/wrt+cEwHLsIEf/IznKLz5ytR74OJNaARe7Yv5DagNS5Sa4Ge5/wStjq9jBABeN 04ZyUlWfo1CUwW86Q5DEVwH1UTUL08Ex822Um/pjUPvmHRZtcC0n+pwBCKLUFE/yKNr5 JLiQ== X-Gm-Message-State: AMke39lVbZE0bxOT0I+1BVBV3Q/sYnQvwqQe5f6jR3ZXZQvdte06lhlpR71M46C3s5bHVA== X-Received: by 10.223.136.143 with SMTP id f15mr1730256wrf.68.1487931677828; Fri, 24 Feb 2017 02:21:17 -0800 (PST) Received: from gourin.bzh.lan (ns304657.ip-46-105-103.eu. [46.105.103.66]) by smtp.gmail.com with ESMTPSA id 32sm9707658wre.15.2017.02.24.02.21.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Feb 2017 02:21:17 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Fri, 24 Feb 2017 11:21:13 +0100 Message-Id: <1487931673-27918-1-git-send-email-yann.morin.1998@free.fr> X-Mailer: git-send-email 2.7.4 Cc: Thomas Petazzoni , "Yann E. MORIN" Subject: [Buildroot] [PATCH v2] core/pkg-generic: store file->package list for staging too 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" Currently, we store the list of files installed in target and associate each of them to the package that installed it. However, we sometime may need to know what package installed which file in staging too, for example to debug header collision. Enhance the step instrumentation to also generate the list for staging. Only redirect once, not for each added file. Also remove the intermediate files. Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni --- package/pkg-generic.mk | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index e8a8021..d8cf642 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -62,7 +62,7 @@ GLOBAL_INSTRUMENTATION_HOOKS += step_time # files currently installed in the target. Note that the MD5 is also # stored, in order to identify if the files are overwritten. define step_pkg_size_start - (cd $(TARGET_DIR) ; find . -type f -print0 | xargs -0 md5sum) | sort > \ + (cd $(2) ; find . -type f -print0 | xargs -0 md5sum) | sort > \ $($(PKG)_DIR)/.br_filelist_before endef @@ -72,18 +72,22 @@ endef # a diff with the .br_filelist_before to compute the list of files # installed by this package. define step_pkg_size_end - (cd $(TARGET_DIR); find . -type f -print0 | xargs -0 md5sum) | sort > \ + (cd $(2); find . -type f -print0 | xargs -0 md5sum) | sort > \ $($(PKG)_DIR)/.br_filelist_after comm -13 $($(PKG)_DIR)/.br_filelist_before $($(PKG)_DIR)/.br_filelist_after | \ while read hash file ; do \ - echo "$(1),$${file}" >> $(BUILD_DIR)/packages-file-list.txt ; \ - done + echo "$(1),$${file}" ; \ + done >> $(BUILD_DIR)/packages-file-list$(3).txt + rm -f $($(PKG)_DIR)/.br_filelist_before $($(PKG)_DIR)/.br_filelist_after endef define step_pkg_size $(if $(filter install-target,$(2)),\ - $(if $(filter start,$(1)),$(call step_pkg_size_start,$(3))) \ - $(if $(filter end,$(1)),$(call step_pkg_size_end,$(3)))) + $(if $(filter start,$(1)),$(call step_pkg_size_start,$(3),$(TARGET_DIR))) \ + $(if $(filter end,$(1)),$(call step_pkg_size_end,$(3),$(TARGET_DIR)))) + $(if $(filter install-staging,$(2)),\ + $(if $(filter start,$(1)),$(call step_pkg_size_start,$(3),$(STAGING_DIR),-staging)) \ + $(if $(filter end,$(1)),$(call step_pkg_size_end,$(3),$(STAGING_DIR),-staging))) endef GLOBAL_INSTRUMENTATION_HOOKS += step_pkg_size