From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6899501277566205952 X-Received: by 2002:adf:82ca:: with SMTP id 68mr5411880wrc.332.1606415344171; Thu, 26 Nov 2020 10:29:04 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:a4c2:: with SMTP id n185ls1357672wme.2.canary-gmail; Thu, 26 Nov 2020 10:29:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1SA+ilmV0a+9+lLt40CZf+HhlRChmZ+kbaVvETx/4z3rY+Hdy5DZWpZ+yS6ONSAjX0iRN X-Received: by 2002:a1c:808d:: with SMTP id b135mr4672215wmd.45.1606415343351; Thu, 26 Nov 2020 10:29:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606415343; cv=none; d=google.com; s=arc-20160816; b=o5rzTulR/JL8YFsxX49bUzqag3A3seR9TWOLWKCzOFUTwkx+F1eXDynWW6XBeBWdQx HlQPN7TlfkbYDjhfVMNa7644ZrqtFU2hDQk6gVM15UH4vJuEG/kFySaDT2c69TBVvprU lrh/ziq7W0zn9WNKbasjaSudCOd818eTyShnnSoOJFTt9t24EM5OlXvKPwO16vSfio2X BLiz3wnpV4LBA5PcPESHk3U7PREYF2fKiXxOFttGOBc8wnizbL2kNmeoylo9IqPvxsWt 9XXpP+8fp5+9odZlmJzt+CCXCJ9rvOyuGfcwJXjyhTY3jnQw+2Ol9Fl9+0bRy8ZlyLj6 IFIg== 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=nnvtzJhMc7REDutJqhVZ622UWfcDQ+xCPG2UXd5Ej6A=; b=REW3bioEL1FVGVQfTgrFbHFpwynA6jBg9eBHQXcWQaWEv+uYXnzgXbhdA7sm28WZ3I AAJyGkHE73Pv1KYaXjoxUPudcp/KGyt5cY5gGHusaGdAHUjKElh/NlvOgCR3uvZ/9zRa xxJSZg/tv9u4ZS0VK4eDNTdstQiZWvEKuFB0ruKOsROa05p1m7fCMukyVT/6Xutw7QzT /zpqX4fDLYmsT07bvbzU/yIHGcrhwARGxig6EgVbjv95ELR/qLe/oGWgWGbicNMBp1aN /rLDSiLol5i6eDm7xEdgV7Hc+ZJO9yCWQOes2c2JH5R37nuHj9qgVjGHT+Ghu+HD4UDQ bV4Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com. [68.232.137.252]) by gmr-mx.google.com with ESMTPS id y187si226499wmd.1.2020.11.26.10.29.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Nov 2020 10:29:03 -0800 (PST) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) client-ip=68.232.137.252; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com IronPort-SDR: kANV+D5EosgT+Wjer7igmQEDX9QxNt3bImqyzK/+mAXA65XnV+nCOrCFRdKIZ+eFjKPGqb1jo4 LrLJVWCGvHHaLuDtxGAx++jVa9Qye87dKZYhH8BxIAdLt0i4+0Q0Y9aIIGZTD8lw9exx2I4+sv 66YnEDcPaOt9JpfKhDyxyUk4DqMUjQXAsk/HwoBpn1rN2f5E9oxsxOJU1jGPYwB9KVacjNjJUR qPu3o+1vm8ByPntndxjSoyq7tUPohhrMYXrefmI2BqcKeOxMbWGqwY2cV92D8o1FmHJM+dKRIX 6QQ= X-IronPort-AV: E=Sophos;i="5.78,372,1599552000"; d="scan'208";a="55644677" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 26 Nov 2020 10:29:02 -0800 IronPort-SDR: EbtxfevqnDUKnUmS+VoyzPOMx1sVuXqtocERArTRvBdfSr3zNePq9f/QazpxBgEodMwnD4TSST nApcJzVA+swiCq2noNBWryjV3uDiFFpLYbra5sl24jQIwDvlum5EKIcSQcJ1TylGXYVCKTCPfu 0kgb2IW/zJgXeczIsY1E5R7vaCgkyBZlUK6zee8Ur5W+Q6LRmyTDKTPj4SW53m0gqa2GN3VjAc EKFqnwKM9I9FUvZHoyOMPDtt/oOcIpkXqEGUCIFoftuQqY3jWDa6XAELuW6Lv/lp3TKS3vFRmN +nk= From: Vijai Kumar K To: CC: Vijai Kumar K Subject: [PATCH v10 07/14] deb-dl-dir: Fix skipping of removed files Date: Thu, 26 Nov 2020 23:58:11 +0530 Message-ID: <20201126182818.7261-8-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201126182818.7261-1-Vijaikumar_Kanagarajan@mentor.com> References: <20201126182818.7261-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Return-Path: Vijaikumar_Kanagarajan@mentor.com X-ClientProxiedBy: svr-orw-mbx-04.mgc.mentorg.com (147.34.90.204) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-TUID: wk4R8f/z4mPR Some packages are installed and then removed, like localepurge from image-locales-extension.bbclass. Those information would not be available in dpkg status file. Use dpkg log instead to see if the package has been used on the target. Signed-off-by: Vijai Kumar K --- meta/classes/deb-dl-dir.bbclass | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/meta/classes/deb-dl-dir.bbclass b/meta/classes/deb-dl-dir.bbclass index 64d1823..29bf45b 100644 --- a/meta/classes/deb-dl-dir.bbclass +++ b/meta/classes/deb-dl-dir.bbclass @@ -7,10 +7,16 @@ 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 )" + local arch="$( dpkg-deb --show --showformat '${Architecture}' "${1}" )" + local version="$( dpkg-deb --show --showformat '${Version}' "${1}" )" + # Since we are parsing all the debs in DEBDIR, we can to some extend + # try to eliminate some debs that are not part of the current multiconfig + # build using the below method. + local output="$( grep -hs "status installed ${package}:${arch} ${version}" \ + "${IMAGE_ROOTFS}"/var/log/dpkg.log \ + "${BUILDCHROOT_HOST_DIR}"/var/log/dpkg.log \ + "${BUILDCHROOT_TARGET_DIR}"/var/log/dpkg.log | head -1 )" + [ -z "${output}" ] } -- 2.17.1