From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6878157486786871296 X-Received: by 2002:a63:e145:: with SMTP id h5mr979480pgk.334.1601446054028; Tue, 29 Sep 2020 23:07:34 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:aa7:96cd:: with SMTP id h13ls417543pfq.0.gmail; Tue, 29 Sep 2020 23:07:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWZxdjq5IJiCtGBKD0YTuPToVU3b526uBH7b725F8HFRV9m62S/CTmaigPU/ufVPbF9e1O X-Received: by 2002:a63:5349:: with SMTP id t9mr978898pgl.62.1601446053390; Tue, 29 Sep 2020 23:07:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601446053; cv=none; d=google.com; s=arc-20160816; b=s3jRLcMg/tfwSFv2g5yyUOB3w+cBSzuNQeFY/P6L/qyp8emHHinYcFuiAX8VFZFACW 2aXWyKZvijgNsZ9wJdSbnkqoLESDnRrwRGFN/c9upzlL1noj43CSR06BIe9V3Y6bWIwf rPZ7kymAXHDEdsBzQRXQr7o+3R98SiEU7pQt8UC/MnbOOhUBuGHCnBSUq32Ev6Rq2wgc iq5ysUDr3yNgzRECF/o+aJ6faa0ATBEeQ/RMG/YvRKC7C7lC+RfhX8QVT6y1zkBrt+fd av9qGYJKr9jioFheRnF7+GCZufsVS0HsnmtXhaVy05phoP8JmvX6BgSq/VLxEZVmJSDp TFPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:ironport-sdr:ironport-sdr; bh=no9hSo7RZllFmyagmgiwNi3BFDjxbPTReSBDBoqfkwo=; b=uK455B5WXmTaSpifHTiluh1iNlDmQzK9leCSW0C1Kx3Dd6zg9R4HcSosrCeIjOWLKx bIDRuaAouyvzFPAdNttofgPN0vzYqp0kdLaLUYmGhC4SmC8rJs/Xu/wzTQsETSThbFXL oucQhx3yIIMJFRIoJCBRXRf7sk97lYqjFlcnEYhDfC+lz93CriGT8b78hbGO54or7Rdf aUWWrG0h3rxIq8IeUg3L9leAbo5IBhhdqosr2R2p3ubpMQmRlSaNqWEAEco/suWFUAIb 7T7OfsT1rJC3fYI1lsjsFN42XuNoYmDLb175k3EBKcfl1xYgfCttjmTL3fb6sHlP4HwA vLxg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com. [68.232.141.98]) by gmr-mx.google.com with ESMTPS id e18si48100pld.5.2020.09.29.23.07.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Sep 2020 23:07:33 -0700 (PDT) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) client-ip=68.232.141.98; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com IronPort-SDR: cIejVpjFocDwOVk0rEpnV+FLu3K9RckAp4n3CjtuZlvf6z63yYvEpSCkV6B7HD7Sa9Ox8BJck9 U94GdMtJzvwlY0CMeV2M0Jla7VnB2Ws1vbMyVkL4CrlcPFR5WkV3Ug1q/9LODxIV+Z7M7ZVyEZ KRgs/zdVBXM5+sBOmA2vJFCqZGz4k8mQ9v43ne6O4cUeFHEWtiWj4uz2inGh0cqjxahuOMSNst u04Qx3HGUaJhUyU+dIroRTBo38zEcPBfyAHYhxgvf8S/jtxeix4/25IEuWbMesRhOcpBcxl+6j fHc= X-IronPort-AV: E=Sophos;i="5.77,321,1596528000"; d="scan'208";a="53462093" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 29 Sep 2020 22:07:32 -0800 IronPort-SDR: TJR1qBDkGA3Jlab1OyDANsKv524cKo/xMxqT+mRPeaIH8JlunV30/0TYEXGPmH5HncW2cYVwq2 9h1BtLeRTvJGKtW2cSytf1ZcxEN08/K2/ykBsex6gcnuC1ezX8BqRHQpvbkG9CxyZPIsSzUAE9 NC6q34CmTQ4zYEfO6v5SqTRWZ9MMSbmwdqwdKaETV5YXSOny/pUeMZvRaSI0t37M0icRaByObg 8lnC6o4FhU/06ut+b630wk/f4AofRTJ8g5i6ud54HcEQdtW/MJAEC1NQ6y+04KzuETstfPJK3P UH0= From: Vijai Kumar K To: CC: Vijai Kumar K Subject: [PATCH v6 05/13] deb-dl-dir: Download files only belonging to the current image Date: Wed, 30 Sep 2020 11:36:59 +0530 Message-ID: <20200930060707.12785-2-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200930060707.12785-1-Vijaikumar_Kanagarajan@mentor.com> References: <20200930060259.12422-4-Vijaikumar_Kanagarajan@mentor.com> <20200930060707.12785-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Return-Path: Vijaikumar_Kanagarajan@mentor.com X-ClientProxiedBy: SVR-ORW-MBX-06.mgc.mentorg.com (147.34.90.206) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-TUID: gFR1l+hYWM/y Avoid downloading deb-srcs for debs cached from other image builds. One way to ensure that is to see if the package is present in the dpkg status file. Signed-off-by: Vijai Kumar K --- meta/classes/deb-dl-dir.bbclass | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/meta/classes/deb-dl-dir.bbclass b/meta/classes/deb-dl-dir.bbclass index 79a9a88..ce691cf 100644 --- a/meta/classes/deb-dl-dir.bbclass +++ b/meta/classes/deb-dl-dir.bbclass @@ -5,6 +5,15 @@ inherit repository +is_not_part_of_current_build() { + local package="$( dpkg-deb --show --showformat '${Package}' "${1}" )" + local output="$( grep -hs "^Package: ${package}" \ + "${IMAGE_ROOTFS}"/var/lib/dpkg/status \ + "${BUILDCHROOT_HOST_DIR}"/var/lib/dpkg/status \ + "${BUILDCHROOT_TARGET_DIR}"/var/lib/dpkg/status )" + [ -z "${output}" ] +} + debsrc_download() { export rootfs="$1" export rootfs_distro="$2" @@ -18,6 +27,7 @@ EOSUDO set -e printenv | grep -q BB_VERBOSE_LOGS && set -x find "${rootfs}/var/cache/apt/archives/" -maxdepth 1 -type f -iname '*\.deb' | while read package; do + is_not_part_of_current_build "${package}" && continue local src="$( dpkg-deb --show --showformat '${source:Package}' "${package}" )" local version="$( dpkg-deb --show --showformat '${source:Version}' "${package}" )" local dscfile=$(find "${DEBSRCDIR}"/"${rootfs_distro}" -name "${src}_${version}.dsc") -- 2.17.1