From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6899390751905415168 X-Received: by 2002:a17:906:2452:: with SMTP id a18mr2242634ejb.66.1606389605596; Thu, 26 Nov 2020 03:20:05 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:906:b088:: with SMTP id x8ls774281ejy.6.gmail; Thu, 26 Nov 2020 03:20:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJws3RiEtSHGAydil2isCVNl1WPWmxwRIiKz42IuYnLNzJm3IX3wLE6YtWMwSjqhetISPGWv X-Received: by 2002:a17:906:f881:: with SMTP id lg1mr2134383ejb.133.1606389604753; Thu, 26 Nov 2020 03:20:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606389604; cv=none; d=google.com; s=arc-20160816; b=qsqtpZ0SqO2hLIi3LxeZNpH5oph+EsZHqr5KV3PejiaNKA4aucGed8I9p15crVC/fh RQrMUCQBElOMShvDPcOtNIheItrH+3RsApMovPzYLJgLWuybL+UDUmuJybcI3IIo6ecT MPzj0aP+CzYDMo3J56UuhTqdx0K83UAwUtvv4ox0NVbmp4OsXuE6xp9sM6lQwbPxhWVE jrrzT2VpKYj5PDljxnQgFHl+D2/ZfsTxQpn0UwGJCRzKx+kD2OBmzwk0sKzYmV4h1MnM 91ZuA05fMalA9k4PT/UtMOqTRzV05pwwOREG07x3REhgCtPH+54TnONikrOm4DuvmNx6 NsPw== 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=NqdlHWbslZz6Koeg529KaDOuH+cifcn0yWfiuZubAEo=; b=LsK3RWeZ21+9gsTYf1c6xS9YR22fRC0uB7teF73Wwt9BOgulpu8x0/pHeBrD3uZvto +jXy5lvPNky1dBsrp8fwcnDArkKDKhL6Q6taGWoRtAKASN4Zxe7UUeF3Ds233sqoTyNs 7NGTx+Gwqm61uLNtB/Qzikx3DaOiQd/VpMzSHGZaZmDfPtwbaguc3jkqxIF8y7ZcfzWW pu4TNeF1+msmmB/9pkssQV5vgnH2J8EpshC41QLdYohexklm6FlHD7FQrlYb9MjOLnAq wT4+3SdpoNfndzGT0A/Sf+DZMand75iajHVnleiA7G5LcgI9BN/Ns04gHVmW5OanziZT /F9w== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com. [68.232.137.180]) by gmr-mx.google.com with ESMTPS id v7si292239edj.5.2020.11.26.03.20.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Nov 2020 03:20:04 -0800 (PST) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.180 as permitted sender) client-ip=68.232.137.180; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com IronPort-SDR: jhD36xtA4eV02JbzMFOYB8T/4LFuAxZp8WSS22CmezfOSEXDpoUSRZQkLL6PyaxiRpRd36LKyN VUbWNPk0boZ8qzqylDf7BN3aqYtvYyi8khc4rrCoB0ETFiGjcESXRxKV9CeWHZ8gRBBgm0yUaD DFZ4qJQaHsuN7z8w97ZJ8Amsa3kDq6k9FVWC8toNeqdZDJFLf5JzYnFSOj2uqvMto6Rewi5tth a4XZrXF64AVS0jSWghlI5itab8gqjff2qQ7HZEd4szkgyBQEWvxsEBAdFd5SxerNRTn7YaXh/a Hpc= X-IronPort-AV: E=Sophos;i="5.78,371,1599552000"; d="scan'208";a="55500418" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 26 Nov 2020 03:20:03 -0800 IronPort-SDR: punq1KMA7sMysw+GakBNqQxky9QnOQ9AuIn7wYkN/YaX5K2uGzhZu3ds7/8H1tdwNS/rugdwaP RsIhFAyfVbZFCpIr0gjVKi/dRgyIIYon2m0R/DTQvrSZKFqUGNBic98KrYqDS7FamF/GvXzSzQ LGaU5l4W9OiiGEQ/3PbcZgEjNztn1AiT25ddtqV0UhILjtBO1r+O6q90EwquCJ8Re+LbBRq+wC 31LTkAEW4dL/4qsqaMGBOmal3lGx2Laz7OJ/MtlYeCwzUby88VnZ2lxLtWYk65EwHizBopJIJa pq8= From: Vijai Kumar K To: , CC: Vijai Kumar K Subject: [PATCH v9 05/14] deb-dl-dir: Download files only belonging to the current image Date: Thu, 26 Nov 2020 16:49:03 +0530 Message-ID: <20201126111912.3037-6-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201126111912.3037-1-Vijaikumar_Kanagarajan@mentor.com> References: <20201126111912.3037-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Return-Path: Vijaikumar_Kanagarajan@mentor.com X-ClientProxiedBy: SVR-ORW-MBX-09.mgc.mentorg.com (147.34.90.209) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-TUID: SzfNOW3tq2x0 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 0e2cef2..410befd 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