From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6816610675337461760 X-Received: by 2002:ac2:569b:: with SMTP id 27mr16321437lfr.134.1587540319522; Wed, 22 Apr 2020 00:25:19 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:9397:: with SMTP id g23ls222836ljh.7.gmail; Wed, 22 Apr 2020 00:25:19 -0700 (PDT) X-Google-Smtp-Source: APiQypIlF6c0ujck2k2QDCJjL8zdC6tYCtlXiWogWNyhyfSf0xWFat+KhiHcKZI1yPDd/hKzu+V/ X-Received: by 2002:a05:651c:230:: with SMTP id z16mr14342032ljn.185.1587540319012; Wed, 22 Apr 2020 00:25:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587540319; cv=none; d=google.com; s=arc-20160816; b=YHmxrHql8qDzsutxgM40BhII6gmDVweV1teDg+z3MWW0/QJNocsgm8s8beDbpmx6J5 GYCM6fmGTnwJ28JIeyFG8r/uH5/+bwXp/qN00cCjXRujLmLSKXK9Uq8t5Ox8KSrGC4pv 9d8XSXbf+nVLuXR5FQAaAVST2qCgL50wsoLu0NyrW1dckMGKAUqZhXYVeCp9H1SntHJ1 S1uMn0T7rfYxLe6pCO62wKVnhpr6bfu2yVualPPbh8uMcpCyYMKwPDhxqYH5dRAIXZCK x7pM7mLOyztXtG6NdKyvtxsznm1Qow5F6NoFRBHhf0xA0VUjeCzp6hKAKFabCkQCsXM9 Gl7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date; bh=KTLjPo5KBroxPLrwuTc0E7KHTjWAJWd6VSc9kL3Y3O0=; b=aDLbLKtvrRFCvPFR4eUgcK80HnUEDCJVlR4CqfB7gh4wbjDI3Gmtv1OdsAa1bbIWf8 5yb+5TQEV/x5OSngdchqbRRn90zjNdwe0Jf5vc74OWpn/lXaJy2VnvYFxqLD9VjnYYqO UhQcMgejixZhJWPuKXw4NuEEm0wNEv1HHiJxgPKvUS9VyVY941I5dbNJFTiOUF0RY2eI 0tN/ST7jWcVH3L0hXUJNbhubJ/YNEsS+tw9eQKs2gRT57tFTBrKvvd3aGN9S7DZmuZg4 7Jop8Mr9X/8np1Pkbgpd6HSILKJXtC9dn279JcsXT+OEHFqM+3zV0KqiiB19Z3fSBMOT XZCw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id a12si227434ljm.2.2020.04.22.00.25.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Apr 2020 00:25:19 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id 03M7PHO0017746 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Apr 2020 09:25:17 +0200 Received: from md1za8fc.ad001.siemens.net ([167.87.23.203]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 03M7PHrG016360; Wed, 22 Apr 2020 09:25:17 +0200 Date: Wed, 22 Apr 2020 09:25:16 +0200 From: Henning Schild To: Vijai Kumar K Cc: , , , Vijai Kumar K Subject: Re: [PATCH v5 05/13] deb-dl-dir: Download files only belonging to the current image Message-ID: <20200422092516.37031839@md1za8fc.ad001.siemens.net> In-Reply-To: <20200417093040.15130-6-Vijaikumar_Kanagarajan@mentor.com> References: <20200417093040.15130-1-Vijaikumar_Kanagarajan@mentor.com> <20200417093040.15130-6-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: fympv1oHQts/ On Fri, 17 Apr 2020 15:00:32 +0530 Vijai Kumar K wrote: > 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. Not sure i understand what it is doing/avoiding. Maybe you can go into more detail with an example. > 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 9399741..b3f4842 100644 > --- a/meta/classes/deb-dl-dir.bbclass > +++ b/meta/classes/deb-dl-dir.bbclass > @@ -5,6 +5,15 @@ > > inherit repository > > +check_in_rootfs() { I am confused by the logic again. And maybe the name. We already have repo_contains_package which suggests a "boolean" answer, should this one be "rootfs_contains_package"? Or maybe "has_package_installed" > + 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 )" I think you should chroot in and ask "dpkg -i", doing this kind of guessing on the outside is error-prone. > + [ -z "${output}" ] && return 1 || return 0 Again confused, in shell boolean "0" means true and anything else means false. return [ -n "${output}" ] > +} > + > debsrc_download() { > export rootfs="$1" > export rootfs_distro="$2" > @@ -18,6 +27,7 @@ debsrc_download() { > mount --bind "${DEBSRCDIR}" "${rootfs}/deb-src" > EOSUDO > find "${rootfs}/var/cache/apt/archives/" -maxdepth 1 -type f > -iname '*\.deb' | while read package; do > + check_in_rootfs "${package}" || continue This reads like you skip the download when you found package to _not_ be "in_rootfs". Henning > local src="$( dpkg-deb --show --showformat '${Source}' > "${package}" )" # If the binary package version and source package > version are different, then the # source package version will be > present inside "()" of the Source field.